bugGNU Octave - Bugs: bug #51767, Convenience function ovl() may be...

 
 

bug #51767: Convenience function ovl() may be causing compilation error

Submitter:  Dan Sebald <sebald>
Submitted:  Wed 16 Aug 2017 07:06:41 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  mtmiller
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 17 Aug 2017 05:03:53 PM UTC, comment #9: 

Buildbots are happy and sschoeps reported it fixed the build on macOS, closing as fixed.

Mike Miller <mtmiller>
Group Member
Wed 16 Aug 2017 11:16:45 PM UTC, comment #8: 

Ok, I went ahead and pushed this on the default branch, I'll check with the buildbots in a while

https://hg.savannah.gnu.org/hgweb/octave/rev/0519eaf0cca6

Mike Miller <mtmiller>
Group Member
Wed 16 Aug 2017 10:53:13 PM UTC, comment #7: 

I can  clang 4.0.1 compile with (file #41548) patch
(on linux).

Dmitri

Dmitri A. Sergatskov <dasergatskov>
Wed 16 Aug 2017 09:47:07 PM UTC, comment #6: 

I managed to break out of the compile by killing 7 or 8 stalled octave processes:


/bin/bash: line 1: 15816 Killed                  /bin/bash run-octave --norc --silent --no-history --path /home/sebald/octave/octave/octave/doc/interpreter/ --eval "geometryimages ('doc/interpreter/', 'voronoi', 'txt');"
/bin/bash: line 1: 15818 Killed                  /bin/bash run-octave --norc --silent --no-history --path /home/sebald/octave/octave/octave/doc/interpreter/ --eval "geometryimages ('doc/interpreter/', 'triplot', 'txt');"
/bin/bash: line 1: 15819 Killed                  /bin/bash run-octave --norc --silent --no-history --path /home/sebald/octave/octave/octave/doc/interpreter/ --eval "geometryimages ('doc/interpreter/', 'griddata', 'txt');"
/bin/bash: line 1: 15821 Killed                  /bin/bash run-octave --norc --silent --no-history --path /home/sebald/octave/octave/octave/doc/interpreter/ --eval "geometryimages ('doc/interpreter/', 'convhull', 'txt');"
/bin/bash: line 1: 15822 Killed                  /bin/bash run-octave --norc --silent --no-history --path /home/sebald/octave/octave/octave/doc/interpreter/ --eval "geometryimages ('doc/interpreter/', 'delaunay', 'txt');"
/bin/bash: line 1: 15823 Killed                  /bin/bash run-octave --norc --silent --no-history --path /home/sebald/octave/octave/octave/doc/interpreter/ --eval "interpimages ('doc/interpreter/', 'interpft', 'txt');"
/bin/bash: line 1: 15824 Killed                  /bin/bash run-octave --norc --silent --no-history --path /home/sebald/octave/octave/octave/doc/interpreter/ --eval "interpimages ('doc/interpreter/', 'interpn', 'txt');"


Then ran 'make' again with no "-j8"

  GEN      libinterp/builtin-defun-decls.h
  GEN      doc/interpreter/voronoi.txt
  GEN      doc/interpreter/triplot.txt
  GEN      doc/interpreter/griddata.txt
  GEN      doc/interpreter/convhull.txt
  GEN      doc/interpreter/delaunay.txt
  GEN      doc/interpreter/interpft.txt
  GEN      doc/interpreter/interpn.txt
  MAKEINFO /home/sebald/octave/octave/octave/doc/interpreter/octave.info

and the documentation completed and program runs.  I'm guessing that

  TEXI2PDF doc/interpreter/octave.pdf

jumped ahead of the octave processes completing that final batch of doc generations causing some complication with "make".  Not sure this is an Octave issue.

Dan Sebald <sebald>
Wed 16 Aug 2017 09:40:16 PM UTC, comment #5: 

Thanks, updated patch attached. Waiting for some affirmative feedback from macOS users also.

(file #41548)

Mike Miller <mtmiller>
Group Member
Wed 16 Aug 2017 09:35:46 PM UTC, comment #4: 

The patch compiles past the file-io.cc errors.  However, there is another:


  CXX      libgui/graphics/libgui_graphics_libgui_graphics_la-Canvas.lo
In file included from /home/sebald/octave/octave/octave/libinterp/octave-value/ov-fcn.h:33:0,
                 from /home/sebald/octave/octave/octave/libinterp/octave-value/ov-builtin.h:32,
                 from /home/sebald/octave/octave/octave/libinterp/corefcn/defun-int.h:30,
                 from /home/sebald/octave/octave/octave/libinterp/corefcn/defun-dld.h:32,
                 from /home/sebald/octave/octave/octave/libinterp/dldfcn/dmperm.cc:33:
/home/sebald/octave/octave/octave/libinterp/octave-value/ovl.h: In instantiation of 'octave_value_list ovl(const OV_Args& ...) [with OV_Args = {octave_value_list}]':
/home/sebald/octave/octave/octave/libinterp/dldfcn/dmperm.cc:146:56:   required from here
/home/sebald/octave/octave/octave/libinterp/octave-value/ovl.h:192:76: error: converting to 'octave_value' from initializer list would use explicit constructor 'octave_value::octave_value(const octave_value_list&)'
   return octave_value_list (std::initializer_list<octave_value> ({args...}));
                                                                            ^
make[2]: *** [libinterp/dldfcn/libinterp_dldfcn_dmperm_la-dmperm.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/usr/local/src/octave/octave/build5'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/octave/octave/build5'
make: *** [all] Error 2


I did the same thing as in the attached patch with the dmperm.cc file, i.e.,


diff --git a/libinterp/corefcn/file-io.cc b/libinterp/corefcn/file-io.cc
--- a/libinterp/corefcn/file-io.cc
+++ b/libinterp/corefcn/file-io.cc
@@ -1000,7 +1000,7 @@ scanf_internal (octave::interpreter& int

   if (nargin == 3 && args(2).is_string ())
     {
-      retval = ovl (os.oscanf (args(1), who));
+      retval = os.oscanf (args(1), who);
     }
   else
     {
@@ -1123,7 +1123,7 @@ character to be read is returned in @var

   if (nargin == 3 && args(2).is_string ())
     {
-      retval = ovl (os.oscanf (args(1), who));
+      retval = os.oscanf (args(1), who);
     }
   else
     {
diff --git a/libinterp/dldfcn/dmperm.cc b/libinterp/dldfcn/dmperm.cc
--- a/libinterp/dldfcn/dmperm.cc
+++ b/libinterp/dldfcn/dmperm.cc
@@ -143,7 +143,7 @@ ACM Trans. Math. Software, 16(4):303-324
   if (args.length () != 1)
     print_usage ();

-  return ovl (dmperm_internal (false, args(0), nargout));
+  return dmperm_internal (false, args(0), nargout);

 #else

@@ -191,7 +191,7 @@ such the numerical rank of the matrix @v
   if (args.length () != 1)
     print_usage ();

-  return ovl (dmperm_internal (true, args(0), nargout));
+  return dmperm_internal (true, args(0), nargout);

 #else


and compilation makes it all the way through...wuup, not quite--looks like it is stuck on


  GEN      doc/interpreter/octave.html/octave.css
  TEXI2PDF doc/interpreter/octave.pdf


of all things, no CPU being used or anything.

Anyway, I didn't look to closely what the return value means in the particular cases and will leave that up to you.

Dan Sebald <sebald>
Wed 16 Aug 2017 09:09:10 PM UTC, comment #3: 

I think it is gcc.  I will confirm in just a bit, as more info comes out after I started a compilation again (I had to remove -j8 because of a complaint about dependence on an unfinished process, so it is much slower).

I managed to make the compilation continue with


diff --git a/libinterp/corefcn/file-io.cc b/libinterp/corefcn/file-io.cc
--- a/libinterp/corefcn/file-io.cc
+++ b/libinterp/corefcn/file-io.cc
@@ -1000,7 +1000,7 @@ scanf_internal (octave::interpreter& int

   if (nargin == 3 && args(2).is_string ())
     {
-      retval = ovl (os.oscanf (args(1), who));
+//      retval = ovl (os.oscanf (args(1), who));
     }
   else
     {
@@ -1123,7 +1123,7 @@ character to be read is returned in @var

   if (nargin == 3 && args(2).is_string ())
     {
-      retval = ovl (os.oscanf (args(1), who));
+//      retval = ovl (os.oscanf (args(1), who));
     }
   else
     {


So, it is that particular format, whereas all other uses of ovl seems fine.  os is a stream operating on the "who" file, but I don't know what oscanf() is returning.

Dan Sebald <sebald>
Wed 16 Aug 2017 09:02:29 PM UTC, comment #2: 

Try the attached patch.

(file #41547)

Mike Miller <mtmiller>
Group Member
Wed 16 Aug 2017 08:53:50 PM UTC, comment #1: 

What version of gcc or other compiler are you building with?

This was an intentional change, and some instances of constructing an octave_value_list were probably missed, with different versions of gcc and clang having problems resolving overloads with certain combinations of arguments.

Does simply dropping the "ovl" from file-io.cc line 1003 fix this for you? Any other errors?

Mike Miller <mtmiller>
Group Member
Wed 16 Aug 2017 07:06:41 PM UTC, original submission:  

I'm seeing a compilation error (using configure --without-osmesa --no-recursion):


  CXX      libinterp/corefcn/libinterp_corefcn_libcorefcn_la-fft.lo
  CXX      libinterp/corefcn/libinterp_corefcn_libcorefcn_la-fft2.lo
  CXX      libinterp/corefcn/libinterp_corefcn_libcorefcn_la-fftn.lo
  CXX      libinterp/corefcn/libinterp_corefcn_libcorefcn_la-file-io.lo
  CXX      libinterp/corefcn/libinterp_corefcn_libcorefcn_la-filter.lo
In file included from libinterp/builtin-defun-decls.h:8:0,
                 from /home/sebald/octave/octave/octave/libinterp/corefcn/file-io.cc:63:
/home/sebald/octave/octave/octave/libinterp/octave-value/ovl.h: In instantiation of 'octave_value_list ovl(const OV_Args& ...) [with OV_Args = {octave_value_list}]':
/home/sebald/octave/octave/octave/libinterp/corefcn/file-io.cc:1003:45:   required from here
/home/sebald/octave/octave/octave/libinterp/octave-value/ovl.h:192:76: error: converting to 'octave_value' from initializer list would use explicit constructor 'octave_value::octave_value(const octave_value_list&)'
   return octave_value_list (std::initializer_list<octave_value> ({args...}));
                                                                            ^
  CXX      libinterp/corefcn/libinterp_corefcn_libcorefcn_la-find.lo
make[2]: *** [libinterp/corefcn/libinterp_corefcn_libcorefcn_la-file-io.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/usr/local/src/octave/octave/build5'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/octave/octave/build5'
make: *** [all] Error 2


This probably has to do with the recent template expansions and appears to have something to do with this convenience function:


//! Construct an octave_value_list with less typing.
/*!
  Historically, this made it easier to create an octave_value_list
  from multiple octave_value arguments.  It is no longer useful since
  octave_value_list has now a constructor accepting an initializer_list
  so all it does is save some typing.  The following are equivalent:

  @code{.cc}
  return octave_value_list ({ov0, ov1, ov2});
  return ovl (ov0, ov1, ov2);
  @endcode
*/
template<typename... OV_Args>
inline octave_value_list
ovl (const OV_Args&... args)
{
  return octave_value_list (std::initializer_list<octave_value> ({args...}));
}


Dan Sebald <sebald>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #41548:  ovl.patch added by mtmiller (2KiB - text/x-patch)
file #41547:  ovl.patch added by mtmiller (1007B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by sebald (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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-08-17 mtmiller StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2017-08-16 mtmiller Assigned toNone mtmiller
    2017-08-16 mtmiller StatusPatch Submitted Ready For Test
    2017-08-16 mtmiller Attached File- Added ovl.patch, #41548
        StatusNeed Info Patch Submitted
    2017-08-16 mtmiller Attached File- Added ovl.patch, #41547
    2017-08-16 mtmiller StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code