openjdk 1.8 hung in graphene-sgx

29 views
Skip to first unread message

Shen, Yuchen

unread,
Aug 24, 2021, 1:51:01 AM8/24/21
to sup...@graphene-project.io

Dear Graphene Team,

 

I was trying to run a HelloWorld program written in java with openjdk1.8 in graphene-sgx, It seemed the jvm hung.

The program did not generate any more lines for a very long while (> 2 hours). The last lines in graphene’s log file showed:

 

[P167998::] debug: Mounting special proc filesystem: /proc

[P167998::] debug: Mounting special dev filesystem: /dev

[P167998::] debug: Mounting terminal device /dev/tty under /dev

[P167998::] debug: Mounting special sys filesystem: /sys

[P167998:T1:] debug: Mounting as chroot filesystem: from file:/w/demo/jdk to /jdk

[P167998:T1:] debug: Mounting as chroot filesystem: from file:/w/demo/install/lib/x86_64-linux-gnu/graphene/runtime/glibc to /lib

[P167998:T1:] debug: Mounting as chroot filesystem: from file:/usr/lib64 to /lib64

[P167998:T1:java] debug: Allocating stack at 0x0 (size = 262144)

[P167998:T1:java] debug: loading "file:/w/demo/jdk/bin/java"

[P167998:T1:java] debug: execute_loadcmd: failed to map segment

 

It might be notable that, if graphene-direct, instead of graphene-sgx, was used, the jdk worked well.

Moreover, when I switch oepnjdk to oracle jdk, with exactly the same manifest file and graphene-sgx binary, the demo finished with no problem.

 

The graphene installation was a manually built release version. The code version was v1.2-rc1. Regression tests (w/ SGX=1) looked fine.

The kernel version was 5.13.0 and it was also manually built with in-kernel SGX support.

All the tests were carried out by the privileged user.

 

The manifest file (java.manifest) and the graphene log (demo.log) are attached to this email.

Some other details about my test environment are as following:

 

Graphene version:

v1.2-rc1

 

Kernel version:

Linux icx-04 5.13.0 #1 SMP Fri Jul 2 10:32:32 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

 

OS version:

NAME="Ubuntu"

VERSION="20.04.2 LTS (Focal Fossa)"

ID=ubuntu

ID_LIKE=debian

PRETTY_NAME="Ubuntu 20.04.2 LTS"

VERSION_ID="20.04"

HOME_URL="https://www.ubuntu.com/"

SUPPORT_URL="https://help.ubuntu.com/"

BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"

PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"

VERSION_CODENAME=focal

UBUNTU_CODENAME=focal

 

JDK version:

openjdk version "1.8.0_41"

OpenJDK Runtime Environment (build 1.8.0_41-b04)

OpenJDK 64-Bit Server VM (build 25.40-b25, mixed mode)

 

Does anyone have a clue? Or should I supply more info? Any suggestions are appreciated.

 

All the best,

Shen Yu-Chen

 

java.manifest
demo.log

Michał Kowalczyk

unread,
Aug 24, 2021, 7:33:19 PM8/24/21
to Shen, Yuchen, sup...@graphene-project.io
Hey,

"execute_loadcmd: failed to map segment" means that Graphene failed very early, at loading the `java` binary - one of its segments couldn't be mapped to memory. I don't have this binary, but I'd guess that it's non-PIE? Could you try adding `sgx.nonpie_binary = true` to your manifest? If this fails, could you share output of `readelf -l java`?

Best,
Michał
--
You received this message because you are subscribed to the Google Groups "Graphene Support Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to graphene-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/graphene-support/CO6PR11MB5604A0939495D70AC32C9613FDC59%40CO6PR11MB5604.namprd11.prod.outlook.com.


Shen, Yuchen

unread,
Aug 24, 2021, 9:24:40 PM8/24/21
to Kowalczyk, Michal, sup...@graphene-project.io

Hi Michał,

 

Thank you very much for your prompt reply and your advice.

`sgx.nonpie_binary = true` solved my problem.

 

All the best,

Shen Yu-Chen

 

Michał Kowalczyk

unread,
Aug 25, 2021, 5:08:50 AM8/25/21
to Shen, Yuchen, sup...@graphene-project.io
Reply all
Reply to author
Forward
0 new messages