eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.28k stars 721 forks source link

JVM_SocketShutdown() stubbed #3442

Closed planetf1 closed 6 years ago

planetf1 commented 6 years ago

When attempting to build github.com/odpi/egeria under J9 192 b12 (from adoptopenjdk.net) on MacOPS Mojave under Intellij IDEA & using maven 3.5.4 I get an exception

Assertion failed: (!"JVM_SocketShutdown() stubbed!"), function JVM_SocketShutdown, file j7vmi.c, line 2375. JVMDUMP039I Processing dump event "abort", detail "" at 2018/10/25 08:15:25 - please wait. JVMDUMP032I JVM requested System dump using '/Users/jonesn/java/jdk8u192-b12/Contents/Home/bin/core.20181025.081525.44173.0001.dmp' in response to an event

See also #3441 where the same code/IDE fails on windows, but with a slightly different exception

planetf1 commented 6 years ago

javacore.20181025.081435.44159.0002.txt

planetf1 commented 6 years ago

See also https://github.com/AdoptOpenJDK/openjdk-build/issues/683#issuecomment-432615199 - work on this build is still in-progress at adoptopenjdk, so it could be build related, but it was intriguing that windows also fails in a similar way. This does not occur with hotspot builds

pdbain-ibm commented 6 years ago

@planetf1 do you have a stack trace or javacore?

planetf1 commented 6 years ago

Hi - I posted the javacore TXT file above. I have the full core too if it helps, but it is 2.6GB. I didn't even try attaching ;-) I could transfer it somewhere if it helps?

planetf1 commented 6 years ago

Looking at the code, wonder if J9UNIX should be set for MacOS?

babsingh commented 6 years ago

The fix will be to enable J9UNIX on OSX in jvm.h and vmargs.c.

#if defined(RS6000) || defined(LINUX) || defined(OSX)
#define J9UNIX
#endif /* defined(RS6000) || defined(LINUX) || defined(OSX) */
babsingh commented 6 years ago

Currently, defined(J9UNIX) || defined(OSX) is used at a lot of places. [inconsistencies] We have missed to add defined(OSX) at some defined(J9UNIX) locations. It will be cleaner to enable J9UNIX for OSX instead of using defined(J9UNIX) || defined(OSX) everywhere. @pshipton @pdbain-ibm thoughts?

pdbain-ibm commented 6 years ago

Since OSX is derived from BSD Unix I suggest we do so.

babsingh commented 6 years ago

At some places, J9UNIX code doesn't apply to OSX. With this revelation, it won't be straight forward to enable J9UNIX on OSX. Someone will have to look at all J9UNIX locations and evaluate if that piece of code is needed for OSX.

Example -jvm.c::JVM_SetLength

#elif defined(J9UNIX) && !defined(J9ZTPF)
    result = ftruncate64(fd, length);
#elif defined(J9ZOS390) || defined(J9ZTPF) || defined(OSX)
    result = ftruncate(fd, length);

Another case - in jvm.c::JVM_Available, stat is used on OSX whereas stat64 is used on J9UNIX.

#if defined(J9UNIX) && !defined(J9ZTPF)
        struct stat64 tempStat;
#endif
#if defined(J9ZOS390) || defined(J9ZTPF) || defined(OSX)
        struct stat tempStat;

There may be more places where J9UNIX code doesn't apply to OSX. We need to be careful.

pshipton commented 6 years ago

Although there are only 34 places where J9UNIX is used, and fewer that don't already use OSX as well. It would be worth looking at the remaining places to see if OSX needs to be added.

gacholio commented 6 years ago

Should OSX just define J9UNIX?

pdbain-ibm commented 6 years ago

I concur with @gacholio . Personally, I would like OSX to imply J9UNIX. In cases where that is invalid, i.e. in which J9UNIX applies but need special treatment for OSX, we should handle that case explicitly.

babsingh commented 6 years ago

Moving discussion about J9UNIX usage to a new issue: https://github.com/eclipse/openj9/issues/3452.