bugGNU Octave - Bugs: bug #46330, Fortran exception with matrices...

 
 

bug #46330: Fortran exception with matrices containing Inf & NaN

Submitted by:  Lukas Reichlin <paramaniac>
Submitted on:  Fri 30 Oct 2015 04:30:53 AM UTC  
 
Category:  Libraries Severity:  4 - Important
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  Kai Torben Ohlhus <siko1056>
Originator Name:  Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Wed 16 Nov 2016 08:14:30 PM UTC, comment #38: 

Thanks. Closed as fixed.

Avinoam Kalma <avinoam>
Project Member
Wed 16 Nov 2016 07:52:34 PM UTC, comment #37: 

Yes. Odds are that if someone is still affected, we will get a new bug report anyway, and this is always searchable.

Mike Miller <mtmiller>
Project Administrator
Wed 16 Nov 2016 07:42:44 PM UTC, comment #36: 

This bug seems to be solved by the solution of bug #39000.
Can I close this report?

Avinoam Kalma <avinoam>
Project Member
Thu 15 Sep 2016 05:40:55 PM UTC, comment #35: 

sorry, comment 18.

Avinoam Kalma <avinoam>
Project Member
Thu 15 Sep 2016 05:40:22 PM UTC, comment #34: 

Maybe comment 19 in bug #39000 is relevant here.

Avinoam Kalma <avinoam>
Project Member
Fri 29 Jul 2016 03:29:35 PM UTC, comment #33: 

For the examples

[Inf 1; 1 1] \ [4; 3] % Matlab [0; 3]
[nan 1; 1 1] \ [4; 3] % Matlab [nan; nan]

I'm still seeing this:

octave:1> [Inf 1; 1 1] \ [4;3]
warning: matrix singular to machine precision
warning: matrix singular to machine precision
** On entry to DLASCL parameter number  4 had an illegal value
error: exception encountered in Fortran subroutine dgelsd_
octave:1> [nan 1; 1 1] \ [4;3]
warning: matrix singular to machine precision, rcond = nan
** On entry to DLASCL parameter number  4 had an illegal value
error: exception encountered in Fortran subroutine dgelsd_

In comment #29 Mike said that the patch should avoid calls to XERBLA, but that doesn't seem to be the case.

I'm using HG ID  8971508e21c8.

John W. Eaton <jwe>
Project Administrator
Fri 15 Jul 2016 10:13:44 PM UTC, comment #32: 

I assume the newest patch from Kai works--it does for me.  Closing report.

Rik <rik5>
Project Administrator
Mon 11 Jul 2016 03:02:15 PM UTC, comment #31: 

Marking as Ready for Test.

Rik <rik5>
Project Administrator
Mon 11 Jul 2016 07:32:26 AM UTC, comment #30: 

I gave it another try: http://hg.savannah.gnu.org/hgweb/octave/rev/bf5fbf347aaf

@Avinoam: as said in comment #20 and comment #29, I was not aware of bug #39000. Therefore my "debugging" attempt of file #37755 is worthless and I already deleted this file. I hope you'll find my regression test "untested" for Windows. Please report any further errors.

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Sat 09 Jul 2016 11:00:09 PM UTC, comment #29: 

The crash on Windows is definitely bug #39000.

Any time you get a crash on Windows with the error message "On entry to ... had an illegal value", this is the BLAS library calling exit().

The proposed patch (file #37772) will bypass this test, so that should avoid the error on Windows, this looks good to me, untested.

Mike Miller <mtmiller>
Project Administrator
Sat 09 Jul 2016 01:23:22 PM UTC, comment #28: 

Kai, Comment #19:

I get, using your patch (file #37755)

octave:1> test bug-46330.tst
fsolve full matrix case.
fsolve full matrix case anorm = nan
fsolve finish.
** On entry to DLASCL parameter number  4 had an illegal value

and than Octave crashes.

Avinoam Kalma <avinoam>
Project Member
Fri 08 Jul 2016 03:33:20 PM UTC, comment #27: 

My state so far is in file #37772 . I won't change anything further and push that cset, if I hear no complaints, on Monday.

@Lachlan: Yes, I copied Rik's patch for bug #45577 as well.

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Fri 08 Jul 2016 02:44:07 PM UTC, comment #26: 

Thanks, Kai.  I assume that you also copied Rik's patch for bug #45577 as well, then.

It would be nice for those examples to give answers, but I don't think that should block 4.2.0, whereas the crashes do.  How about applying your current patch and fixing the errors reported by Fortran separately?

Lachlan Andrew <lachlan>
Fri 08 Jul 2016 02:08:09 PM UTC, comment #25: 

Kai: Earlier in the year I started trying to reduce that duplication but got sidetracked by other issues that needed to be fixed first.  Still planning to work on it some more though.  No matter what, there will have to be some duplication because we have to specialize templates to call the underlying LAPACK and BLAS functions.

John W. Eaton <jwe>
Project Administrator
Fri 08 Jul 2016 01:55:31 PM UTC, comment #24: 

@Lachlan: I did actually diffed CMatrix.cc and fCMatrix.cc (evil code duplication) and applied your patch symmetrically.  I will upload it later, as I still get hard errors for other cases like

[Inf 1; 1 1] \ [4; 3] % Matlab [0; 3]
[nan 1; 1 1] \ [4; 3] % Matlab [nan; nan]

where Matlab does not give up, but displays a warning.  This behavior I would like to make consistent.

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Fri 08 Jul 2016 01:12:03 PM UTC, comment #23: 

OK, I'll write a patch for fCMatrix.cc.  That hasn't yet been patched for bug #45577 either.  Should I write a single patch for both (the affected lines are virtually the same) keep them separate?

Lachlan Andrew <lachlan>
Thu 07 Jul 2016 10:10:50 PM UTC, comment #22: 

Thanks, and sorry, I realized later this was a collaboration of yours and Lachlan's along with your followup test case.

Sounds good, please investigate the single precision case.

I think it should be possible to add the test case back in, with a comment and a check for ispc() to simply avoid passing bad values into LAPACK on Windows systems where we know about this limitation.

In fact since you are using %!warning, maybe something like this excerpt, based on your commit?

%! ## This statement caused an error in LAPACK and eventually caused
%! ## a segmentation fault.
%! ## Triggers "warning: matrix singular to machine precision"
%! ## FIXME: LAPACK errors become fatal crashes on Windows, don't test this
%! if (ispc ())
%!   warning ("unable to test for bug #46330 on Windows");
%! else
%!   assert (c / (i * Inf * eye (4) - a) * b, zeros (2, 2))

Mike Miller <mtmiller>
Project Administrator
Thu 07 Jul 2016 10:00:19 PM UTC, comment #21: 

If bug #39000 was the cause of trouble for the segfault, then I have no cure for it. My current idea was to narrow the guilty lines of code, but if XERBLA causes a segfault with Windows in any case, than a simple check for info will never help. I wasn't aware of it. Here I think fixing bug #39000 was much easier, than checking all preconditions before calling any LAPACK routine. Marking bug #39000 as dependency, and tag this one as WON'T FIX in the wiki.

The fact is, for Linux systems Lachlans patch avoids (from a user perspective) strange error messages about illegal parameters from interally called LAPACK routines.

Your first point should be considered for sure. I will check this example for single values soon.

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Thu 07 Jul 2016 02:38:34 PM UTC, comment #20: 

Kai, a couple questions.

  • Should the fix for this bug also include a case for FloatComplexMatrix? You only patched ComplexMatrix. Any test cases should also test both double and single values.
  • Since this involves LAPACK functions, does your test case involve calling a LAPACK function and having Octave handle the error? If so, then this may crash on Windows simply because of bug #39000, unable to override XERBLA function on Windows.
Mike Miller <mtmiller>
Project Administrator
Thu 07 Jul 2016 01:43:33 PM UTC, comment #19: 

@avinoam: I backed out my Cset. Can you apply the patch (file #37755), run something like

./run-octave --eval "test /workspace/kai/octave/repo/test/bug-46330.tst" --persist --no-gui

And just post the console output? For me it looks like:

fsolve full matrix case.
fsolve full matrix case anorm = inf
fsolve last anorm.
fsolve finish.
PASSES 1 out of 1 test

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Thu 07 Jul 2016 01:00:39 PM UTC, comment #18: 

Reopen this bug, see bug #48431

Avinoam Kalma <avinoam>
Project Member
Wed 06 Jul 2016 12:57:59 PM UTC, comment #17: 
Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Wed 06 Jul 2016 07:15:52 AM UTC, comment #16: 

Thanks for the reminder to add the regression test, and for adding it.  Yes, please apply the patch.

Lachlan Andrew <lachlan>
Tue 05 Jul 2016 02:30:04 PM UTC, comment #15: 

@Lachlan: I created a successor of your patch.  If you agree on creating this extra regression test case, I will submit it.

The test script segfaulted my Octave 4.0.2 and after applying this patch, no new errors are introduced, and I only get a gentle warning.

(file #37718)

Kai Torben Ohlhus <siko1056>
Project MemberIn charge of this item.
Sun 26 Jun 2016 11:42:53 PM UTC, comment #14: 

I think this patch (or its successor) should be applied before 4.2 is released.

Perhaps it could issue a warning when inv() is returning a zero due to infinite anorm if no-one cane confirm that that is always valid.

Lachlan Andrew <lachlan>
Mon 02 Nov 2015 07:48:12 PM UTC, comment #13: 

@Lucas: so Mac OSX is more vulnerable than Linux and Windows, good to know.

@Lachlan:
In my Fortran times (20-30+ years back) the FORTRAN math libs didn't quite bother catching NaNs, Infs, uninitialized memory bit patterns and possibly a couple of other non-numbers (I suppose one reason Fortran could be so fast); and happily produced just garbage instead. Of course there were some limits but esp. for the "OPT=3" cases they were lax.
Maybe Fortran has "improved" since those days of CDC Cyber mainframes but I actually doubt it.
So, testing for +/- Inf besides NaN sounds like a valuable addition :-)

Philip Nienhuis <philipnienhuis>
Project Member
Sun 01 Nov 2015 10:06:11 AM UTC, comment #12: 

Philip, I'm using Netlib's reference BLAS and LAPACK.

octave:1> octave_config_info
ans =

  scalar structure containing the fields:

    dld =  1
    float_format = ieee-le
    words_big_endian = 0
    words_little_endian =  1
    features =

      scalar structure containing the fields:

        ACOSH =  1
        ACOSHF =  1
        ALLOCA =  1
        ALLOCA_H =  1
        AMD =  1
        AMD_AMD_H = 0
        AMD_H = 0
        ARPACK =  1
        ASINH =  1
        ASINHF =  1
        ATANH =  1
        ATANHF =  1
        BLAS = 0
        BP_SYM_H = 0
        BTOWC =  1
        BUG_BIG_NANOSLEEP =  1
        CAMD =  1
        CAMD_CAMD_H = 0
        CAMD_H = 0
        CANONICALIZE_FILE_NAME = 0
        CARBON_CGDISPLAYBITSPERPIXEL = 0
        CBRT =  1
        CBRTF =  1
        CCOLAMD =  1
        CCOLAMD_CCOLAMD_H = 0
        CCOLAMD_H = 0
        CHMOD =  1
        CHOLMOD =  1
        CHOLMOD_CHOLMOD_H = 0
        CHOLMOD_H = 0
        CHOWN =  1
        CLOSEDIR =  1
        CMATH_ISFINITE =  1
        CMATH_ISFINITEF =  1
        CMATH_ISINF =  1
        CMATH_ISINFF =  1
        CMATH_ISNAN =  1
        CMATH_ISNANF =  1
        COLAMD =  1
        COLAMD_COLAMD_H = 0
        COLAMD_H = 0
        CONIO_H = 0
        COPYSIGNF_IN_LIBC = 0
        COPYSIGNL_IN_LIBC = 0
        COPYSIGN_IN_LIBC = 0
        CS_H = 0
        CTERMID =  1
        CURL =  1
        CURL_CURL_H =  1
        CURSES_H =  1
        CXSPARSE =  1
        CXSPARSE_CS_H = 0
        CXX_BITWISE_OP_TEMPLATES =  1
        CXX_COMPLEX_REFERENCE_ACCESSORS = 0
        CXX_COMPLEX_SETTERS =  1
        DECL_ALARM =  1
        DECL_CEILF = 0
        DECL_COPYSIGN = 0
        DECL_COPYSIGNF = 0
        DECL_COPYSIGNL = 0
        DECL_DIRFD =  1
        DECL_EXP2 =  1
        DECL_FCHDIR =  1
        DECL_FDOPENDIR =  1
        DECL_FLOORF =  1
        DECL_FPURGE =  1
        DECL_FSEEKO =  1
        DECL_FTELLO =  1
        DECL_GETCWD =  1
        DECL_GETC_UNLOCKED =  1
        DECL_GETENV =  1
        DECL_GETLOGIN =  1
        DECL_GETLOGIN_R =  1
        DECL_ISBLANK =  1
        DECL_LOCALTIME_R =  1
        DECL_MBRTOWC = 0
        DECL_MBSINIT = 0
        DECL_MBSRTOWCS = 0
        DECL_MEMRCHR =  1
        DECL_PROGRAM_INVOCATION_NAME =  1
        DECL_PROGRAM_INVOCATION_SHORT_NAME =  1
        DECL_ROUND =  1
        DECL_ROUNDF =  1
        DECL_SIGNBIT =  1
        DECL_SLEEP =  1
        DECL_STRDUP =  1
        DECL_STRERROR_R =  1
        DECL_STRMODE =  1
        DECL_STRNCASECMP =  1
        DECL_STRNDUP =  1
        DECL_STRNLEN =  1
        DECL_SYS_SIGLIST =  1
        DECL_TGAMMA =  1
        DECL_TOWLOWER = 0
        DECL_TRUNC =  1
        DECL_TRUNCF =  1
        DECL_TZNAME = 0
        DECL__PUTENV =  1
        DECL__SNPRINTF =  1
        DEV_T =  1
        DIRECT_H = 0
        DIRENT_H =  1
        DIRFD =  1
        DLFCN_H =  1
        DLOPEN_API =  1
        DUP2 =  1
        DYLD_API = 0
        DYNAMIC_AUTO_ARRAYS =  1
        ENDGRENT =  1
        ENDPWENT =  1
        ENVIRON_DECL = 0
        ERF =  1
        ERFC =  1
        ERFCF =  1
        ERFF =  1
        EXECVP =  1
        EXP2 =  1
        EXP2F =  1
        EXPM1 =  1
        EXPM1F =  1
        FAST_INT_OPS =  1
        FCHDIR =  1
        FCNTL =  1
        FDOPENDIR =  1
        FEATURES_H = 0
        FFTW =  1
        FFTW3 =  1
        FFTW3F =  1
        FFTW3F_THREADS =  1
        FFTW3_H =  1
        FFTW3_THREADS =  1
        FINITE =  1
        FLOATINGPOINT_H = 0
        FLOORF_AND_CEILF = 0
        FLTK =  1
        FNMATCH_H =  1
        FONTCONFIG =  1
        FORK =  1
        FPURGE =  1
        FPU_CONTROL_H = 0
        FRAMEWORK_CARBON =  1
        FRAMEWORK_OPENGL =  1
        FREETYPE =  1
        FREXP =  1
        FSEEKO =  1
        FSTATAT =  1
        FTRUNCATE =  1
        FT_REFERENCE_FACE =  1
        GETCWD =  1
        GETDTABLESIZE =  1
        GETEGID =  1
        GETEUID =  1
        GETGID =  1
        GETGRENT =  1
        GETGRGID =  1
        GETGRNAM =  1
        GETHOSTNAME =  1
        GETLOGIN_R =  1
        GETOPT_H =  1
        GETOPT_LONG_ONLY =  1
        GETPAGESIZE =  1
        GETPGRP =  1
        GETPID =  1
        GETPPID =  1
        GETPWENT =  1
        GETPWNAM =  1
        GETPWNAM_R =  1
        GETPWUID =  1
        GETRUSAGE =  1
        GETTIMEOFDAY =  1
        GETUID =  1
        GL2PS_H =  1
        GLOB_H =  1
        GLPK =  1
        GLPK_GLPK_H = 0
        GLPK_H =  1
        GLUTESSCALLBACK_THREEDOTS = 0
        GL_GLU_H = 0
        GL_GL_H = 0
        GRP_H =  1
        HDF5 =  1
        HDF5_18 =  1
        HDF5_H =  1
        HYPOTF =  1
        IEEE754_DATA_FORMAT =  1
        IEEEFP_H = 0
        INO_T =  1
        INTMAX_T =  1
        INTTYPES_H =  1
        INTTYPES_H_WITH_UINTMAX =  1
        ISASCII =  1
        ISBLANK =  1
        ISINF =  1
        ISNAN =  1
        ISNAND_IN_LIBC =  1
        ISNANF_IN_LIBC = 0
        ISNANL_IN_LIBC = 0
        ISSETUGID =  1
        ISWCNTRL =  1
        ISWCTYPE =  1
        JAVA =  1
        KILL =  1
        LANGINFO_CODESET =  1
        LAPACK = 0
        LGAMMA =  1
        LGAMMAF =  1
        LGAMMAF_R =  1
        LGAMMA_R =  1
        LIBDIRENT = 0
        LIBM =  1
        LIBQHULL_H = 0
        LIBQHULL_LIBQHULL_H =  1
        LIBSUN = 0
        LIBUTIL_H = 0
        LINK =  1
        LLVM = 0
        LLVM_DATALAYOUT_H = 0
        LLVM_FUNCTION_H = 0
        LLVM_IRBUILDER_H = 0
        LLVM_IR_DATALAYOUT_H = 0
        LLVM_IR_FUNCTION_H = 0
        LLVM_IR_IRBUILDER_H = 0
        LLVM_SUPPORT_IRBUILDER_H = 0
        LLVM_TARGET_TARGETDATA_H = 0
        LOADLIBRARY_API = 0
        LOCALE_H =  1
        LOCALTIME_R =  1
        LOG1P =  1
        LOG1PF =  1
        LOG2 =  1
        LOG2F =  1
        LOGF =  1
        LONG_FILE_NAMES =  1
        LONG_LONG_INT =  1
        LSTAT =  1
        MAGICK =  1
        MALLOC_GNU =  1
        MALLOC_POSIX =  1
        MAP_ANONYMOUS =  1
        MATH_DEFINES =  1
        MATH_H =  1
        MBRTOWC =  1
        MBSINIT =  1
        MBSRTOWCS =  1
        MBSTATE_T =  1
        MEMORY_H =  1
        MEMPCPY = 0
        MEMRCHR = 0
        MINIMALLY_WORKING_GETCWD =  1
        MKFIFO =  1
        MKOSTEMP = 0
        MMAP =  1
        MODF =  1
        MPROTECT =  1
        MSVC_INVALID_PARAMETER_HANDLER = 0
        MUNMAP =  1
        NCURSES_H =  1
        NDIR_H = 0
        NETDB_H =  1
        OPENAT =  1
        OPENDIR =  1
        OPENGL =  1
        OPENGL_GLU_H = 0
        OPENGL_GL_H = 0
        OPENMP = 0
        OPENPTY =  1
        PARTLY_WORKING_GETCWD =  1
        PATHCONF =  1
        PCRE_COMPILE =  1
        PCRE_H =  1
        PCRE_PCRE_H = 0
        PIPE =  1
        PLACEMENT_DELETE =  1
        POLL_H =  1
        POW =  1
        PSTAT_GETDYNAMIC = 0
        PTHREAD =  1
        PTHREAD_H =  1
        PTHREAD_PRIO_INHERIT =  1
        PTRDIFF_T =  1
        PTY_H = 0
        PWD_H =  1
        QABSTRACTITEMMODEL_BEGINRESETMODEL =  1
        QFONT_FORCE_INTEGER_METRICS =  1
        QFONT_MONOSPACE =  1
        QHULL =  1
        QHULL_H = 0
        QHULL_LIBQHULL_H = 0
        QHULL_QHULL_H = 0
        QRUPDATE =  1
        QRUPDATE_LUU =  1
        QSCINTILLA =  1
        QSCI_QSCILEXERMATLAB_H =  1
        QSCI_QSCILEXEROCTAVE_H =  1
        QSCI_VERSION_2_6_0 =  1
        QT =  1
        RAISE =  1
        RAW_DECL_ACCEPT =  1
        RAW_DECL_ACCEPT4 = 0
        RAW_DECL_ACOSF =  1
        RAW_DECL_ACOSL =  1
        RAW_DECL_ALPHASORT =  1
        RAW_DECL_ASINF =  1
        RAW_DECL_ASINL =  1
        RAW_DECL_ATANF =  1
        RAW_DECL_ATANL =  1
        RAW_DECL_ATOLL =  1
        RAW_DECL_BIND =  1
        RAW_DECL_BTOWC =  1
        RAW_DECL_CANONICALIZE_FILE_NAME = 0
        RAW_DECL_CBRT =  1
        RAW_DECL_CBRTF =  1
        RAW_DECL_CBRTL =  1
        RAW_DECL_CEILF =  1
        RAW_DECL_CEILL =  1
        RAW_DECL_CHDIR =  1
        RAW_DECL_CHOWN =  1
        RAW_DECL_CLOSEDIR =  1
        RAW_DECL_CONNECT =  1
        RAW_DECL_COPYSIGN =  1
        RAW_DECL_COPYSIGNF =  1
        RAW_DECL_COPYSIGNL =  1
        RAW_DECL_COSF =  1
        RAW_DECL_COSHF =  1
        RAW_DECL_COSL =  1
        RAW_DECL_DIRFD =  1
        RAW_DECL_DPRINTF =  1
        RAW_DECL_DUP =  1
        RAW_DECL_DUP2 =  1
        RAW_DECL_DUP3 = 0
        RAW_DECL_ENDUSERSHELL =  1
        RAW_DECL_ENVIRON = 0
        RAW_DECL_EUIDACCESS = 0
        RAW_DECL_EXP2 =  1
        RAW_DECL_EXP2F =  1
        RAW_DECL_EXP2L =  1
        RAW_DECL_EXPF =  1
        RAW_DECL_EXPL =  1
        RAW_DECL_EXPM1 =  1
        RAW_DECL_EXPM1F =  1
        RAW_DECL_EXPM1L =  1
        RAW_DECL_FABSF =  1
        RAW_DECL_FABSL =  1
        RAW_DECL_FACCESSAT =  1
        RAW_DECL_FCHDIR =  1
        RAW_DECL_FCHMODAT =  1
        RAW_DECL_FCHOWNAT =  1
        RAW_DECL_FCNTL =  1
        RAW_DECL_FDATASYNC = 0
        RAW_DECL_FDOPENDIR =  1
        RAW_DECL_FFS =  1
        RAW_DECL_FFSL =  1
        RAW_DECL_FFSLL =  1
        RAW_DECL_FLOORF =  1
        RAW_DECL_FLOORL =  1
        RAW_DECL_FMA =  1
        RAW_DECL_FMAF =  1
        RAW_DECL_FMAL =  1
        RAW_DECL_FMOD =  1
        RAW_DECL_FMODF =  1
        RAW_DECL_FMODL =  1
        RAW_DECL_FPURGE =  1
        RAW_DECL_FREXPF =  1
        RAW_DECL_FREXPL =  1
        RAW_DECL_FSEEKO =  1
        RAW_DECL_FSTAT =  1
        RAW_DECL_FSTATAT =  1
        RAW_DECL_FSYNC =  1
        RAW_DECL_FTELLO =  1
        RAW_DECL_FTRUNCATE =  1
        RAW_DECL_FUTIMENS = 0
        RAW_DECL_GETCWD =  1
        RAW_DECL_GETDELIM =  1
        RAW_DECL_GETDOMAINNAME =  1
        RAW_DECL_GETDTABLESIZE =  1
        RAW_DECL_GETGROUPS =  1
        RAW_DECL_GETHOSTNAME =  1
        RAW_DECL_GETLINE =  1
        RAW_DECL_GETLOADAVG =  1
        RAW_DECL_GETLOGIN =  1
        RAW_DECL_GETLOGIN_R =  1
        RAW_DECL_GETPAGESIZE =  1
        RAW_DECL_GETPEERNAME =  1
        RAW_DECL_GETS =  1
        RAW_DECL_GETSOCKNAME =  1
        RAW_DECL_GETSOCKOPT =  1
        RAW_DECL_GETSUBOPT =  1
        RAW_DECL_GETTIMEOFDAY =  1
        RAW_DECL_GETUSERSHELL =  1
        RAW_DECL_GRANTPT =  1
        RAW_DECL_GROUP_MEMBER = 0
        RAW_DECL_HYPOTF =  1
        RAW_DECL_HYPOTL =  1
        RAW_DECL_ILOGB =  1
        RAW_DECL_ILOGBF =  1
        RAW_DECL_ILOGBL =  1
        RAW_DECL_INITSTATE =  1
        RAW_DECL_INITSTATE_R = 0
        RAW_DECL_ISATTY =  1
        RAW_DECL_ISWCTYPE =  1
        RAW_DECL_LCHMOD =  1
        RAW_DECL_LCHOWN =  1
        RAW_DECL_LDEXPF =  1
        RAW_DECL_LDEXPL =  1
        RAW_DECL_LINK =  1
        RAW_DECL_LINKAT =  1
        RAW_DECL_LISTEN =  1
        RAW_DECL_LOG =  1
        RAW_DECL_LOG10 =  1
        RAW_DECL_LOG10F =  1
        RAW_DECL_LOG10L =  1
        RAW_DECL_LOG1P =  1
        RAW_DECL_LOG1PF =  1
        RAW_DECL_LOG1PL =  1
        RAW_DECL_LOG2 =  1
        RAW_DECL_LOG2F =  1
        RAW_DECL_LOG2L =  1
        RAW_DECL_LOGB =  1
        RAW_DECL_LOGBF =  1
        RAW_DECL_LOGBL =  1
        RAW_DECL_LOGF =  1
        RAW_DECL_LOGL =  1
        RAW_DECL_LSEEK =  1
        RAW_DECL_LSTAT =  1
        RAW_DECL_MBRLEN =  1
        RAW_DECL_MBRTOWC =  1
        RAW_DECL_MBSINIT =  1
        RAW_DECL_MBSNRTOWCS =  1
        RAW_DECL_MBSRTOWCS =  1
        RAW_DECL_MEMMEM =  1
        RAW_DECL_MEMPCPY = 0
        RAW_DECL_MEMRCHR = 0
        RAW_DECL_MKDIRAT =  1
        RAW_DECL_MKDTEMP = 0
        RAW_DECL_MKFIFO =  1
        RAW_DECL_MKFIFOAT = 0
        RAW_DECL_MKNOD =  1
        RAW_DECL_MKNODAT = 0
        RAW_DECL_MKOSTEMP = 0
        RAW_DECL_MKOSTEMPS = 0
        RAW_DECL_MKSTEMP =  1
        RAW_DECL_MKSTEMPS = 0
        RAW_DECL_MODF =  1
        RAW_DECL_MODFF =  1
        RAW_DECL_MODFL =  1
        RAW_DECL_OPENAT =  1
        RAW_DECL_OPENDIR =  1
        RAW_DECL_PCLOSE =  1
        RAW_DECL_PIPE =  1
        RAW_DECL_PIPE2 = 0
        RAW_DECL_POPEN =  1
        RAW_DECL_POSIX_OPENPT =  1
        RAW_DECL_POWF =  1
        RAW_DECL_PREAD =  1
        RAW_DECL_PSELECT =  1
        RAW_DECL_PTHREAD_SIGMASK =  1
        RAW_DECL_PTSNAME =  1
        RAW_DECL_PTSNAME_R = 0
        RAW_DECL_PWRITE =  1
        RAW_DECL_RANDOM =  1
        RAW_DECL_RANDOM_R = 0
        RAW_DECL_RAWMEMCHR = 0
        RAW_DECL_READDIR =  1
        RAW_DECL_READLINK =  1
        RAW_DECL_READLINKAT =  1
        RAW_DECL_REALPATH =  1
        RAW_DECL_RECV =  1
        RAW_DECL_RECVFROM =  1
        RAW_DECL_REMAINDER =  1
        RAW_DECL_REMAINDERF =  1
        RAW_DECL_REMAINDERL =  1
        RAW_DECL_RENAMEAT =  1
        RAW_DECL_REWINDDIR =  1
        RAW_DECL_RINT =  1
        RAW_DECL_RINTF =  1
        RAW_DECL_RINTL =  1
        RAW_DECL_RMDIR =  1
        RAW_DECL_ROUND =  1
        RAW_DECL_ROUNDF =  1
        RAW_DECL_ROUNDL =  1
        RAW_DECL_RPMATCH = 0
        RAW_DECL_SCANDIR =  1
        RAW_DECL_SECURE_GETENV = 0
        RAW_DECL_SELECT =  1
        RAW_DECL_SEND =  1
        RAW_DECL_SENDTO =  1
        RAW_DECL_SETENV =  1
        RAW_DECL_SETHOSTNAME =  1
        RAW_DECL_SETSOCKOPT =  1
        RAW_DECL_SETSTATE =  1
        RAW_DECL_SETSTATE_R = 0
        RAW_DECL_SETUSERSHELL =  1
        RAW_DECL_SHUTDOWN =  1
        RAW_DECL_SIGACTION =  1
        RAW_DECL_SIGADDSET =  1
        RAW_DECL_SIGDELSET =  1
        RAW_DECL_SIGEMPTYSET =  1
        RAW_DECL_SIGFILLSET =  1
        RAW_DECL_SIGISMEMBER =  1
        RAW_DECL_SIGPENDING =  1
        RAW_DECL_SIGPROCMASK =  1
        RAW_DECL_SINF =  1
        RAW_DECL_SINHF =  1
        RAW_DECL_SINL =  1
        RAW_DECL_SLEEP =  1
        RAW_DECL_SNPRINTF =  1
        RAW_DECL_SOCKET =  1
        RAW_DECL_SQRTF =  1
        RAW_DECL_SQRTL =  1
        RAW_DECL_SRANDOM =  1
        RAW_DECL_SRANDOM_R = 0
        RAW_DECL_STAT =  1
        RAW_DECL_STPCPY =  1
        RAW_DECL_STPNCPY =  1
        RAW_DECL_STRCASECMP =  1
        RAW_DECL_STRCASESTR =  1
        RAW_DECL_STRCHRNUL = 0
        RAW_DECL_STRDUP =  1
        RAW_DECL_STRERROR_R =  1
        RAW_DECL_STRNCASECMP =  1
        RAW_DECL_STRNCAT =  1
        RAW_DECL_STRNDUP =  1
        RAW_DECL_STRNLEN =  1
        RAW_DECL_STRPBRK =  1
        RAW_DECL_STRSEP =  1
        RAW_DECL_STRSIGNAL =  1
        RAW_DECL_STRTOD =  1
        RAW_DECL_STRTOK_R =  1
        RAW_DECL_STRTOLL =  1
        RAW_DECL_STRTOULL =  1
        RAW_DECL_STRVERSCMP = 0
        RAW_DECL_SYMLINK =  1
        RAW_DECL_SYMLINKAT =  1
        RAW_DECL_TANF =  1
        RAW_DECL_TANHF =  1
        RAW_DECL_TANL =  1
        RAW_DECL_TIMES =  1
        RAW_DECL_TMPFILE =  1
        RAW_DECL_TOWCTRANS =  1
        RAW_DECL_TRUNC =  1
        RAW_DECL_TRUNCF =  1
        RAW_DECL_TRUNCL =  1
        RAW_DECL_TTYNAME_R =  1
        RAW_DECL_UNAME =  1
        RAW_DECL_UNLINK =  1
        RAW_DECL_UNLINKAT =  1
        RAW_DECL_UNLOCKPT =  1
        RAW_DECL_UNSETENV =  1
        RAW_DECL_USLEEP =  1
        RAW_DECL_UTIMENSAT = 0
        RAW_DECL_VDPRINTF =  1
        RAW_DECL_VSNPRINTF =  1
        RAW_DECL_WCPCPY =  1
        RAW_DECL_WCPNCPY =  1
        RAW_DECL_WCRTOMB =  1
        RAW_DECL_WCSCASECMP =  1
        RAW_DECL_WCSCAT =  1
        RAW_DECL_WCSCHR =  1
        RAW_DECL_WCSCMP =  1
        RAW_DECL_WCSCOLL =  1
        RAW_DECL_WCSCPY =  1
        RAW_DECL_WCSCSPN =  1
        RAW_DECL_WCSDUP =  1
        RAW_DECL_WCSLEN =  1
        RAW_DECL_WCSNCASECMP =  1
        RAW_DECL_WCSNCAT =  1
        RAW_DECL_WCSNCMP =  1
        RAW_DECL_WCSNCPY =  1
        RAW_DECL_WCSNLEN =  1
        RAW_DECL_WCSNRTOMBS =  1
        RAW_DECL_WCSPBRK =  1
        RAW_DECL_WCSRCHR =  1
        RAW_DECL_WCSRTOMBS =  1
        RAW_DECL_WCSSPN =  1
        RAW_DECL_WCSSTR =  1
        RAW_DECL_WCSTOK =  1
        RAW_DECL_WCSWIDTH =  1
        RAW_DECL_WCSXFRM =  1
        RAW_DECL_WCTOB =  1
        RAW_DECL_WCTRANS =  1
        RAW_DECL_WCTYPE =  1
        RAW_DECL_WCWIDTH =  1
        RAW_DECL_WMEMCHR =  1
        RAW_DECL_WMEMCMP =  1
        RAW_DECL_WMEMCPY =  1
        RAW_DECL_WMEMMOVE =  1
        RAW_DECL_WMEMSET =  1
        RAW_DECL__EXIT =  1
        READDIR =  1
        READLINK =  1
        REALLOC_GNU =  1
        REALLOC_POSIX =  1
        REALPATH =  1
        RESOLVEPATH = 0
        REWINDDIR =  1
        ROUND =  1
        ROUNDL =  1
        SAME_LONG_DOUBLE_AS_DOUBLE = 0
        SA_FAMILY_T =  1
        SCHED_GETAFFINITY = 0
        SCHED_GETAFFINITY_LIKE_GLIBC = 0
        SCHED_GETAFFINITY_NP = 0
        SECURE_GETENV = 0
        SELECT =  1
        SETDTABLESIZE = 0
        SETGRENT =  1
        SETLOCALE =  1
        SETPLACEHOLDERTEXT =  1
        SETPWENT =  1
        SETVBUF = 0
        SGTTY_H =  1
        SHL_LOAD_API = 0
        SHUTDOWN =  1
        SIGACTION =  1
        SIGALTSTACK =  1
        SIGINFO_T = 0
        SIGINTERRUPT =  1
        SIGLONGJMP =  1
        SIGNBIT = 0
        SIGNED_SIG_ATOMIC_T =  1
        SIGNED_WCHAR_T =  1
        SIGNED_WINT_T =  1
        SIGSET_T =  1
        SLEEP =  1
        SNPRINTF =  1
        SNPRINTF_RETVAL_C99 =  1
        SQRT =  1
        SQRTF =  1
        SSTREAM =  1
        STDINT_H =  1
        STDINT_H_WITH_UINTMAX =  1
        STDLIB_H =  1
        STRCASECMP =  1
        STRDUP =  1
        STRERROR_R =  1
        STRINGS_H =  1
        STRING_H =  1
        STRNCASECMP =  1
        STRNDUP =  1
        STRNLEN =  1
        STRPTIME =  1
        STRSIGNAL =  1
        STRUCT_DIRENT_D_TYPE =  1
        STRUCT_GROUP_GR_PASSWD = 0
        STRUCT_SIGACTION_SA_SIGACTION =  1
        STRUCT_SOCKADDR_STORAGE =  1
        STRUCT_SOCKADDR_STORAGE_SS_FAMILY =  1
        STRUCT_STAT_ST_BLKSIZE =  1
        STRUCT_STAT_ST_BLOCKS =  1
        STRUCT_STAT_ST_RDEV =  1
        STRUCT_TMS =  1
        STRUCT_TM_TM_ZONE =  1
        STRUCT_UTSNAME =  1
        ST_DM_MODE = 0
        SUITESPARSE_AMD_H =  1
        SUITESPARSE_CAMD_H =  1
        SUITESPARSE_CCOLAMD_H =  1
        SUITESPARSE_CHOLMOD_H =  1
        SUITESPARSE_COLAMD_H =  1
        SUITESPARSE_CS_H =  1
        SUITESPARSE_UMFPACK_H =  1
        SUNMATH_H = 0
        SYMLINK =  1
        SYSCTL =  1
        SYSMP = 0
        SYS_BITYPES_H = 0
        SYS_CDEFS_H =  1
        SYS_DIR_H = 0
        SYS_INTTYPES_H = 0
        SYS_IOCTL_H =  1
        SYS_MMAN_H =  1
        SYS_NDIR_H = 0
        SYS_PARAM_H =  1
        SYS_POLL_H =  1
        SYS_PSTAT_H = 0
        SYS_RESOURCE_H =  1
        SYS_SELECT_H =  1
        SYS_SOCKET_H =  1
        SYS_STAT_H =  1
        SYS_SYSCTL_H =  1
        SYS_SYSMP_H = 0
        SYS_TIMEB_H = 0
        SYS_TIMES_H =  1
        SYS_TIME_H =  1
        SYS_TYPES_H =  1
        SYS_UIO_H =  1
        SYS_UTSNAME_H =  1
        SYS_WAIT_H =  1
        TCGETATTR =  1
        TCSETATTR =  1
        TEMPNAM =  1
        TERMCAP_H =  1
        TERMIOS_H =  1
        TERMIO_H = 0
        TGAMMA =  1
        TGAMMAF =  1
        TIMES =  1
        TM_GMTOFF =  1
        TM_ZONE =  1
        TOASCII =  1
        TOWLOWER =  1
        TR1_UNORDERED_MAP = 0
        TZNAME = 0
        TZSET =  1
        UFSPARSE_AMD_H = 0
        UFSPARSE_CAMD_H = 0
        UFSPARSE_CCOLAMD_H = 0
        UFSPARSE_CHOLMOD_H = 0
        UFSPARSE_COLAMD_H = 0
        UFSPARSE_CS_H = 0
        UFSPARSE_UMFPACK_H = 0
        UMASK =  1
        UMFPACK =  1
        UMFPACK_H = 0
        UMFPACK_UMFPACK_H = 0
        UNAME =  1
        UNISTD_H =  1
        UNORDERED_MAP =  1
        UNSIGNED_LONG_LONG_INT =  1
        UTIL_H =  1
        VASNPRINTF = 0
        VASPRINTF =  1
        WAITPID =  1
        WCHAR_H =  1
        WCHAR_T =  1
        WCRTOMB =  1
        WCSLEN =  1
        WCSNLEN =  1
        WCTYPE_H =  1
        WINDOWS_H = 0
        WINSOCK2_H = 0
        WINT_T =  1
        WMEMCHR =  1
        WMEMCPY =  1
        WMEMPCPY = 0
        WORKING_FSTATAT_ZERO_FLAG =  1
        WORKING_O_NOATIME =  1
        WORKING_O_NOFOLLOW =  1
        WS2TCPIP_H = 0
        XFT =  1
        X_WINDOWS =  1
        Z =  1
        ZLIB =  1
        ZLIB_H =  1
        _BOOL =  1
        _FINITE = 0
        _FSEEKI64 = 0
        _FTELLI64 = 0
        _FTIME = 0
        _HYPOTF = 0
        _ISNAN = 0
        _KBHIT = 0
        _SET_INVALID_PARAMETER_HANDLER = 0
        __FPURGE = 0
        __FREADING = 0
        __SECURE_GETENV = 0

    ALL_CFLAGS =
    ALL_CXXFLAGS =
    ALL_FFLAGS = -O3
    ALL_LDFLAGS =
    AMD_CPPFLAGS =
    AMD_LDFLAGS =
    AMD_LIBS = -lamd
    AR = ar
    ARFLAGS = cru
    ARPACK_CPPFLAGS =
    ARPACK_LDFLAGS =
    ARPACK_LIBS = -larpack
    BLAS_LIBS = -L/sw/lib/lapack/3.5.0 -lrefblas
    CAMD_CPPFLAGS =
    CAMD_LDFLAGS =
    CAMD_LIBS = -lcamd
    CARBON_LIBS = -Wl,-framework -Wl,Carbon
    CC = oct-cc
    CC_VERSION =
    CCOLAMD_CPPFLAGS =
    CCOLAMD_LDFLAGS =
    CCOLAMD_LIBS = -lccolamd
    CFLAGS = -O3 -MD -D_THREAD_SAFE -pthread
    CHOLMOD_CPPFLAGS =
    CHOLMOD_LDFLAGS =
    CHOLMOD_LIBS = -lcholmod
    COLAMD_CPPFLAGS =
    COLAMD_LDFLAGS =
    COLAMD_LIBS = -lcolamd
    CPICFLAG = -fPIC
    CPPFLAGS = -I/sw/include -I/sw/include/freetype2
    CURL_CPPFLAGS =
    CURL_LDFLAGS =
    CURL_LIBS = -lcurl
    CXSPARSE_CPPFLAGS =
    CXSPARSE_LDFLAGS =
    CXSPARSE_LIBS = -lcxsparse
    CXX = oct-cxx
    CXXCPP = clang++ -E
    CXXFLAGS = -O3 -MD -D_THREAD_SAFE -pthread
    CXXPICFLAG = -fPIC
    CXX_VERSION =
    DEFAULT_PAGER = less
    DEFS = -DHAVE_CONFIG_H
    DL_LD = oct-cxx
    DL_LDFLAGS = -bundle -bundle_loader ../libinterp/octave -F/sw/lib/qt4-mac/lib -Wl,-framework,QtNetwork -F/sw/lib/qt4-mac/lib -Wl,-framework,QtCore -F/sw/lib/qt4-mac/lib -Wl,-framework,QtGui -F/sw/lib/qt4-mac/lib -Wl,-framework,QtCore -L/sw/lib/qt4-mac/lib -L/sw/lib -Wl,-dead_strip_dylibs -framework JavaVM
    DL_LIBS = -ldl
    GCC_VERSION =
    GXX_VERSION =
    ENABLE_DYNAMIC_LINKING = yes
    EXEEXT =
    F77 = /sw/bin/gfortran-fsf-5
    F77_FLOAT_STORE_FLAG = -ffloat-store
    F77_INTEGER_8_FLAG =
    FC = /sw/bin/gfortran-fsf-5
    FFLAGS = -O3
    FFTW3_CPPFLAGS =
    FFTW3_LDFLAGS =
    FFTW3_LIBS = -lfftw3_threads -lfftw3
    FFTW3F_CPPFLAGS =
    FFTW3F_LDFLAGS =
    FFTW3F_LIBS = -lfftw3f_threads -lfftw3f
    FLIBS = -L/sw/lib/gcc5/lib -lgfortran
    FONTCONFIG_CFLAGS = -I/sw/include
    FPICFLAG = -fPIC
    FT2_CFLAGS = -I/sw/include/freetype2
    FT2_LIBS = -L/sw/lib -lfreetype
    GLPK_CPPFLAGS =
    GLPK_LDFLAGS =
    GLPK_LIBS = -lglpk
    GNUPLOT = gnuplot
    GRAPHICS_CFLAGS = -I/sw/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT
    GRAPHICS_LIBS = -L/sw/lib/fltk13-aqua/lib -L/sw/lib -lfltk_gl -framework AGL -framework OpenGL -framework ApplicationServices -lfltk -lpthread -framework Cocoa
    HDF5_CPPFLAGS =
    HDF5_LDFLAGS =
    HDF5_LIBS = -lhdf5
    LAPACK_LIBS = -L/sw/lib/lapack/3.5.0 -lreflapack
    LDFLAGS = -F/sw/lib/qt4-mac/lib -Wl,-framework,QtNetwork -F/sw/lib/qt4-mac/lib -Wl,-framework,QtCore -F/sw/lib/qt4-mac/lib -Wl,-framework,QtGui -F/sw/lib/qt4-mac/lib -Wl,-framework,QtCore -L/sw/lib/qt4-mac/lib -L/sw/lib -Wl,-dead_strip_dylibs -framework JavaVM
    LD_CXX = oct-cxx
    LD_STATIC_FLAG =
    LEX = flex
    LEXLIB =
    LFLAGS = -I
    LIBEXT = a
    LIBFLAGS = -L..
    LIBOCTAVE = -loctave
    LIBOCTINTERP = -loctinterp
    LIBS = -lm  -lgl2ps
    LLVM_CPPFLAGS =
    LLVM_LDFLAGS =
    LLVM_LIBS =
    LN_S = ln -s
    MAGICK_CPPFLAGS = -I/sw/include/GraphicsMagick
    MAGICK_LDFLAGS = -L/sw/lib/graphicsmagick1322
    MAGICK_LIBS = -lGraphicsMagick++ -lGraphicsMagick
    MKOCTFILE_DL_LDFLAGS = -bundle -bundle_loader /sw/bin/octave-3.8.2
    OCTAVE_LINK_DEPS = -L/sw/lib -lfreetype -lhdf5 -lz -lfftw3_threads -lfftw3 -lfftw3f_threads -lfftw3f -L/sw/lib -lfontconfig -Wl,-framework -Wl,OpenGL -L/usr/X11/lib -lX11 -Wl,-framework -Wl,Carbon -lgl2ps  -framework JavaVM -L/sw/lib/lapack/3.5.0 -lreflapack              -lcurl -lcholmod -lumfpack -lamd -lcamd -lcolamd -lccolamd -lcxsparse -larpack -lqrupdate -lfftw3_threads -lfftw3 -lfftw3f_threads -lfftw3f -L/sw/lib/lapack/3.5.0 -lreflapack -L/sw/lib/lapack/3.5.0 -lrefblas -lreadline -lncurses  -L/sw/lib/libpcre1 -lpcre -ldl  -L/sw/lib/gcc5/lib -lgfortran -lm  -lgl2ps
    OCTAVE_LINK_OPTS =
    OCT_LINK_DEPS = -L/sw/lib -lfreetype -lhdf5 -lz -lfftw3_threads -lfftw3 -lfftw3f_threads -lfftw3f -L/sw/lib -lfontconfig -Wl,-framework -Wl,OpenGL -L/usr/X11/lib -lX11 -Wl,-framework -Wl,Carbon -lgl2ps  -framework JavaVM -L/sw/lib/lapack/3.5.0 -lreflapack              -lcurl -lcholmod -lumfpack -lamd -lcamd -lcolamd -lccolamd -lcxsparse -larpack -lqrupdate -lfftw3_threads -lfftw3 -lfftw3f_threads -lfftw3f -L/sw/lib/lapack/3.5.0 -lreflapack -L/sw/lib/lapack/3.5.0 -lrefblas -lreadline -lncurses  -L/sw/lib/libpcre1 -lpcre -ldl  -L/sw/lib/gcc5/lib -lgfortran -lm  -lgl2ps
    OCT_LINK_OPTS = -F/sw/lib/qt4-mac/lib -Wl,-framework,QtNetwork -F/sw/lib/qt4-mac/lib -Wl,-framework,QtCore -F/sw/lib/qt4-mac/lib -Wl,-framework,QtGui -F/sw/lib/qt4-mac/lib -Wl,-framework,QtCore -L/sw/lib/qt4-mac/lib -L/sw/lib -Wl,-dead_strip_dylibs -framework JavaVM
    OPENGL_LIBS = -L/sw/lib -lfontconfig -Wl,-framework -Wl,OpenGL
    PCRE_CPPFLAGS = -I/sw/include
    PCRE_LIBS = -L/sw/lib/libpcre1 -lpcre
    PTHREAD_CFLAGS = -D_THREAD_SAFE -pthread
    PTHREAD_LIBS =
    QHULL_CPPFLAGS =
    QHULL_LDFLAGS =
    QHULL_LIBS = -lqhull
    QRUPDATE_CPPFLAGS =
    QRUPDATE_LDFLAGS =
    QRUPDATE_LIBS = -lqrupdate
    QT_CPPFLAGS = -I/sw/lib/qt4-mac/include/QtCore -I/sw/lib/qt4-mac/include/QtGui -I/sw/lib/qt4-mac/include -I/sw/lib/qt4-mac/include/QtNetwork
    QT_LDFLAGS = -F/sw/lib/qt4-mac/lib
    QT_LIBS = -Wl,-framework,QtCore -Wl,-framework,QtGui -Wl,-framework,QtNetwork  -lqscintilla2
    RANLIB = ranlib
    RDYNAMIC_FLAG = -rdynamic
    READLINE_LIBS = -lreadline
    SED = /sw/bin/sed
    SHARED_LIBS =
    SHLEXT = dylib
    SHLEXT_VER = 3.8.2.dylib
    SH_LD = oct-cxx
    SH_LDFLAGS = -dynamiclib -single_module -F/sw/lib/qt4-mac/lib -Wl,-framework,QtNetwork -F/sw/lib/qt4-mac/lib -Wl,-framework,QtCore -F/sw/lib/qt4-mac/lib -Wl,-framework,QtGui -F/sw/lib/qt4-mac/lib -Wl,-framework,QtCore -L/sw/lib/qt4-mac/lib -L/sw/lib -Wl,-dead_strip_dylibs -framework JavaVM
    SONAME_FLAGS = -install_name /sw/lib/octave/3.8.2/oct-conf.h
    STATIC_LIBS =
    TERM_LIBS = -lncurses
    UMFPACK_CPPFLAGS =
    UMFPACK_LDFLAGS =
    UMFPACK_LIBS = -lumfpack
    USE_64_BIT_IDX_T = no
    WARN_CFLAGS = -Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual
    WARN_CXXFLAGS = -Wall -W -Wshadow -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual
    X11_INCFLAGS = /usr/X11/include
    X11_LIBS = -L/usr/X11/lib -lX11
    XTRA_CFLAGS =
    XTRA_CXXFLAGS =
    YACC =
    YFLAGS =
    Z_CPPFLAGS =
    Z_LDFLAGS =
    Z_LIBS = -lz
    api_version = api-v49+
    archlibdir = /sw/lib/octave/3.8.2/exec/x86_64-apple-darwin
    bindir = /sw/bin
    canonical_host_type = x86_64-apple-darwin
    config_opts = '--prefix=/sw' '--with-lapack=-L/sw/lib/lapack/3.5.0 -lreflapack' '--with-blas=-L/sw/lib/lapack/3.5.0 -lrefblas' '--with-framework-carbon' '--with-magick=GraphicsMagick' '--with-qhull-includedir=/sw/include/libqhull' '--host=x86_64-apple-darwin' '--build=x86_64-apple-darwin' '--infodir=/sw/share/info' '--mandir=/sw/share/man' '--libexecdir=/sw/lib' '--enable-shared' '--enable-dl' '--disable-static' '--enable-dependency-tracking' 'build_alias=x86_64-apple-darwin' 'host_alias=x86_64-apple-darwin' 'CC=oct-cc' 'CFLAGS=-O3 -MD' 'LDFLAGS=-F/sw/lib/qt4-mac/lib -Wl,-framework,QtNetwork -F/sw/lib/qt4-mac/lib -Wl,-framework,QtCore -F/sw/lib/qt4-mac/lib -Wl,-framework,QtGui -F/sw/lib/qt4-mac/lib -Wl,-framework,QtCore -L/sw/lib/qt4-mac/lib -L/sw/lib -Wl,-dead_strip_dylibs' 'LIBS=-lgl2ps' 'CPPFLAGS=-I/sw/include -I/sw/include/freetype2' 'CPP=clang -E' 'PKG_CONFIG=/sw/bin/pykg-config' 'CXX=oct-cxx' 'CXXFLAGS=-O3 -MD' 'CXXCPP=clang++ -E' 'F77=/sw/bin/gfortran-fsf-5' 'FFLAGS=-O3' 'JAVA_HOME=/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home'
    datadir = /sw/share
    datarootdir = /sw/share
    exec_prefix = /sw
    fcnfiledir = /sw/share/octave/3.8.2/m
    imagedir = /sw/share/octave/3.8.2/imagelib
    includedir = /sw/include
    infodir = /sw/share/info
    infofile = /sw/share/info/octave.info
    libdir = /sw/lib
    libexecdir = /sw/lib
    localapiarchlibdir = /sw/lib/octave/api-v49+/site/exec/x86_64-apple-darwin
    localapifcnfiledir = /sw/share/octave/site/api-v49+/m
    localapioctfiledir = /sw/lib/octave/site/oct/api-v49+/x86_64-apple-darwin
    localarchlibdir = /sw/lib/octave/site/exec/x86_64-apple-darwin
    localfcnfiledir = /sw/share/octave/site/m
    localoctfiledir = /sw/lib/octave/site/oct/x86_64-apple-darwin
    localstartupfiledir = /sw/share/octave/site/m/startup
    localverarchlibdir = /sw/lib/octave/3.8.2/site/exec/x86_64-apple-darwin
    localverfcnfiledir = /sw/share/octave/3.8.2/site/m
    localveroctfiledir = /sw/lib/octave/3.8.2/site/oct/x86_64-apple-darwin
    man1dir = /sw/share/man/man1
    man1ext = .1
    mandir = /sw/share/man
    octfiledir = /sw/lib/octave/3.8.2/oct/x86_64-apple-darwin
    octetcdir = /sw/share/octave/3.8.2/etc
    octincludedir = /sw/include/octave-3.8.2/octave
    octlibdir = /sw/lib/octave/3.8.2
    octtestsdir = /sw/share/octave/3.8.2/etc/tests
    prefix = /sw
    startupfiledir = /sw/share/octave/3.8.2/m/startup
    version = 3.8.2
    unix =  1
    mac =  1
    windows = 0

octave:2>

Lukas Reichlin <paramaniac>
Sun 01 Nov 2015 08:05:22 AM UTC, comment #11: 

Oops -- bad markup.  I should have said

inv (i * Inf * e - a)

Lachlan Andrew <lachlan>
Sun 01 Nov 2015 08:04:14 AM UTC, comment #10: 

I think this is related to bug #45577.

The attached patch works around the problem on my Ubuntu system, and a related problem with inv (i*Inf*e - a).

The solution for  inv  returns a zero, when it may perhaps be possible that some elements are non-zero but anorm is still infinite -- I don't understand the algorithm or LAPACK well enough to tell.

I hope the patch is a pointer to someone more knowledgeable who can fix it properly.

(file #35352)

Lachlan Andrew <lachlan>
Sun 01 Nov 2015 04:26:41 AM UTC, comment #9: 

@Philip (comment #6):
Checking in Ubuntu, I got the same results as you get in Windows"

c / (i*Inf*e - a)

fails, while

c / (i*Inf*e)

works.

Avinoam Kalma <avinoam>
Project Member
Sat 31 Oct 2015 07:58:46 PM UTC, comment #8: 

On Mageia-5 (w. standard BLAS) I get:

>> c / (i*Inf*e - a)
warning: matrix singular to machine precision, rcond = nan
error: exception encountered in Fortran subroutine zgelsd_
>>

so it errors at some other FORTRAN subroutine than DLASCL here.

I had a first go at a more descriptive title; better suggestions?

Even if OpenBLAS crashes Octave, the error is still there with BLAS. And we don't know yet what BLAS the OP has used on Mac OSX - Lucas?

Philip Nienhuis <philipnienhuis>
Project Member
Sat 31 Oct 2015 05:14:37 PM UTC, comment #7: 

On Debian (and probably Ubuntu also) it crashes when using OpenBLAS but not when using netlib BLAS.

With netlib:

>> c / (i*inf*e - a)
warning: matrix singular to machine precision, rcond = nan
** On entry to DLASCL parameter number  4 had an illegal value
error: exception encountered in Fortran subroutine zgelsd_
>>

and Octave continues running. Using OpenBLAS:

>> c / (i*inf*e - a)
warning: matrix singular to machine precision
*** Error in `octave-cli-4.0.0': double free or corruption (out): 0x0000000000b91330 ***
panic: Aborted -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Aborted

Mike Miller <mtmiller>
Project Administrator
Sat 31 Oct 2015 04:30:58 PM UTC, comment #6: 

On Ubuntu it may not crash, but I think the FORTRAN error shouldn't happen either. So OS should still be "Any".

Could you try breaking down the command like in comment #3 and see if it fails in the same step?

Philip Nienhuis <philipnienhuis>
Project Member
Sat 31 Oct 2015 04:18:28 PM UTC, comment #5: 

I have checked this script on Linux and on Windows.

In Windows (Win7, Octave 4.1.0+, 32bit) it crashed.

On Ububtu It did not crash:

>> bug_arrayfun
warning: matrix singular to machine precision, rcond = nan
warning: called from
    bug_arrayfun> at line -1 column -1
    bug_arrayfun at line 23 column 3
** On entry to DLASCL parameter number  4 had an illegal value
error: exception encountered in Fortran subroutine zgelsd_
error: called from
    bug_arrayfun> at line -1 column -1
    bug_arrayfun at line 23 column 3

>>


So the OS could be non-Unix?

Avinoam Kalma <avinoam>
Project Member
Fri 30 Oct 2015 08:56:01 AM UTC, comment #4: 

I stumbled across this bug when I tried the following with the control package:

sys = Boeing707
freqresp (sys, w)

where argument w is a vector of frequencies. If w contains any Inf's or NaN's, then Octave will crash.

BTW: As a consequence, I will change the functions in _control_helper_functions_.oct such that they only accept values that are considered as finite by Octave's isfinite mapper. Inf's and NaN's don't make sense in transfer functions polynomials and state-space matrices anyway. These changes will be part of control-3.0.1.

Lukas Reichlin <paramaniac>
Fri 30 Oct 2015 08:39:16 AM UTC, comment #3: 

(Sigh - so consecutive minus verbatim and plus verbatim cut off postings)
Another try:

Pulling the equation out of arrayfun(), it turns out that Octave-4.1.0+ on Windows also crashes on:

c / (i*Inf*e - a)*b

Narrowing further,

(i*Inf*e) - a

works fine,

c / (i*Inf*e)

works fine as well, but

c / (i*Inf*e - a)

leads to a crash

Philip Nienhuis <philipnienhuis>
Project Member
Fri 30 Oct 2015 08:35:38 AM UTC, comment #2: 

(Argh... that bug tracker markup stuff bit me again... sorry)
Again with with "verbatim":

Pulling the equation out of arrayfun(), it turns out that Octave-4.1.0+ on Windows also crashes on:

c / (i*Inf*e - a) * b

Narrowing further,

Philip Nienhuis <philipnienhuis>
Project Member
Fri 30 Oct 2015 08:31:54 AM UTC, comment #1: 

The crash occurs also on Windows with Octave-4.1.0+, so I provisionally changed OS->Any, Release->dev.

But....
It's the statement "w = Inf" that makes the difference. Are you sure that it Inf is a proper value?
Substituting a large number (e.g., 1e16), make the script run:

>> w = 1e16
w =   1.0000e+016
>> s = i * w;
>> H = arrayfun (@(x) c/(x*e - a)*b + d, s, "uniformoutput", false)
H =
{
  [1,1] =

    6.4950e-035 - 1.6023e-017i  3.3283e-035 - 2.1118e-019i
    -9.1736e-034 - 6.2879e-050i  7.5283e-033 + 6.9897e-049i

}
>>

so all in all very small output numbers.
These get a little bigger when substituting 1e10 or 1e5 for w, so I suppose you'd expect H{1} to become a zero matrix?

Pulling the equation out of arrayfun(), it turns out that Octave-4.1.0+ on Windows also crashes on:

c/(i*Inf*e - a)*b

Narrowing further,

(i*Inf.e) - a   =>  OK

c / (i*Inf*e)   =>  OK

c / (i*Inf*e - a)  => crash

so it doesn't look like an arrayfun() problem per se, but more a problem with manipulation of matrices containing Infs and Nans.

Title adapted a little, I don't know how to put it exactly.

Philip Nienhuis <philipnienhuis>
Project Member
Fri 30 Oct 2015 04:30:53 AM UTC, original submission:  

The attached script file will produce a segfault:

octave:1> bug_arrayfun
warning: matrix singular to machine precision, rcond = nan
** On entry to DLASCL parameter number  4 had an illegal value
panic: Segmentation fault: 11 -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Segmentation fault: 11

Tested on a Mac running Octave 3.8.2. Other platforms and Octave 4.x needs to be tested.

Lukas Reichlin <paramaniac>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35352:  patch_46330.txt added by lachlan (2KiB - text/plain - Workaround of crash)
file #35330:  bug_arrayfun.m added by paramaniac (958B - application/octet-stream)

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by lachlan (Updated the item)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by paramaniac (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 25 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-16 avinoam StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2016-09-15 rik5 StatusFixed => Confirmed
        Open/ClosedClosed => Open
        Summarysegfault with matrices containing Inf & NaN => Fortran exception with matrices containing Inf & NaN
    2016-07-15 rik5 StatusReady For Test => Fixed
        Open/ClosedOpen => Closed
    2016-07-11 rik5 StatusPatch Submitted => Ready For Test
    2016-07-09 mtmiller StatusIn Progress => Patch Submitted
    2016-07-08 siko1056 Attached File- => Added patch-46330-2016-07-08.txt, #37772
    2016-07-08 siko1056 Attached File#37755 => Removed
    2016-07-08 lachlan StatusPatch Submitted => In Progress
    2016-07-07 siko1056 Attached File- => Added patch-46330-2016-07-07.txt, #37755
    2016-07-07 siko1056 Attached File#37718 => Removed
    2016-07-07 avinoam StatusFixed => Patch Submitted
        Open/ClosedClosed => Open
    2016-07-07 siko1056 Dependencies- => bugs #48431 is dependent
    2016-07-06 siko1056 StatusPatch Submitted => Fixed
        Assigned toNone => siko1056
        Open/ClosedOpen => Closed
    2016-07-05 siko1056 Attached File- => Added patch-46330-2016-07-05.txt, #37718
    2015-12-22 mtmiller CategoryNone => Libraries
        Severity3 - Normal => 4 - Important
        StatusConfirmed => Patch Submitted
    2015-11-01 lachlan Attached File- => Added patch_46330.txt, #35352

    Back to the top


    Powered by Savane 3.5