bugGNU Octave - Bugs: bug #64590, Wrong behavior of mkoctfile when...


bug #64590: Wrong behavior of mkoctfile when option -fdebug-prefix-map is present

Submitter:  Rafael Laboissière <rlaboiss>
Submitted:  Thu 24 Aug 2023 01:36:55 PM UTC
Category:  Other Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 8.3.0 Operating System:  * Any
Fixed Release:  8.4.0 Planned Release:  8.4.0
* Mandatory Fields

Add a New Comment Rich Markup

Mon 28 Aug 2023 09:50:19 AM UTC, comment #4: 

Thank you for testing.

I pushed the change to the stable branch (with minor changes to the comment):

It should be part of Octave 8.4.0 (if that is released) or Octave 9.

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Mon 28 Aug 2023 09:03:24 AM UTC, comment #3: 

I confirm that the proposed patch to src/mkoctfile.in.cc fixed the issue.

Rafael Laboissière <rlaboiss>
Sat 26 Aug 2023 11:08:05 AM UTC, comment #2: 

Thank you for bringing this to our attention.
Does the following change avoid the issue?

diff -r d313e8ece0b8 src/mkoctfile.in.cc
--- a/src/mkoctfile.in.cc        Sat May 13 13:57:14 2023 +0200
+++ b/src/mkoctfile.in.cc        Sat Aug 26 13:06:17 2023 +0200
@@ -943,9 +943,12 @@
           // Pass through any unrecognized options.
           pass_on_options += (' ' + arg);
-          // Check for an additional argument following the option.
+          // If the current argument does not contain a `=` character, check
+          // for an additional argument following the option.
           // However, don't check the final position which is typically a file
-          if (i < argc-2)
+          // FIXME: We might be skipping to parse some option with this.
+          //        See bugs #52928 and #64590.
+          if (i < argc-2 && (arg.find ('=') == std::string::npos))
               arg = argv[i+1];
               if (arg[0] != '-')

Markus Mützel <mmuetzel>
Group administrator
Thu 24 Aug 2023 01:52:32 PM UTC, comment #1: 

Just for the record, I came across this problem in analyzing Debian Bug#1050082.

Rafael Laboissière <rlaboiss>
Thu 24 Aug 2023 01:36:55 PM UTC, original submission:  

I came across an issue with mkoctfile, which can be exercised with the Makefile attached to this message. When copying it to an empty directory and running "make", it produces the output below.

touch b.cc
touch a.cc
mkoctfile --verbose -c a.cc
g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.3.0/octave/.. -I/usr/include/octave-8.3.0/octave  -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-8.3.0=. -flto=aut
o -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security    a.cc -o a.o
===== FINE
mkoctfile --verbose b.cc a.o
g++ -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-8.3.0/octave/.. -I/usr/include/octave-8.3.0/octave  -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-8.3.0=. -flto=aut
o -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security    b.cc -o /var/tmp/oct-8sYg58.o
g++ -I/usr/include/octave-8.3.0/octave/.. -I/usr/include/octave-8.3.0/octave  -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-8.3.0=. -flto=auto -ffat-lto-objects -fstack-protector-str
ong -Wformat -Werror=format-security  -o b.oct  a.o /var/tmp/oct-8sYg58.o   -shared -Wl,-Bsymbolic  -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic  -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic  -flto=a
uto -ffat-lto-objects -Wl,-z,relro
===== FAIL
mkoctfile --verbose -fdebug-prefix-map=.=. b.cc a.o
g++ -I/usr/include/octave-8.3.0/octave/.. -I/usr/include/octave-8.3.0/octave  -pthread -fopenmp -g -O2 -ffile-prefix-map=/build/reproducible-path/octave-8.3.0=. -flto=auto -ffat-lto-objects -fstack-protector-str
ong -Wformat -Werror=format-security  -fdebug-prefix-map=.=. b.cc -o a.oct  a.o   -shared -Wl,-Bsymbolic  -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic  -L/usr/lib/x86_64-linux-gnu -shared -Wl,-Bsymbolic  -
flto=auto -ffat-lto-objects -Wl,-z,relro
rm a.cc

This Makefile has two targets "fine" and "fail", whose difference is only the presence (or absence) of option -fdebug-prefix-map when invoking mkoctfile. In both cases, the output file produced by mkoctfile should be b.oct. This is indeed the case for the "fine" target. However, for the "fail" target, file a.oct is built.

Rafael Laboissière <rlaboiss>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #55072:  Makefile added by rlaboiss (293B - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by rlaboiss (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-08-28 mmuetzel StatusNeed Info Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 8.4.0
    2023-08-26 mmuetzel StatusNone Need Info
    2023-08-26 mmuetzel Operating SystemGNU/Linux Any
        Planned ReleaseNone 8.4.0
    2023-08-24 rlaboiss Attached File- Added Makefile, #55072

    Back to the top

    Powered by Savane 3.13-7b9d.
    Corresponding source code