Bug 236168 - java/openjdk8, java/linux-oracle-jdk9 and java/linux-oracle-jdk10: JVM_handle_bsd_signal segmentation fault in sbt shell within intellij idea
Summary: java/openjdk8, java/linux-oracle-jdk9 and java/linux-oracle-jdk10: JVM_handle...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-java mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-02 22:19 UTC by Tino Engel
Modified: 2019-03-06 14:30 UTC (History)
3 users (show)

See Also:


Attachments
error log as refered in corresponding post (36.33 KB, text/plain)
2019-03-03 23:34 UTC, Tino Engel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tino Engel 2019-03-02 22:19:19 UTC
Info: Bug occurs no matter if using openjdk8, linux-oracle-jdk9 or linux-oracle-jdk10.
The bug occurs in intellij idea ultimate, but I recall it occurring also in community edition.
The sbt shell seems to be very unstable in idea. Arbitrary tasks like sbt project import, compile, run often core dump with the following type of error:

=======
[IJ]sbt:de.musichearts.rapki> compile
[info] Compiling 29 Scala sources to /usr/home/elgrande/rapki/target/scala-2.12/classes ...
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000080188a7db, pid=1451, tid=0x000000000001886b
#
# JRE version: OpenJDK Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.202-b08 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0xa8a7db]  JVM_handle_bsd_signal+0xd774b
#
# Core dump written. Default location: /usr/home/elgrande/rapki/java.core
#
# An error report file with more information is saved as:
# /usr/home/elgrande/rapki/hs_err_pid1451.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
=======

The error seems to to be reproducable, but occurs quite often. It is most times solveable by
rm -rf project/target/ target/ ~/.sbt/1.0/plugins/target/
from project root followed by sbt shell restart.
Comment 1 Tino Engel 2019-03-03 20:38:59 UTC
Info:
It seems that there are two different errors.
The other one is JVM_FindSignal:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000080177e96f, pid=1422, tid=0x0000000000018bba
#
# JRE version: OpenJDK Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.202-b08 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x97e96f]  JVM_FindSignal+0x18519f
#
# Core dump written. Default location: /usr/home/elgrande/rapki/java.core
#
# An error report file with more information is saved as:
# /usr/home/elgrande/rapki/hs_err_pid1422.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
Comment 2 Palle Girgensohn freebsd_committer 2019-03-03 21:50:02 UTC
Hi!

I suspect that a `bt` (backtrace) from the indicated core file would be helpful, as would the contents of the logfile hs_err_pid1451.log.

Cheers,
Palle
Comment 3 Tino Engel 2019-03-03 23:09:53 UTC
Can you please shed a light on me how to get such a `bt`?
Then I'll send the info as soon as I stumble into the error again.
(Might be after current upgrade I am performing atm).
Comment 4 Tino Engel 2019-03-03 23:33:34 UTC
Here the error with log content:

===== error =====
[IJ]sbt:de.musichearts.rapki> run
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000080177e96f, pid=6793, tid=0x0000000000018991
#
# JRE version: OpenJDK Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.202-b08 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x97e96f]  JVM_FindSignal+0x18519f
#
# Core dump written. Default location: /usr/home/elgrande/rapki/java.core
#
# An error report file with more information is saved as:
# /usr/home/elgrande/rapki/hs_err_pid6793.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
==========

attaching hs_err_pid6793.log now to the ticket
Comment 5 Tino Engel 2019-03-03 23:34:23 UTC
Created attachment 202529 [details]
error log as refered in corresponding post
Comment 6 Palle Girgensohn freebsd_committer 2019-03-04 11:25:46 UTC
I think this page can help with gdb:

https://www.freebsd.org/doc/en/books/developers-handbook/debugging.html

especially 2.6.3

in short: gbd -c [corefile] [binary]

then at the gbd prompt:

bt

Best regards,
Palle
Comment 7 Tino Engel 2019-03-05 06:48:06 UTC
Hey Palle,

Thanks for guiding me.
I tried to run the same process that fails from inside idea manually in a shell and to examine the core file with gdb.
Below I paste the shell content.
Does that help or does it need to be handled a different way (e.g. trying to attach a java process to gdb to gdb prior to the dump)?

==========

elgrande@aw:~/rapki % /usr/local/openjdk8/bin/java -server -Xms2048m -Xmx8192m -XX:ReservedCodeCacheSize=2048m -XX:-UseGCOverheadLimit -Xmx2048M -Didea.managed=true -Dfile.encoding=UTF-8 -jar /usr/local/share/sbt/sbt-launch.jar --addPluginSbtFile=/tmp/idea13500.sbt idea-shell           
[info] Loading settings for project global-plugins from idea13500.sbt ...
[info] Loading global plugins from /usr/home/elgrande/.sbt/1.0/plugins
[info] Loading project definition from /usr/home/elgrande/rapki/project
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000080179d647, pid=88635, tid=0x000000000001894b
#
# JRE version: OpenJDK Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08)
# Java VM: OpenJDK 64-Bit Server VM (25.202-b08 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x99d647]  JVM_FindSignal+0x1851b7
#
# Core dump written. Default location: /usr/home/elgrande/rapki/java.core
#
# An error report file with more information is saved as:
# /usr/home/elgrande/rapki/hs_err_pid88635.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Abbruch(core dumped)
elgrande@aw:~/rapki % gdb -c java.core --args /usr/local/openjdk8/bin/java -server -Xms2048m -Xmx8192m -XX:ReservedCodeCacheSize=2048m -XX:-UseGCOverheadLimit -Xmx2048M -Didea.managed=true -Dfile.encoding=UTF-8 -jar /usr/local/share/sbt/sbt-launch.jar --addPluginSbtFile=/tmp/idea13500.sbt idea-shell
GNU gdb (GDB) 8.2.1 [GDB v8.2.1 for FreeBSD]
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-portbld-freebsd13.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/local/openjdk8/bin/java...(no debugging symbols found)...done.
[New LWP 100683]
[New LWP 101080]
[New LWP 101560]
[New LWP 101562]
[New LWP 101566]
[New LWP 101567]
[New LWP 101568]
[New LWP 101569]
[New LWP 101570]
[New LWP 101571]
[New LWP 101573]
[New LWP 101577]
[New LWP 101578]
[New LWP 101686]
[New LWP 101687]
[New LWP 101688]
[New LWP 101689]
[New LWP 101690]
[New LWP 101691]
[New LWP 101692]
[New LWP 101693]
[New LWP 100621]
[New LWP 100297]
[New LWP 101706]
[New LWP 101707]
[New LWP 101708]
[New LWP 101709]
[New LWP 101710]
[New LWP 101711]
[New LWP 101712]
[New LWP 101713]
[New LWP 100546]
[New LWP 100564]
[New LWP 100639]
[New LWP 100640]
[New LWP 100688]

warning: Could not load shared library symbols for /tmp/jna-53417024/jna4737997957574885857.tmp.
Do you need "set solib-search-path" or "set sysroot"?
Core was generated by `/usr/local/openjdk8/bin/java -server -Xms2048m -Xmx8192m -XX:ReservedCodeCacheSi'.
Program terminated with signal SIGABRT, Aborted.
#0  thr_kill () at thr_kill.S:3
3       RSYSCALL(thr_kill)
[Current thread is 1 (LWP 100683)]
(gdb)
Comment 8 Alex Dupre freebsd_committer 2019-03-06 14:30:27 UTC
I've accidentally seen this bug report only now.
The reason of the segmentation fault is the sbt native code that breaks with the FreeBSD 12 ABI change.
I've fixed the issue in the sbt port and the fix is also submitted upstream and will be available in sbt 1.3, but the workaround for intellij+sbt1.2 is to add "-Dsbt.io.jdktimestamps=true" to the VM Parameters of the SBT settings.