Discussion:
JCC Segfault on Debian 9 (stretch)
Joshua Campbell
2017-07-05 16:25:20 UTC
Permalink
This segfault appears to occur within the JVM code on both oracle-java8-jdk
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols but it
didn't seem to help.

Occurs under python 2 and 3. I don't know how to debug this any further.

0 ***@buttercup unnaturalcode 17609$ python3 -m virtualenv -p python3
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in /home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
0 ***@buttercup unnaturalcode 17610$ source venv3/bin/activate
0 ***@buttercup unnaturalcode 17611$ which python
/home/joshua/unnaturalcode/venv3/bin/python
0 ***@buttercup unnaturalcode 17616$ pip install jcc --no-cache-dir
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
Successfully installed jcc-3.0
0 ***@buttercup unnaturalcode 17617$ gdb --args
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 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-linux-gnu".
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 /home/joshua/unnaturalcode/venv3/bin/python...Reading
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a24b81b90e.debug...done.
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Installing openjdk unwinder
Traceback (most recent call last):
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/
libjvm.so-gdb.py", line 52, in <module>
class Types(object):
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
***@ualberta.ca
Andi Vajda
2017-07-05 16:46:47 UTC
Permalink
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both oracle-java8-jdk
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any further.
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in /home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
/home/joshua/unnaturalcode/venv3/bin/python
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?

Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 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-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/venv3/bin/python...Reading
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a24b81b90e.debug...done.
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
Joshua Campbell
2017-07-05 16:56:06 UTC
Permalink
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.

You mean with setup.py build --debug ? I tried that on trunk and got the
same result.
Post by Andi Vajda
Is the version of java used here the same as during jcc build time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any further.
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in /home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
/home/joshua/unnaturalcode/venv3/bin/python
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.
html
Post by Joshua Campbell
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"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2
4b81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
***@ualberta.ca
Joshua Campbell
2017-07-05 17:17:31 UTC
Permalink
Post by Andi Vajda
What version if java is this jcc built with ?
Oh it's openjdk-8-dbg_8u131-b11-2

But I got a same result (the stacktrace was slightly different but still
undecoded) with Oracle's JDK.
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command.
You should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk and got the
same result.
Post by Andi Vajda
Is the version of java used here the same as during jcc build time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any further.
python3
Post by Joshua Campbell
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in /home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
/home/joshua/unnaturalcode/venv3/bin/python
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html
Post by Joshua Campbell
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"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/ven
v3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a24b
81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthre
ad_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/j
re/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/j
re/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/
libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
***@ualberta.ca
Andi Vajda
2017-07-05 17:38:55 UTC
Permalink
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk and got the
same result.
But you should get a better stacktrace ?
Post by Andi Vajda
Post by Andi Vajda
Is the version of java used here the same as during jcc build time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Did you verify this via running 'ldd' on the shared libraries involved ?

That being said, it could be something different of course !

Andi..
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any further.
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in /home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
/home/joshua/unnaturalcode/venv3/bin/python
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.
html
Post by Joshua Campbell
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"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2
4b81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
Joshua Campbell
2017-07-05 17:48:41 UTC
Permalink
Post by Andi Vajda
But you should get a better stacktrace ?
I got the exact same stacktrace.

$ ldd
venv3/lib/python3.5/site-packages/JCC-3.0-py3.5-linux-x86_64.egg/libjcc3.so
linux-vdso.so.1 (0x00007ffcf4eb8000)
libjava.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libjava.so
(0x00007f412227f000)
libjvm.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
(0x00007f412133d000)
libpython3.5m.so.1.0 =>
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f4120c3a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f41208b8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f41205b4000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f412039b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f412017e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f411fddf000)
libverify.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libverify.so
(0x00007f411fbce000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f411f9ca000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1
(0x00007f411f7a0000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f411f584000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1
(0x00007f411f381000)
/lib64/ld-linux-x86-64.so.2 (0x000055857b9dd000)

I did verify it's compiling with -g

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g
-fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -fPIC -g -D_java_generics -DJCC_VER="3.0"
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -I_jcc3
-Ijcc3/sources -I/usr/include/python3.5m
-I/home/joshua/unnaturalcode/venv3/include/python3.5m -c
_jcc3/java/lang/String.cpp -o
build/temp.linux-x86_64-3.5/_jcc3/java/lang/String.o -DPYTHON
-fno-strict-aliasing -Wno-write-strings -O0 -g -DDEBUG

But it's still producing

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47eb2b4 in ?? ()
(gdb) bt
#0 0x00007fffe47eb2b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47eb160 in ?? ()
#3 0x00007fffffffc840 in ?? ()
#4 0x00007fffffffc7e0 in ?? ()
#5 0x00007ffff6006075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command.
You
Post by Andi Vajda
should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk and got the
same result.
But you should get a better stacktrace ?
Post by Andi Vajda
Post by Andi Vajda
Is the version of java used here the same as during jcc build time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Did you verify this via running 'ldd' on the shared libraries involved ?
That being said, it could be something different of course !
Andi..
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any
further.
python3
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in /home/joshua/unnaturalcode/
venv3/bin/python
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
Installing setuptools, pkg_resources, pip, wheel...done.
/home/joshua/unnaturalcode/venv3/bin/python
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command.
You
Post by Andi Vajda
Post by Andi Vajda
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.
Post by Andi Vajda
Post by Andi Vajda
html
Post by Joshua Campbell
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"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2
4b81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
***@ualberta.ca
Joshua Campbell
2017-07-05 20:16:09 UTC
Permalink
It's occuring after JCC calls JNI_CreateJavaVM

cpp.py(529): env = initVM(os.pathsep.join(classpath) or None, **initvm_args)
^^^^^ last python trace before death

Breakpoint 5, initVM (self=0x7ffff7e05048, args=0x7ffff66deac8,
kwds=0x7ffff7e00ec8) at jcc3/sources/jcc.cpp:527
527 if (JNI_CreateJavaVM(&vm, (void **) &vm_env, &vm_args) < 0)
^^^^ last line of jcc.cpp before death

(gdb) step

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe43942b4 in ?? ()
(gdb)


AFTER fixing debians debugging symbols with ln -s
/usr/lib/debug/usr/lib/jvm/java-8-openjdk-amd64
/usr/lib/debug/usr/lib/jvm/java-1.8.0-openjdk-amd64

Breakpoint 1, JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418,
args=0x7fffffffc450) at ./src/hotspot/src/share/vm/prims/jni.cpp:5161
5161 ./src/hotspot/src/share/vm/prims/jni.cpp: No such file or directory.
(gdb) s
JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418, args=0x7fffffffc450)
at ./src/hotspot/src/share/vm/prims/jni.cpp:5163
5163 in ./src/hotspot/src/share/vm/prims/jni.cpp
(gdb)
/build/gdb-A87voC/gdb-7.12/gdb/inline-frame.c:167: internal-error:
void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion
`frame_id_p (*this_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n

This is a bug, please report it. For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

What in the name of heck
Post by Joshua Campbell
Post by Andi Vajda
But you should get a better stacktrace ?
I got the exact same stacktrace.
$ ldd
venv3/lib/python3.5/site-packages/JCC-3.0-py3.5-linux-x86_64.egg/libjcc3.so
linux-vdso.so.1 (0x00007ffcf4eb8000)
libjava.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libjava.so
(0x00007f412227f000)
libjvm.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
(0x00007f412133d000)
libpython3.5m.so.1.0 =>
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f4120c3a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f41208b8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f41205b4000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f412039b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f412017e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f411fddf000)
libverify.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libverify.so
(0x00007f411fbce000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f411f9ca000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1
(0x00007f411f7a0000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f411f584000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1
(0x00007f411f381000)
/lib64/ld-linux-x86-64.so.2 (0x000055857b9dd000)
I did verify it's compiling with -g
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g
-fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -fPIC -g -D_java_generics -DJCC_VER="3.0"
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -I_jcc3 -Ijcc3/sources
-I/usr/include/python3.5m
-I/home/joshua/unnaturalcode/venv3/include/python3.5m -c
_jcc3/java/lang/String.cpp -o
build/temp.linux-x86_64-3.5/_jcc3/java/lang/String.o -DPYTHON
-fno-strict-aliasing -Wno-write-strings -O0 -g -DDEBUG
But it's still producing
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47eb2b4 in ?? ()
(gdb) bt
#0 0x00007fffe47eb2b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47eb160 in ?? ()
#3 0x00007fffffffc840 in ?? ()
#4 0x00007fffffffc7e0 in ?? ()
#5 0x00007ffff6006075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk and got the
same result.
But you should get a better stacktrace ?
Post by Andi Vajda
Post by Andi Vajda
Is the version of java used here the same as during jcc build time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Did you verify this via running 'ldd' on the shared libraries involved ?
That being said, it could be something different of course !
Andi..
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any further.
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in
/home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
/home/joshua/unnaturalcode/venv3/bin/python
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.
html
Post by Joshua Campbell
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"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2
4b81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
***@ualberta.ca
Andi Vajda
2017-07-05 20:26:34 UTC
Permalink
Post by Joshua Campbell
It's occuring after JCC calls JNI_CreateJavaVM
cpp.py(529): env = initVM(os.pathsep.join(classpath) or None, **initvm_args)
^^^^^ last python trace before death
Breakpoint 5, initVM (self=0x7ffff7e05048, args=0x7ffff66deac8,
kwds=0x7ffff7e00ec8) at jcc3/sources/jcc.cpp:527
527 if (JNI_CreateJavaVM(&vm, (void **) &vm_env, &vm_args) < 0)
^^^^ last line of jcc.cpp before death
(gdb) step
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe43942b4 in ?? ()
(gdb)
AFTER fixing debians debugging symbols with ln -s
/usr/lib/debug/usr/lib/jvm/java-8-openjdk-amd64
/usr/lib/debug/usr/lib/jvm/java-1.8.0-openjdk-amd64
Breakpoint 1, JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418,
args=0x7fffffffc450) at ./src/hotspot/src/share/vm/prims/jni.cpp:5161
5161 ./src/hotspot/src/share/vm/prims/jni.cpp: No such file or directory.
(gdb) s
JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418, args=0x7fffffffc450)
at ./src/hotspot/src/share/vm/prims/jni.cpp:5163
5163 in ./src/hotspot/src/share/vm/prims/jni.cpp
(gdb)
void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion
`frame_id_p (*this_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
<http://www.gnu.org/software/gdb/bugs/>.
What in the name of heck
Does it run without gdb ?

Andi..
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
But you should get a better stacktrace ?
I got the exact same stacktrace.
$ ldd
venv3/lib/python3.5/site-packages/JCC-3.0-py3.5-linux-x86_64.egg/libjcc3.so
linux-vdso.so.1 (0x00007ffcf4eb8000)
libjava.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libjava.so
(0x00007f412227f000)
libjvm.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
(0x00007f412133d000)
libpython3.5m.so.1.0 =>
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f4120c3a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f41208b8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f41205b4000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f412039b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f412017e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f411fddf000)
libverify.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libverify.so
(0x00007f411fbce000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f411f9ca000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1
(0x00007f411f7a0000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f411f584000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1
(0x00007f411f381000)
/lib64/ld-linux-x86-64.so.2 (0x000055857b9dd000)
I did verify it's compiling with -g
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g
-fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -fPIC -g -D_java_generics -DJCC_VER="3.0"
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -I_jcc3 -Ijcc3/sources
-I/usr/include/python3.5m
-I/home/joshua/unnaturalcode/venv3/include/python3.5m -c
_jcc3/java/lang/String.cpp -o
build/temp.linux-x86_64-3.5/_jcc3/java/lang/String.o -DPYTHON
-fno-strict-aliasing -Wno-write-strings -O0 -g -DDEBUG
But it's still producing
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47eb2b4 in ?? ()
(gdb) bt
#0 0x00007fffe47eb2b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47eb160 in ?? ()
#3 0x00007fffffffc840 in ?? ()
#4 0x00007fffffffc7e0 in ?? ()
#5 0x00007ffff6006075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk and got the
same result.
But you should get a better stacktrace ?
Post by Andi Vajda
Post by Andi Vajda
Is the version of java used here the same as during jcc build time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Did you verify this via running 'ldd' on the shared libraries involved ?
That being said, it could be something different of course !
Andi..
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any further.
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in
/home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
/home/joshua/unnaturalcode/venv3/bin/python
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.
html
Post by Joshua Campbell
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"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2
4b81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
Joshua Campbell
2017-07-05 20:39:16 UTC
Permalink
No, it segfaults.
Post by Andi Vajda
Post by Joshua Campbell
It's occuring after JCC calls JNI_CreateJavaVM
cpp.py(529): env = initVM(os.pathsep.join(classpath) or None, **initvm_args)
^^^^^ last python trace before death
Breakpoint 5, initVM (self=0x7ffff7e05048, args=0x7ffff66deac8,
kwds=0x7ffff7e00ec8) at jcc3/sources/jcc.cpp:527
527 if (JNI_CreateJavaVM(&vm, (void **) &vm_env, &vm_args) < 0)
^^^^ last line of jcc.cpp before death
(gdb) step
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe43942b4 in ?? ()
(gdb)
AFTER fixing debians debugging symbols with ln -s
/usr/lib/debug/usr/lib/jvm/java-8-openjdk-amd64
/usr/lib/debug/usr/lib/jvm/java-1.8.0-openjdk-amd64
Breakpoint 1, JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418,
args=0x7fffffffc450) at ./src/hotspot/src/share/vm/prims/jni.cpp:5161
5161 ./src/hotspot/src/share/vm/prims/jni.cpp: No such file or directory.
(gdb) s
JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418, args=0x7fffffffc450)
at ./src/hotspot/src/share/vm/prims/jni.cpp:5163
5163 in ./src/hotspot/src/share/vm/prims/jni.cpp
(gdb)
void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion
`frame_id_p (*this_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
<http://www.gnu.org/software/gdb/bugs/>.
What in the name of heck
Does it run without gdb ?
Andi..
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
But you should get a better stacktrace ?
I got the exact same stacktrace.
$ ldd
venv3/lib/python3.5/site-packages/JCC-3.0-py3.5-linux-x86_64.egg/libjcc3.so
linux-vdso.so.1 (0x00007ffcf4eb8000)
libjava.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libjava.so
(0x00007f412227f000)
libjvm.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
(0x00007f412133d000)
libpython3.5m.so.1.0 =>
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f4120c3a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f41208b8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f41205b4000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f412039b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f412017e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f411fddf000)
libverify.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libverify.so
(0x00007f411fbce000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f411f9ca000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1
(0x00007f411f7a0000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f411f584000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1
(0x00007f411f381000)
/lib64/ld-linux-x86-64.so.2 (0x000055857b9dd000)
I did verify it's compiling with -g
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g
-fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -fPIC -g -D_java_generics -DJCC_VER="3.0"
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -I_jcc3 -Ijcc3/sources
-I/usr/include/python3.5m
-I/home/joshua/unnaturalcode/venv3/include/python3.5m -c
_jcc3/java/lang/String.cpp -o
build/temp.linux-x86_64-3.5/_jcc3/java/lang/String.o -DPYTHON
-fno-strict-aliasing -Wno-write-strings -O0 -g -DDEBUG
But it's still producing
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47eb2b4 in ?? ()
(gdb) bt
#0 0x00007fffe47eb2b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47eb160 in ?? ()
#3 0x00007fffffffc840 in ?? ()
#4 0x00007fffffffc7e0 in ?? ()
#5 0x00007ffff6006075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk and got the
same result.
But you should get a better stacktrace ?
Post by Andi Vajda
Post by Andi Vajda
Is the version of java used here the same as during jcc build time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Did you verify this via running 'ldd' on the shared libraries involved ?
That being said, it could be something different of course !
Andi..
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any further.
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in
/home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
/home/joshua/unnaturalcode/venv3/bin/python
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.
html
Post by Joshua Campbell
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"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2
4b81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
***@ualberta.ca
Joshua Campbell
2017-07-05 22:03:32 UTC
Permalink
I confirmed that it crashes on multiple Debian 9 machines but it
doesn't crash on Ubuntu 16.04. This behavior is consistent regardless
of the JDK used (I tried openjdk 8, oracle 8 and openjdk 9). I am at a
loss for how to track it down further due to the (apparent) GDB bug.
Post by Joshua Campbell
No, it segfaults.
Post by Andi Vajda
Post by Joshua Campbell
It's occuring after JCC calls JNI_CreateJavaVM
cpp.py(529): env = initVM(os.pathsep.join(classpath) or None, **initvm_args)
^^^^^ last python trace before death
Breakpoint 5, initVM (self=0x7ffff7e05048, args=0x7ffff66deac8,
kwds=0x7ffff7e00ec8) at jcc3/sources/jcc.cpp:527
527 if (JNI_CreateJavaVM(&vm, (void **) &vm_env, &vm_args) < 0)
^^^^ last line of jcc.cpp before death
(gdb) step
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe43942b4 in ?? ()
(gdb)
AFTER fixing debians debugging symbols with ln -s
/usr/lib/debug/usr/lib/jvm/java-8-openjdk-amd64
/usr/lib/debug/usr/lib/jvm/java-1.8.0-openjdk-amd64
Breakpoint 1, JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418,
args=0x7fffffffc450) at ./src/hotspot/src/share/vm/prims/jni.cpp:5161
5161 ./src/hotspot/src/share/vm/prims/jni.cpp: No such file or directory.
(gdb) s
JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418, args=0x7fffffffc450)
at ./src/hotspot/src/share/vm/prims/jni.cpp:5163
5163 in ./src/hotspot/src/share/vm/prims/jni.cpp
(gdb)
void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion
`frame_id_p (*this_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
<http://www.gnu.org/software/gdb/bugs/>.
What in the name of heck
Does it run without gdb ?
Andi..
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
But you should get a better stacktrace ?
I got the exact same stacktrace.
$ ldd
venv3/lib/python3.5/site-packages/JCC-3.0-py3.5-linux-x86_64.egg/libjcc3.so
linux-vdso.so.1 (0x00007ffcf4eb8000)
libjava.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libjava.so
(0x00007f412227f000)
libjvm.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
(0x00007f412133d000)
libpython3.5m.so.1.0 =>
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f4120c3a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f41208b8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f41205b4000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f412039b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f412017e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f411fddf000)
libverify.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libverify.so
(0x00007f411fbce000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f411f9ca000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1
(0x00007f411f7a0000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f411f584000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1
(0x00007f411f381000)
/lib64/ld-linux-x86-64.so.2 (0x000055857b9dd000)
I did verify it's compiling with -g
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g
-fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -fPIC -g -D_java_generics -DJCC_VER="3.0"
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -I_jcc3 -Ijcc3/sources
-I/usr/include/python3.5m
-I/home/joshua/unnaturalcode/venv3/include/python3.5m -c
_jcc3/java/lang/String.cpp -o
build/temp.linux-x86_64-3.5/_jcc3/java/lang/String.o -DPYTHON
-fno-strict-aliasing -Wno-write-strings -O0 -g -DDEBUG
But it's still producing
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47eb2b4 in ?? ()
(gdb) bt
#0 0x00007fffe47eb2b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47eb160 in ?? ()
#3 0x00007fffffffc840 in ?? ()
#4 0x00007fffffffc7e0 in ?? ()
#5 0x00007ffff6006075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk and got the
same result.
But you should get a better stacktrace ?
Post by Andi Vajda
Post by Andi Vajda
Is the version of java used here the same as during jcc build time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Did you verify this via running 'ldd' on the shared libraries involved ?
That being said, it could be something different of course !
Andi..
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any further.
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in
/home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
/home/joshua/unnaturalcode/venv3/bin/python
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.
html
Post by Joshua Campbell
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"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2
4b81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
***@ualberta.ca
Andi Vajda
2017-07-06 04:40:11 UTC
Permalink
Post by Joshua Campbell
I confirmed that it crashes on multiple Debian 9 machines but it
doesn't crash on Ubuntu 16.04. This behavior is consistent regardless
of the JDK used (I tried openjdk 8, oracle 8 and openjdk 9). I am at a
loss for how to track it down further due to the (apparent) GDB bug.
Hmmm, maybe JNI is broken on Debian 9 ?

Andi..
Post by Joshua Campbell
Post by Joshua Campbell
No, it segfaults.
Post by Andi Vajda
Post by Joshua Campbell
It's occuring after JCC calls JNI_CreateJavaVM
cpp.py(529): env = initVM(os.pathsep.join(classpath) or None, **initvm_args)
^^^^^ last python trace before death
Breakpoint 5, initVM (self=0x7ffff7e05048, args=0x7ffff66deac8,
kwds=0x7ffff7e00ec8) at jcc3/sources/jcc.cpp:527
527 if (JNI_CreateJavaVM(&vm, (void **) &vm_env, &vm_args) < 0)
^^^^ last line of jcc.cpp before death
(gdb) step
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe43942b4 in ?? ()
(gdb)
AFTER fixing debians debugging symbols with ln -s
/usr/lib/debug/usr/lib/jvm/java-8-openjdk-amd64
/usr/lib/debug/usr/lib/jvm/java-1.8.0-openjdk-amd64
Breakpoint 1, JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418,
args=0x7fffffffc450) at ./src/hotspot/src/share/vm/prims/jni.cpp:5161
5161 ./src/hotspot/src/share/vm/prims/jni.cpp: No such file or directory.
(gdb) s
JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418, args=0x7fffffffc450)
at ./src/hotspot/src/share/vm/prims/jni.cpp:5163
5163 in ./src/hotspot/src/share/vm/prims/jni.cpp
(gdb)
void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion
`frame_id_p (*this_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
<http://www.gnu.org/software/gdb/bugs/>.
What in the name of heck
Does it run without gdb ?
Andi..
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
But you should get a better stacktrace ?
I got the exact same stacktrace.
$ ldd
venv3/lib/python3.5/site-packages/JCC-3.0-py3.5-linux-x86_64.egg/libjcc3.so
linux-vdso.so.1 (0x00007ffcf4eb8000)
libjava.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libjava.so
(0x00007f412227f000)
libjvm.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
(0x00007f412133d000)
libpython3.5m.so.1.0 =>
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f4120c3a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f41208b8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f41205b4000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f412039b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f412017e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f411fddf000)
libverify.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libverify.so
(0x00007f411fbce000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f411f9ca000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1
(0x00007f411f7a0000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f411f584000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1
(0x00007f411f381000)
/lib64/ld-linux-x86-64.so.2 (0x000055857b9dd000)
I did verify it's compiling with -g
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g
-fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -fPIC -g -D_java_generics -DJCC_VER="3.0"
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -I_jcc3 -Ijcc3/sources
-I/usr/include/python3.5m
-I/home/joshua/unnaturalcode/venv3/include/python3.5m -c
_jcc3/java/lang/String.cpp -o
build/temp.linux-x86_64-3.5/_jcc3/java/lang/String.o -DPYTHON
-fno-strict-aliasing -Wno-write-strings -O0 -g -DDEBUG
But it's still producing
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47eb2b4 in ?? ()
(gdb) bt
#0 0x00007fffe47eb2b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47eb160 in ?? ()
#3 0x00007fffffffc840 in ?? ()
#4 0x00007fffffffc7e0 in ?? ()
#5 0x00007ffff6006075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk and got the
same result.
But you should get a better stacktrace ?
Post by Andi Vajda
Post by Andi Vajda
Is the version of java used here the same as during jcc build time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Did you verify this via running 'ldd' on the shared libraries involved ?
That being said, it could be something different of course !
Andi..
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any further.
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in
/home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
/home/joshua/unnaturalcode/venv3/bin/python
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command. You
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.
html
Post by Joshua Campbell
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"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2
4b81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
Joshua Campbell
2017-07-06 06:44:02 UTC
Permalink
How would they break oracle's though. It's a binary.
Post by Andi Vajda
Post by Joshua Campbell
I confirmed that it crashes on multiple Debian 9 machines but it
doesn't crash on Ubuntu 16.04. This behavior is consistent regardless
of the JDK used (I tried openjdk 8, oracle 8 and openjdk 9). I am at a
loss for how to track it down further due to the (apparent) GDB bug.
Hmmm, maybe JNI is broken on Debian 9 ?
Andi..
Post by Joshua Campbell
Post by Joshua Campbell
No, it segfaults.
Post by Andi Vajda
Post by Joshua Campbell
It's occuring after JCC calls JNI_CreateJavaVM
cpp.py(529): env = initVM(os.pathsep.join(classpath) or None,
**initvm_args)
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
^^^^^ last python trace before death
Breakpoint 5, initVM (self=0x7ffff7e05048, args=0x7ffff66deac8,
kwds=0x7ffff7e00ec8) at jcc3/sources/jcc.cpp:527
527 if (JNI_CreateJavaVM(&vm, (void **) &vm_env,
&vm_args) < 0)
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
^^^^ last line of jcc.cpp before death
(gdb) step
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe43942b4 in ?? ()
(gdb)
AFTER fixing debians debugging symbols with ln -s
/usr/lib/debug/usr/lib/jvm/java-8-openjdk-amd64
/usr/lib/debug/usr/lib/jvm/java-1.8.0-openjdk-amd64
Breakpoint 1, JNI_CreateJavaVM (vm=0x7fffffffc420,
penv=0x7fffffffc418,
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
args=0x7fffffffc450) at ./src/hotspot/src/share/vm/
prims/jni.cpp:5161
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
5161 ./src/hotspot/src/share/vm/prims/jni.cpp: No such file or
directory.
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
(gdb) s
JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418,
args=0x7fffffffc450)
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
at ./src/hotspot/src/share/vm/prims/jni.cpp:5163
5163 in ./src/hotspot/src/share/vm/prims/jni.cpp
(gdb)
void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion
`frame_id_p (*this_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
<http://www.gnu.org/software/gdb/bugs/>.
What in the name of heck
Does it run without gdb ?
Andi..
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
But you should get a better stacktrace ?
I got the exact same stacktrace.
$ ldd
venv3/lib/python3.5/site-packages/JCC-3.0-py3.5-linux-
x86_64.egg/libjcc3.so
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
linux-vdso.so.1 (0x00007ffcf4eb8000)
libjava.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libjava.so
(0x00007f412227f000)
libjvm.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
(0x00007f412133d000)
libpython3.5m.so.1.0 =>
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f4120c3a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f41208b8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
(0x00007f41205b4000)
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f412039b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f412017e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
(0x00007f411fddf000)
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
libverify.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libverify.so
(0x00007f411fbce000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2
(0x00007f411f9ca000)
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1
(0x00007f411f7a0000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1
(0x00007f411f584000)
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1
(0x00007f411f381000)
/lib64/ld-linux-x86-64.so.2 (0x000055857b9dd000)
I did verify it's compiling with -g
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g
-fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -fPIC -g -D_java_generics -DJCC_VER="3.0"
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -I_jcc3
-Ijcc3/sources
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
-I/usr/include/python3.5m
-I/home/joshua/unnaturalcode/venv3/include/python3.5m -c
_jcc3/java/lang/String.cpp -o
build/temp.linux-x86_64-3.5/_jcc3/java/lang/String.o -DPYTHON
-fno-strict-aliasing -Wno-write-strings -O0 -g -DDEBUG
But it's still producing
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47eb2b4 in ?? ()
(gdb) bt
#0 0x00007fffe47eb2b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47eb160 in ?? ()
#3 0x00007fffffffc840 in ?? ()
#4 0x00007fffffffc7e0 in ?? ()
#5 0x00007ffff6006075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt
stack?)
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build
command.
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
You
should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk and
got the
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
same result.
But you should get a better stacktrace ?
Post by Andi Vajda
Post by Andi Vajda
Is the version of java used here the same as during jcc build
time ?
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Yes I made sure of that and uninstalled all but openjdk and
rebuilt.
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Did you verify this via running 'ldd' on the shared libraries
involved ?
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
That being said, it could be something different of course !
Andi..
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols
but it
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any
further.
python3
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/joshua/unnaturalcode/
venv3/bin/python3
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
Also creating executable in
/home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
venv3/bin/activate
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
/home/joshua/unnaturalcode/venv3/bin/python
--no-cache-dir
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build
command.
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
You
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build
time ?
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.
html
Post by Joshua Campbell
This is free software: you are free to change and redistribute
it.
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
There is NO WARRANTY, to the extent permitted by law. Type "show
copying"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2
4b81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python
-m jcc
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features()
()
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt
stack?)
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
***@ualberta.ca
Joshua Campbell
2017-07-06 21:50:08 UTC
Permalink
Okay so. I built GDB 8 from source (it's new) and that doesn't have bug.

In summary:

Ok TO BE CLEAR, I am closer to the TRUTH than ever. Not only am I not
stopping, I am working harder. Updates when available. Stay tuned!

It turns out the JVM is crashing on the line commented with "//
Generate SEGV" so something about Python/JNI/JCC is intefering with
the JVM's signal handler, as this SEGV is intentional!
Post by Joshua Campbell
How would they break oracle's though. It's a binary.
Post by Andi Vajda
Post by Joshua Campbell
I confirmed that it crashes on multiple Debian 9 machines but it
doesn't crash on Ubuntu 16.04. This behavior is consistent regardless
of the JDK used (I tried openjdk 8, oracle 8 and openjdk 9). I am at a
loss for how to track it down further due to the (apparent) GDB bug.
Hmmm, maybe JNI is broken on Debian 9 ?
Andi..
Post by Joshua Campbell
Post by Joshua Campbell
No, it segfaults.
Post by Andi Vajda
Post by Joshua Campbell
It's occuring after JCC calls JNI_CreateJavaVM
cpp.py(529): env = initVM(os.pathsep.join(classpath) or None,
**initvm_args)
^^^^^ last python trace before death
Breakpoint 5, initVM (self=0x7ffff7e05048, args=0x7ffff66deac8,
kwds=0x7ffff7e00ec8) at jcc3/sources/jcc.cpp:527
527 if (JNI_CreateJavaVM(&vm, (void **) &vm_env, &vm_args) < 0)
^^^^ last line of jcc.cpp before death
(gdb) step
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe43942b4 in ?? ()
(gdb)
AFTER fixing debians debugging symbols with ln -s
/usr/lib/debug/usr/lib/jvm/java-8-openjdk-amd64
/usr/lib/debug/usr/lib/jvm/java-1.8.0-openjdk-amd64
Breakpoint 1, JNI_CreateJavaVM (vm=0x7fffffffc420,
penv=0x7fffffffc418,
args=0x7fffffffc450) at
./src/hotspot/src/share/vm/prims/jni.cpp:5161
5161 ./src/hotspot/src/share/vm/prims/jni.cpp: No such file or directory.
(gdb) s
JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418, args=0x7fffffffc450)
at ./src/hotspot/src/share/vm/prims/jni.cpp:5163
5163 in ./src/hotspot/src/share/vm/prims/jni.cpp
(gdb)
void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion
`frame_id_p (*this_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
<http://www.gnu.org/software/gdb/bugs/>.
What in the name of heck
Does it run without gdb ?
Andi..
Post by Joshua Campbell
On Wed, Jul 5, 2017 at 11:48 AM, Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
But you should get a better stacktrace ?
I got the exact same stacktrace.
$ ldd
venv3/lib/python3.5/site-packages/JCC-3.0-py3.5-linux-x86_64.egg/libjcc3.so
linux-vdso.so.1 (0x00007ffcf4eb8000)
libjava.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libjava.so
(0x00007f412227f000)
libjvm.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
(0x00007f412133d000)
libpython3.5m.so.1.0 =>
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f4120c3a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f41208b8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
(0x00007f41205b4000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f412039b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f412017e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
(0x00007f411fddf000)
libverify.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libverify.so
(0x00007f411fbce000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2
(0x00007f411f9ca000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1
(0x00007f411f7a0000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1
(0x00007f411f584000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1
(0x00007f411f381000)
/lib64/ld-linux-x86-64.so.2 (0x000055857b9dd000)
I did verify it's compiling with -g
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g
-fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -fPIC -g -D_java_generics -DJCC_VER="3.0"
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -I_jcc3 -Ijcc3/sources
-I/usr/include/python3.5m
-I/home/joshua/unnaturalcode/venv3/include/python3.5m -c
_jcc3/java/lang/String.cpp -o
build/temp.linux-x86_64-3.5/_jcc3/java/lang/String.o -DPYTHON
-fno-strict-aliasing -Wno-write-strings -O0 -g -DDEBUG
But it's still producing
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47eb2b4 in ?? ()
(gdb) bt
#0 0x00007fffe47eb2b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47eb160 in ?? ()
#3 0x00007fffffffc840 in ?? ()
#4 0x00007fffffffc7e0 in ?? ()
#5 0x00007ffff6006075 in VM_Version::get_processor_features() ()
from
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command.
You
should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk and got the
same result.
But you should get a better stacktrace ?
Post by Andi Vajda
Post by Andi Vajda
Is the version of java used here the same as during jcc build time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Did you verify this via running 'ldd' on the shared libraries involved ?
That being said, it could be something different of course !
Andi..
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols
but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any
further.
python3
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in
/home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in
/home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
venv3/bin/activate
/home/joshua/unnaturalcode/venv3/bin/python
--no-cache-dir
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command.
You
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.
html
Post by Joshua Campbell
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"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2
4b81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m jcc
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt
stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
***@ualberta.ca
Dirk Rothe
2017-07-07 13:50:43 UTC
Permalink
I was bitten by this during jcc.initVM():
https://www.cloudlinux.com/cloudlinux-os-blog/entry/jvm-crashes-occurrin=
g-after-upgrading-to-a-kernel-with-the-fix-for-stack-clash

Maybe related...

--dirk
Okay so. I built GDB 8 from source (it's new) and that doesn't have bu=
g.
Ok TO BE CLEAR, I am closer to the TRUTH than ever. Not only am I not
stopping, I am working harder. Updates when available. Stay tuned!
It turns out the JVM is crashing on the line commented with "//
Generate SEGV" so something about Python/JNI/JCC is intefering with
the JVM's signal handler, as this SEGV is intentional!
=
Post by Joshua Campbell
How would they break oracle's though. It's a binary.
Post by Andi Vajda
Post by Joshua Campbell
I confirmed that it crashes on multiple Debian 9 machines but it
doesn't crash on Ubuntu 16.04. This behavior is consistent regardl=
ess
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
of the JDK used (I tried openjdk 8, oracle 8 and openjdk 9). I am =
at =
Post by Joshua Campbell
Post by Andi Vajda
a
Post by Joshua Campbell
loss for how to track it down further due to the (apparent) GDB bu=
g.
Post by Joshua Campbell
Post by Andi Vajda
Hmmm, maybe JNI is broken on Debian 9 ?
Andi..
Post by Joshua Campbell
On Wed, Jul 5, 2017 at 2:39 PM, Joshua Campbell =
No, it segfaults.
Post by Andi Vajda
Post by Joshua Campbell
It's occuring after JCC calls JNI_CreateJavaVM
cpp.py(529): env =3D initVM(os.pathsep.join(classpath) or N=
one,
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
**initvm_args)
^^^^^ last python trace before death
Breakpoint 5, initVM (self=3D0x7ffff7e05048, args=3D0x7ffff66de=
ac8,
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
kwds=3D0x7ffff7e00ec8) at jcc3/sources/jcc.cpp:527
527 if (JNI_CreateJavaVM(&vm, (void **) &vm_env, &vm_args) < 0)
^^^^ last line of jcc.cpp before death
(gdb) step
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe43942b4 in ?? ()
(gdb)
AFTER fixing debians debugging symbols with ln -s
/usr/lib/debug/usr/lib/jvm/java-8-openjdk-amd64
/usr/lib/debug/usr/lib/jvm/java-1.8.0-openjdk-amd64
Breakpoint 1, JNI_CreateJavaVM (vm=3D0x7fffffffc420,
penv=3D0x7fffffffc418,
args=3D0x7fffffffc450) at
./src/hotspot/src/share/vm/prims/jni.cpp:5161
5161 ./src/hotspot/src/share/vm/prims/jni.cpp: No such file =
or
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
directory.
(gdb) s
JNI_CreateJavaVM (vm=3D0x7fffffffc420, penv=3D0x7fffffffc418,
args=3D0x7fffffffc450)
at ./src/hotspot/src/share/vm/prims/jni.cpp:5163
5163 in ./src/hotspot/src/share/vm/prims/jni.cpp
(gdb)
/build/gdb-A87voC/gdb-7.12/gdb/inline-frame.c:167: internal-err=
void inline_frame_this_id(frame_info*, void**, frame_id*): =
Assertion
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
`frame_id_p (*this_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
<http://www.gnu.org/software/gdb/bugs/>.
What in the name of heck
Does it run without gdb ?
Andi..
Post by Joshua Campbell
On Wed, Jul 5, 2017 at 11:48 AM, Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
But you should get a better stacktrace ?
I got the exact same stacktrace.
$ ldd
=
venv3/lib/python3.5/site-packages/JCC-3.0-py3.5-linux-x86_64.egg/lib=
jcc3.so
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
linux-vdso.so.1 (0x00007ffcf4eb8000)
libjava.so =3D>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libjava.so=
(0x00007f412227f000)
libjvm.so =3D>
=
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so=
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
(0x00007f412133d000)
libpython3.5m.so.1.0 =3D>
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 =
(0x00007f4120c3a000)
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
libstdc++.so.6 =3D> /usr/lib/x86_64-linux-gnu/libstdc++.=
so.6
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
(0x00007f41208b8000)
libm.so.6 =3D> /lib/x86_64-linux-gnu/libm.so.6
(0x00007f41205b4000)
libgcc_s.so.1 =3D> /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f412039b000)
libpthread.so.0 =3D> /lib/x86_64-linux-gnu/libpthread.so=
.0
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
(0x00007f412017e000)
libc.so.6 =3D> /lib/x86_64-linux-gnu/libc.so.6
(0x00007f411fddf000)
libverify.so =3D>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libverify.=
so
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
(0x00007f411fbce000)
libdl.so.2 =3D> /lib/x86_64-linux-gnu/libdl.so.2
(0x00007f411f9ca000)
libexpat.so.1 =3D> /lib/x86_64-linux-gnu/libexpat.so.1
(0x00007f411f7a0000)
libz.so.1 =3D> /lib/x86_64-linux-gnu/libz.so.1
(0x00007f411f584000)
libutil.so.1 =3D> /lib/x86_64-linux-gnu/libutil.so.1
(0x00007f411f381000)
/lib64/ld-linux-x86-64.so.2 (0x000055857b9dd000)
I did verify it's compiling with -g
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g
-fdebug-prefix-map=3D/build/python3.5-MLq5fN/python3.5-3.5.3=3D=
.
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
-fstack-protector-strong -Wformat -Werror=3Dformat-security
-Wdate-time
-D_FORTIFY_SOURCE=3D2 -fPIC -g -D_java_generics -DJCC_VER=3D"3=
.0"
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -I_jcc3
-Ijcc3/sources
-I/usr/include/python3.5m
-I/home/joshua/unnaturalcode/venv3/include/python3.5m -c
_jcc3/java/lang/String.cpp -o
build/temp.linux-x86_64-3.5/_jcc3/java/lang/String.o -DPYTHON
-fno-strict-aliasing -Wno-write-strings -O0 -g -DDEBUG
But it's still producing
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47eb2b4 in ?? ()
(gdb) bt
#0 0x00007fffe47eb2b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47eb160 in ?? ()
#3 0x00007fffffffc840 in ?? ()
#4 0x00007fffffffc7e0 in ?? ()
#5 0x00007ffff6006075 in VM_Version::get_processor_features()=
()
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
from
=
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so=
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt=
stack?)
a>
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the buil=
d
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
command.
You
should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk=
=
Post by Joshua Campbell
Post by Andi Vajda
and
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
got the
same result.
But you should get a better stacktrace ?
Post by Andi Vajda
Post by Andi Vajda
Is the version of java used here the same as during jcc bui=
ld
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Did you verify this via running 'ldd' on the shared libraries=
involved ?
That being said, it could be something different of course !
Andi..
rg>
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
On Jul 5, 2017, at 18:25, Joshua Campbell =
This segfault appears to occur within the JVM code on both=
oracle-java8-jdk
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging =
symbols
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug thi=
s =
Post by Joshua Campbell
Post by Andi Vajda
any
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
further.
virtualenv -p
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
python3
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in
/home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in
/home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
venv3/bin/activate
/home/joshua/unnaturalcode/venv3/bin/python
--no-cache-dir
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=
=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=
=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=
=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=E2=96=88=
=E2=96=88=E2=96=88| 184kB 3.4MB/s
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the buil=
d
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
command.
You
should then have symbols visible to gdb.
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc bui=
ld
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
time ?
Andi..
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 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
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
it.
There is NO WARRANTY, to the extent permitted by law. Typ=
e
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
"show
copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources onli=
ne =
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to =
"word"...
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2=
4b81b90e.debug...done.
done.
(gdb) r
Starting program: =
/home/joshua/unnaturalcode/venv3/bin/python -m
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
jcc
--jar
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64=
/
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
jre/lib/amd64/server/
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64=
/
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
jre/lib/amd64/server/
libjvm.so-gdb.py", line 66, in Types
nmethodp_t =3D gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in =
VM_Version::get_processor_features()
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Backtrace stopped: previous frame inner to this frame =
(corrupt
Post by Joshua Campbell
Post by Andi Vajda
Post by Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
Joshua Campbell
2017-07-07 18:57:13 UTC
Permalink
Hello friends. I tracked down the problem and attached my results to
the relevant bug report. The issue is caused by using kernels after
the patches for CVE-2017-1000364. It can be worked around in a variety
of different ways until the problem is fixed in the kernel or JVM. You
can disable CVE-2017-1000364 protection with a kernel argument I think
that might work. JCC can use more stack before calling JNI_initVM,
that should also work.

HERE IS THE EXPLANATION OF WHAT IS HAPPENING:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865303&archived=False&mbox=no#235
Post by Joshua Campbell
Okay so. I built GDB 8 from source (it's new) and that doesn't have bug.
Ok TO BE CLEAR, I am closer to the TRUTH than ever. Not only am I not
stopping, I am working harder. Updates when available. Stay tuned!
It turns out the JVM is crashing on the line commented with "//
Generate SEGV" so something about Python/JNI/JCC is intefering with
the JVM's signal handler, as this SEGV is intentional!
Post by Joshua Campbell
How would they break oracle's though. It's a binary.
Post by Andi Vajda
Post by Joshua Campbell
I confirmed that it crashes on multiple Debian 9 machines but it
doesn't crash on Ubuntu 16.04. This behavior is consistent regardless
of the JDK used (I tried openjdk 8, oracle 8 and openjdk 9). I am at a
loss for how to track it down further due to the (apparent) GDB bug.
Hmmm, maybe JNI is broken on Debian 9 ?
Andi..
Post by Joshua Campbell
Post by Joshua Campbell
No, it segfaults.
Post by Andi Vajda
Post by Joshua Campbell
It's occuring after JCC calls JNI_CreateJavaVM
cpp.py(529): env = initVM(os.pathsep.join(classpath) or None,
**initvm_args)
^^^^^ last python trace before death
Breakpoint 5, initVM (self=0x7ffff7e05048, args=0x7ffff66deac8,
kwds=0x7ffff7e00ec8) at jcc3/sources/jcc.cpp:527
527 if (JNI_CreateJavaVM(&vm, (void **) &vm_env, &vm_args) < 0)
^^^^ last line of jcc.cpp before death
(gdb) step
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe43942b4 in ?? ()
(gdb)
AFTER fixing debians debugging symbols with ln -s
/usr/lib/debug/usr/lib/jvm/java-8-openjdk-amd64
/usr/lib/debug/usr/lib/jvm/java-1.8.0-openjdk-amd64
Breakpoint 1, JNI_CreateJavaVM (vm=0x7fffffffc420,
penv=0x7fffffffc418,
args=0x7fffffffc450) at
./src/hotspot/src/share/vm/prims/jni.cpp:5161
5161 ./src/hotspot/src/share/vm/prims/jni.cpp: No such file or directory.
(gdb) s
JNI_CreateJavaVM (vm=0x7fffffffc420, penv=0x7fffffffc418,
args=0x7fffffffc450)
at ./src/hotspot/src/share/vm/prims/jni.cpp:5163
5163 in ./src/hotspot/src/share/vm/prims/jni.cpp
(gdb)
void inline_frame_this_id(frame_info*, void**, frame_id*): Assertion
`frame_id_p (*this_id)' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
<http://www.gnu.org/software/gdb/bugs/>.
What in the name of heck
Does it run without gdb ?
Andi..
Post by Joshua Campbell
On Wed, Jul 5, 2017 at 11:48 AM, Joshua Campbell
Post by Joshua Campbell
Post by Andi Vajda
But you should get a better stacktrace ?
I got the exact same stacktrace.
$ ldd
venv3/lib/python3.5/site-packages/JCC-3.0-py3.5-linux-x86_64.egg/libjcc3.so
linux-vdso.so.1 (0x00007ffcf4eb8000)
libjava.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libjava.so
(0x00007f412227f000)
libjvm.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
(0x00007f412133d000)
libpython3.5m.so.1.0 =>
/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f4120c3a000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
(0x00007f41208b8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
(0x00007f41205b4000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
(0x00007f412039b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
(0x00007f412017e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
(0x00007f411fddf000)
libverify.so =>
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/libverify.so
(0x00007f411fbce000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2
(0x00007f411f9ca000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1
(0x00007f411f7a0000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1
(0x00007f411f584000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1
(0x00007f411f381000)
/lib64/ld-linux-x86-64.so.2 (0x000055857b9dd000)
I did verify it's compiling with -g
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -g
-fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2 -fPIC -g -D_java_generics -DJCC_VER="3.0"
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include
-I/usr/lib/jvm/java-1.8.0-openjdk-amd64/include/linux -I_jcc3
-Ijcc3/sources
-I/usr/include/python3.5m
-I/home/joshua/unnaturalcode/venv3/include/python3.5m -c
_jcc3/java/lang/String.cpp -o
build/temp.linux-x86_64-3.5/_jcc3/java/lang/String.o -DPYTHON
-fno-strict-aliasing -Wno-write-strings -O0 -g -DDEBUG
But it's still producing
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47eb2b4 in ?? ()
(gdb) bt
#0 0x00007fffe47eb2b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47eb160 in ?? ()
#3 0x00007fffffffc840 in ?? ()
#4 0x00007fffffffc7e0 in ?? ()
#5 0x00007ffff6006075 in VM_Version::get_processor_features() ()
from
/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/server/libjvm.so
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Post by Andi Vajda
Post by Andi Vajda
Post by Andi Vajda
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command.
You
should then have symbols visible to gdb.
You mean with setup.py build --debug ? I tried that on trunk and
got the
same result.
But you should get a better stacktrace ?
Post by Andi Vajda
Post by Andi Vajda
Is the version of java used here the same as during jcc build time ?
Yes I made sure of that and uninstalled all but openjdk and rebuilt.
Did you verify this via running 'ldd' on the shared libraries involved ?
That being said, it could be something different of course !
Andi..
Post by Andi Vajda
Post by Andi Vajda
Post by Joshua Campbell
This segfault appears to occur within the JVM code on both
oracle-java8-jdk
Post by Joshua Campbell
and
java-1.8.0-openjdk-amd64. I installed the JVM debugging symbols
but it
didn't seem to help.
Occurs under python 2 and 3. I don't know how to debug this any
further.
python3
venv3 Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in
/home/joshua/unnaturalcode/venv3/bin/python3
Also creating executable in
/home/joshua/unnaturalcode/venv3/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
venv3/bin/activate
/home/joshua/unnaturalcode/venv3/bin/python
--no-cache-dir
Collecting jcc
Downloading JCC-3.0.tar.gz (176kB)
100% |████████████████████████████████| 184kB 3.4MB/s
Installing collected packages: jcc
Running setup.py install for jcc ... done
What version if java is this jcc built with ?
To build jcc for debugging with gcc add --debug to the build command.
You
should then have symbols visible to gdb.
Post by Joshua Campbell
Successfully installed jcc-3.0
/home/joshua/unnaturalcode/venv3/bin/python -m jcc --jar
Is the version of java used here the same as during jcc build time ?
Andi..
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.
html
Post by Joshua Campbell
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"
Post by Joshua Campbell
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
<http://www.gnu.org/software/gdb/bugs/>.
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /home/joshua/unnaturalcode/
venv3/bin/python...Reading
Post by Joshua Campbell
symbols from
/usr/lib/debug/.build-id/db/fc2e1a3c58b6d241b3f9af7b2fb3a2
4b81b90e.debug...done.
Post by Joshua Campbell
done.
(gdb) r
Starting program: /home/joshua/unnaturalcode/venv3/bin/python -m
jcc
--jar
Post by Joshua Campbell
java/lex-java/target/lex-java-1.0-SNAPSHOT.jar
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/
libthread_db.so.1".
Post by Joshua Campbell
Installing openjdk unwinder
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 52, in <module>
File
"/usr/share/gdb/auto-load/usr/lib/jvm/java-8-openjdk-amd64/
jre/lib/amd64/server/
Post by Joshua Campbell
libjvm.so-gdb.py", line 66, in Types
nmethodp_t = gdb.lookup_type('nmethod').pointer()
gdb.error: No type named nmethod.
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe47f22b4 in ?? ()
(gdb) bt
#0 0x00007fffe47f22b4 in ?? ()
#1 0x0000000000000246 in ?? ()
#2 0x00007fffe47f2160 in ?? ()
#3 0x00007fffffffc8c0 in ?? ()
#4 0x00007fffffffc860 in ?? ()
#5 0x00007ffff600d075 in VM_Version::get_processor_features() ()
from /usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/lib/amd64/
server/libjvm.so
Post by Joshua Campbell
Backtrace stopped: previous frame inner to this frame (corrupt
stack?)
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
--
Joshua Charles Campbell
Ph.D. Student and Research Assistant
Department of Computing Science
University of Alberta
***@ualberta.ca
Loading...