bugGNU Octave - Bugs: bug #63707, Java-related segfault causes...

 
 

bug #63707: Java-related segfault causes "make check" to crash

Submitter:  Arun Giridhar <arungiridhar>
Submitted:  Wed 25 Jan 2023 09:28:48 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Invalid / Not an Octave Bug Assigned to:  None
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

Fri 27 Jan 2023 12:54:49 AM UTC, comment #6: 

My distro does offer several openjdk variants but it turns out an unrelated program is dependent on the latest openjdk package. Maintaining multiple versions of openjdk is something I'm hoping to avoid. I'll close this as an upstream bug. If there's a bugfix in the openjdk package I'll post about it here.

Arun Giridhar <arungiridhar>
Group Member
Thu 26 Jan 2023 07:23:27 PM UTC, comment #5: 

@arun: Have you tried the "alternatives" command?  Good way on Red Hat to switch between a number of installed programs which have the same name (in this case 'java').

Rik <rik5>
Group administrator
Wed 25 Jan 2023 10:02:53 PM UTC, comment #4: 

Most distros I know provides multiple java packages, usually  1.8.0, 11, 17 and a current rolling. You should be able to select
a different version to test.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 25 Jan 2023 09:56:21 PM UTC, comment #3: 

Might be. It's whatever came with the distro update. I'll inform the distro Java package maintainers that there are downstream errors.

Arun Giridhar <arungiridhar>
Group Member
Wed 25 Jan 2023 09:50:50 PM UTC, comment #2: 

I have a slightly older java:

octave:3> version -java
ans = Java 19.0.1+10 with Red Hat, Inc. OpenJDK 64-Bit Server VM mixed mode, sharing


and I do not see the problem:


octave:1> test  libinterp/octave-value/ov-class.cc-tst
PASSES 50 out of 50 tests
octave:2> ver
----------------------------------------------------------------------
GNU Octave Version: 9.0.0 (hg id: 17ec50a2f044)
GNU Octave License: GNU General Public License
Operating System: Linux 5.14.0-239.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 19 14:14:19 UTC 2023 x86_64


Perhaps it is a bug in your (bleeding-edge) java package?

Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Wed 25 Jan 2023 09:47:04 PM UTC, comment #1: 

Simple way to test:


$ ./run-octave -q -f
octave:1> usejava ("jvm")
fatal: caught signal Segmentation fault -- stopping myself...
Segmentation fault (core dumped)


Retitling to mention Java.

Arun Giridhar <arungiridhar>
Group Member
Wed 25 Jan 2023 09:28:48 PM UTC, original submission:  

This was observed with the default branch, hg id 17ec50a2f044 but is probably older. A segfault occurs during "make check" when configured with all defaults:


$ unset CFLAGS CXXFLAGS FFLAGS CC CXX F77
$ unalias gcc g++ gfortran clang clang++
$ ../configure


The unset and unalias lines are to show "nothing up my sleeve". Everything that follows is chosen by configure.

Configuration summary:

Octave is now configured for x86_64-pc-linux-gnu

  Source directory:              ..
  Installation prefix:           /usr/local
  C compiler:                    gcc  -pthread -fopenmp  -Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual -g -O2
  C++ compiler:                  g++  -pthread -fopenmp  -Wall -W -Wshadow -Woverloaded-virtual -Wold-style-cast -Wformat -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual -g -O2
  Fortran compiler:              gfortran -g -O2 -std=legacy
  CPPFLAGS:
  Fortran libraries:              -L/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1 -L/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.1/../../.. -lgfortran -lm -lquadmath
  Lex libraries:
  LIBS:                          -lpthread -lm
  LDFLAGS:
  Extra LDFLAGS:

  AMD CPPFLAGS:
  AMD LDFLAGS:
  AMD libraries:                 -lamd
  ARPACK CPPFLAGS:               -I/usr/include/arpack
  ARPACK LDFLAGS:
  ARPACK libraries:              -larpack
  BLAS libraries:                -lopenblas
  BZ2 CPPFLAGS:
  BZ2 LDFLAGS:
  BZ2 libraries:                 -lbz2
  CAMD CPPFLAGS:
  CAMD LDFLAGS:
  CAMD libraries:                -lcamd
  CARBON libraries:
  CCOLAMD CPPFLAGS:
  CCOLAMD LDFLAGS:
  CCOLAMD libraries:             -lccolamd
  CHOLMOD CPPFLAGS:
  CHOLMOD LDFLAGS:
  CHOLMOD libraries:             -lcholmod
  COLAMD CPPFLAGS:
  COLAMD LDFLAGS:
  COLAMD libraries:              -lcolamd
  CURL CPPFLAGS:
  CURL LDFLAGS:
  CURL libraries:                -lcurl
  CXSPARSE CPPFLAGS:
  CXSPARSE LDFLAGS:
  CXSPARSE libraries:            -lcxsparse
  DL libraries:
  FFTW3 CPPFLAGS:
  FFTW3 LDFLAGS:
  FFTW3 libraries:               -lfftw3_threads -lfftw3
  FFTW3F CPPFLAGS:
  FFTW3F LDFLAGS:
  FFTW3F libraries:              -lfftw3f_threads -lfftw3f
  FLTK CPPFLAGS:
  FLTK LDFLAGS:
  FLTK libraries:                -lfltk_gl -lGLU -lGL -lfltk -lm -lX11 -lXext -lpthread -lXinerama -lXfixes -lXcursor -lXft -lXrender -lm -lfontconfig -ldl
  fontconfig CPPFLAGS:           -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4
  fontconfig libraries:          -lfontconfig -lfreetype
  FreeType2 CPPFLAGS:            -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -pthread
  FreeType2 libraries:           -lfreetype
  GLPK CPPFLAGS:
  GLPK LDFLAGS:
  GLPK libraries:                -lglpk
  HDF5 CPPFLAGS:
  HDF5 LDFLAGS:
  HDF5 libraries:                -lhdf5
  Java home:                     /usr/lib/jvm/java-19-openjdk
  Java JVM path:                 /usr/lib/jvm/java-19-openjdk/lib/server
  Java CPPFLAGS:                 -I/usr/lib/jvm/java-19-openjdk/include -I/usr/lib/jvm/java-19-openjdk/include/linux
  Java libraries:
  KLU CPPFLAGS:
  KLU LDFLAGS:
  KLU libraries:                 -lklu
  LAPACK libraries:
  Magick++ CPPFLAGS:             -I/usr/include/GraphicsMagick
  Magick++ LDFLAGS:
  Magick++ libraries:            -lGraphicsMagick++ -lGraphicsMagick
  OpenGL libraries:              -lGL -lGLU
  PCRE CPPFLAGS:
  PCRE LDFLAGS:
  PCRE libraries:                -lpcre2-8
  PortAudio CPPFLAGS:
  PortAudio LDFLAGS:
  PortAudio libraries:           -lportaudio -lasound -lm -lpthread
  PTHREAD flags:                 -pthread
  PTHREAD libraries:             -lpthread
  QHULL CPPFLAGS:
  QHULL LDFLAGS:
  QHULL libraries:               -lqhull_r
  QRUPDATE CPPFLAGS:
  QRUPDATE LDFLAGS:
  QRUPDATE libraries:            -lqrupdate
  Qt CPPFLAGS:                   -I/usr/include/qt/QtCore -I/usr/include/qt -I/usr/include/qt/QtGui -I/usr/include/qt/QtHelp -I/usr/include/qt/QtWidgets -I/usr/include/qt/QtSql -I/usr/include/qt/QtNetwork -I/usr/include/qt/QtOpenGL -I/usr/include/qt/QtPrintSupport -I/usr/include/qt/QtXml
  Qt LDFLAGS:
  Qt GUI libraries:              -lQt5Help -lQt5Sql -lQt5Network -lQt5OpenGL -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Xml -lQt5Core  -lqscintilla2_qt5
  Qt moc:                        moc-qt5
  Qt uic:                        uic-qt5
  Qt rcc:                        rcc-qt5
  Qt lrelease:                   lrelease-qt5
  Qt qcollectiongenerator:       qcollectiongenerator-qt5
  Qt qhelpgenerator:             qhelpgenerator-qt5
  READLINE libraries:            -lreadline
  Sndfile CPPFLAGS:              -I/usr/include/opus
  Sndfile LDFLAGS:
  Sndfile libraries:             -lsndfile
  SPQR CPPFLAGS:
  SPQR LDFLAGS:
  SPQR libraries:                -lspqr
  SuiteSparse config libraries:  -lsuitesparseconfig
  SUNDIALS IDA CPPFLAGS:
  SUNDIALS IDA LDFLAGS:
  SUNDIALS IDA libraries:        -lsundials_ida
  SUNDIALS NVECTOR CPPFLAGS:
  SUNDIALS NVECTOR LDFLAGS:
  SUNDIALS NVECTOR libraries:    -lsundials_nvecserial
  SUNLINSOL KLU CPPFLAGS:
  SUNLINSOL KLU LDFLAGS:
  SUNLINSOL KLU libraries:       -lsundials_sunlinsolklu
  UMFPACK CPPFLAGS:
  UMFPACK LDFLAGS:
  UMFPACK libraries:             -lumfpack
  X11 include flags:
  X11 libraries:                 -lX11
  Z CPPFLAGS:
  Z LDFLAGS:
  Z libraries:                   -lz

  Default pager:                 less
  gnuplot:                       gnuplot

  Build Octave Qt GUI:                  yes (version: 5)
  Build Java interface:                 yes
  Build static libraries:               no
  Build shared libraries:               yes
  Dynamic Linking API:                  dlopen
  Include support for GNU readline:     yes
  Use push parser in command line REPL: yes
  64-bit array dims and indexing:       yes
  64-bit BLAS array dims and indexing:  no
  OpenMP SMP multithreading:            yes
  Truncate intermediate FP results:     yes
  Build cross tools:                    no
  Build docs:                           yes

configure: WARNING: RapidJSON library found, but some features do not seem to work properly.  The "PrettyWriter" option in jsonencode will be disabled.
configure: WARNING: JAVA_HOME environment variable not initialized.  Auto-detection will proceed but is unreliable.
configure:
configure: NOTE: Libraries or auxiliary programs may be skipped if they are not found
configure: NOTE: OR if they are missing required features on your system.


Building is OK. Then "make check" segfaults with:


  libinterp/octave-value/ov-class.cc-tst .........................fatal: caught signal Segmentation fault -- stopping myself...
make[4]: *** [Makefile:2879: check-local] Error 139


Configuring with `--disable-java` prevents the problem. If that is done, then `make check` passes. The correspinding log for ov-class.cc is:


>>>>> processing ..../libinterp/octave-value/ov-class.cc-tst
***** testif HAVE_JAVA; usejava ("jvm")
 jobj = javaObject ("java.lang.StringBuffer");
 assert (class (jobj), "java.lang.StringBuffer");
----- skipped test (missing feature)

***** testif HAVE_JAVA; usejava ("jvm")
 ## The first and last assert() are equal on purpose.  The assert() in
 ## the middle with an invalid class name will cause the java code to
 ## throw exceptions which we then must clear properly (or all other calls
 ## will fail).  So we test this too.
 assert (isa (javaObject ("java.lang.Double", 10), "java.lang.Number"));
 assert (isa (javaObject ("java.lang.Double", 10), "not_a_class"), false);
 assert (isa (javaObject ("java.lang.Double", 10), "java.lang.Number"));
----- skipped test (missing feature)


Therefore those two tests are causing segfaults.

Java version:

$ java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment (build 19.0.2+7)
OpenJDK 64-Bit Server VM (build 19.0.2+7, mixed mode)


Should the default option be to disable Java unless explicitly enabled with `--enable-java`?

Arun Giridhar <arungiridhar>
Group Member

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-27 arungiridhar StatusNeed Info Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2023-01-26 rik5 StatusNone Need Info
    2023-01-25 arungiridhar CategoryClassdef Libraries
    2023-01-25 arungiridhar SummarySegfault with &quot;make check&quot; when configured with all defaults Java-related segfault causes "make check" to crash

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code