Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2018 16:56:18 +0200
From:      Frederic Chardon <chardon.frederic@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Linux openjdk segfault
Message-ID:  <CAMODbk=OwTWVbEkGwCtmc9Ujfek9CgHLY=tHqAAVK+ib4m9Dbg@mail.gmail.com>

Next in thread | Raw E-Mail | Index | Archive | Help
Hi

I'm on recent current (r338418) trying to compile LineageOS 15.1 (an
Android ROM). linux_base-c7 is installed
linux and linux64 loaded
proc, fd, linprocfs and linsysfs mounted

I managed to get it to about 85%, but it fails during the following call:

java -Xms16M -Xmx2048M -jar
/android/LOS/out/host/linux-x86/framework/dx.jar --dex
--output=/android/LOS/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/with-local/
--min-sdk-version=27 --core-library
/android/LOS/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar

If I use FreeBSD openjdk8, this command works, however part of the earlier
build involves loading a linux library in the jvm, which fails with
FreeBSD's openjdk

With Ubuntu 16.04 openjdk I got several SIGSEGV.

% kdump | grep -A3 -B3 SIGSEGV

53182 java     RET   linux_mmap2 34422685696/0x803c08000
 53182 java     CALL
linux_mmap2(0x803c08000,0xa000,0x3,0x32,0xffffffffffffffff,0)
 53182 java     RET   linux_mmap2 34422685696/0x803c08000
 53182 java     PSIG  SIGSEGV caught handler=0x8026b8f40 mask=0x4
code=SEGV_MAPERR
 53182 java     CALL  linux_rt_sigreturn(0)
 53182 java     RET   linux_rt_sigreturn JUSTRETURN
 53182 java     CALL  linux_clock_gettime(0x1,0x80072a9d0)
--
 53182 java     CALL  linux_mprotect(0x800623000,0x1000,0x1)
 53182 java     RET   linux_mprotect 0
 53182 java     CALL  linux_mprotect(0x800623000,0x1000,0x3)
 53182 java     PSIG  SIGSEGV caught handler=0x8026b8f40 mask=0x4
code=<invalid=0xc>
 53182 java     RET   linux_mprotect 0
 53182 java     CALL  linux_mprotect(0x800622000,0x1000,0)
 53182 java     RET   linux_mprotect 0
--
 53182 java     CALL  linux_mprotect(0x800623000,0x1000,0x1)
 53182 java     CALL
linux_sys_futex(0x80400a854,0x80,0x8b,0,0x80400a800,0x45)
 53182 java     RET   linux_mprotect 0
 53182 java     PSIG  SIGSEGV caught handler=0x8026b8f40 mask=0x4
code=<invalid=0xc>
 53182 java     CALL  linux_sys_futex(0x8042b3d54,0x80,0x1,0,0x8042b3d00,0)
 53182 java     CALL  linux_mprotect(0x800623000,0x1000,0x3)
 53182 java     RET   linux_mprotect 0
--
 53182 java     RET   linux_clock_gettime 0
 53182 java     CALL  gettimeofday(0x800728a70,0)
 53182 java     RET   gettimeofday 0
 53182 java     PSIG  SIGSEGV caught handler=0x8026b8f40 mask=0x4
code=SEGV_MAPERR
 53182 java     CALL  gettimeofday(0x81a5c7510,0)
 53182 java     RET   gettimeofday 0
 53182 java     CALL  linux_clock_gettime(0x1,0x800729050)
--
 53182 java     RET   linux_clock_gettime 0
 53182 java     CALL  linux_mprotect(0x800623000,0x1000,0x1)
 53182 java     CALL
linux_sys_futex(0x80417c654,0x80,0x17b,0,0x80417c600,0xbd)
 53182 java     PSIG  SIGSEGV caught handler=0x8026b8f40 mask=0x4
code=<invalid=0xc>
 53182 java     RET   linux_mprotect 0
 53182 java     CALL  linux_mprotect(0x800623000,0x1000,0x3)
 53182 java     RET   linux_mprotect 0
--
 53182 java     RET   linux_clock_gettime 0
 53182 java     CALL  linux_mprotect(0x84c3ef000,0x25000,0x3)
 53182 java     RET   linux_mprotect 0
 53182 java     PSIG  SIGSEGV caught handler=0x8026b8f40 mask=0x4
code=SEGV_MAPERR
 53182 java     CALL  linux_clock_gettime(0x1,0x8007290e0)
 53182 java     RET   linux_clock_gettime 0
 53182 java     CALL  linux_rt_sigreturn(0)
--
 53182 java     CALL  linux_clock_gettime(0x1,0x81a5c7a00)
 53182 java     RET   linux_clock_gettime 0
 53182 java     CALL  linux_mprotect(0x84c414000,0xa000,0x3)
 53182 java     PSIG  SIGSEGV caught handler=0x8026b8f40 mask=0x4
code=SEGV_MAPERR
 53182 java     RET   linux_mprotect 0
 53182 java     CALL  linux_clock_gettime(0x1,0x800729060)
 53182 java     RET   linux_clock_gettime 0
--
 53182 java     RET   linux_clock_gettime 0
 53182 java     CALL  linux_clock_gettime(0x1,0x800729390)
 53182 java     RET   linux_clock_gettime 0
 53182 java     PSIG  SIGSEGV caught handler=0x8026b8f40 mask=0x4
code=<invalid=0x3>
 53182 java     CALL  linux_rt_sigprocmask(0x1,0x800729320,0,0x8)
 53182 java     RET   linux_rt_sigprocmask 0
 53182 java     CALL  linux_getcwd(0x802d449e0,0x7d0)

I thought it might be related to security.bsd.map_at_zero, but setting it
to 1 didn't change anything
I would appreciate some guidance

Thanks



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?CAMODbk=OwTWVbEkGwCtmc9Ujfek9CgHLY=tHqAAVK+ib4m9Dbg>