Bug 1858054 - mp fails to build with java-11-openjdk
Summary: mp fails to build with java-11-openjdk
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: mp
Version: 33
Hardware: All
OS: All
unspecified
high
Target Milestone: ---
Assignee: Paulo Andrade
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1859925
Blocks: Java11
TreeView+ depends on / blocked
 
Reported: 2020-07-16 21:13 UTC by jiri vanek
Modified: 2021-11-30 17:43 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-30 17:43:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description jiri vanek 2020-07-16 21:13:28 UTC
mp fails to build with java-11-openjdk as sytem JDK. See https://fedoraproject.org/wiki/Changes/Java11 .
See especially part about known failures: https://fedoraproject.org/wiki/Changes/Java11#common_issues_packagers_can_face_and_gathered_solutions

For the build logs, see: https://koji.fedoraproject.org/koji/taskinfo?taskID=47159657
We run the rebuild longer then 10days ago. Log may be gone. Also your package may be passing in regular rawhide.
To reproduce, simply: fedpkg clone mp; cd mp;  fedpkg build --target f33-java11; #The target is crucial.

We run two reruns your package failed both.

Surprisingly, your package is passing in our initial copr - https://copr.fedorainfracloud.org/coprs/jvanek/java11/package/mp
That usually mean that it is jdk11 independent error, or platform (non-intel) specific failure.  Good luck.
              

We had tried 650 packages, and 500 had passed, so the java-11-openjdk will be system JDK in f33, and you should fix your package if you want to keep it alive. Usually the fix is simple, and best is to update the package to latest upstream version.
There will be usual mass rebuild once f33 branches. You may got another FTBFS bug.
Let us know here if you have any questions, here in bug, or at java-devel.org .

We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side if needed.

Comment 1 jiri vanek 2020-07-17 04:00:00 UTC
highlight: This was rebuild in sidetag f33-java11. Thus --target is really necessary to reproduce failure.
please note: This side tag, f33-java11, will be merged to main f33 buildroot in aprox 14 days.

Comment 2 Ben Cotton 2020-08-11 15:24:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle.
Changing version to 33.

Comment 3 Jerry James 2021-01-14 22:10:07 UTC
There is a gecode packaging bug that prevents building mp.  I've fixed that locally and will submit a pull request shortly.  I'm looking at the jacop-related error now.  The jacop tests all run successfully.  The crash occurs at test suite take-down time.  Here's a backtrace generated after relinking jacop-test against the slowdebug libraries:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#1  0x00007f951a79d8a4 in __GI_abort () at abort.c:79
#2  0x00007f951bd87a57 in os::abort (dump_core=true, siginfo=0x7fff9b8c2eb0, 
    context=0x7fff9b8c2d80)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/os/linux/os_linux.cpp:1502
#3  0x00007f951c0fe7fc in VMError::report_and_die (id=11, message=0x0, 
    detail_fmt=0x7f951c806ac1 "%s", detail_args=0x7fff9b8c2a40, 
    thread=0x55e5364f0000, pc=
    0x7f951a5c5dfb <ImageStrings::find(Endian*, char const*, int*, unsigned int)+115> "\213\020H\213E\350\211\326H\211\307\377\321\211E\374\203}\374", 
    siginfo=0x7fff9b8c2eb0, context=0x7fff9b8c2d80, filename=0x0, lineno=0, 
    size=0)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/utilities/vmError.cpp:1603
#4  0x00007f951c0fd6fb in VMError::report_and_die (thread=0x55e5364f0000, 
    sig=11, 
    pc=0x7f951a5c5dfb <ImageStrings::find(Endian*, char const*, int*, unsigned int)+115> "\213\020H\213E\350\211\326H\211\307\377\321\211E\374\203}\374", 
    siginfo=0x7fff9b8c2eb0, context=0x7fff9b8c2d80, 
    detail_fmt=0x7f951c806ac1 "%s")
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/utilities/vmError.cpp:1270
#5  0x00007f951c0fd776 in VMError::report_and_die (thread=0x55e5364f0000, 
    sig=11, 
    pc=0x7f951a5c5dfb <ImageStrings::find(Endian*, char const*, int*, unsigned int)+115> "\213\020H\213E\350\211\326H\211\307\377\321\211E\374\203}\374", 
    siginfo=0x7fff9b8c2eb0, context=0x7fff9b8c2d80)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/utilities/vmError.cpp:1276
#6  0x00007f951bd97b99 in JVM_handle_linux_signal (sig=11, 
    info=0x7fff9b8c2eb0, ucVoid=0x7fff9b8c2d80, abort_if_unrecognized=1)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp:616
#7  0x00007f951bd904f4 in signalHandler (sig=11, info=0x7fff9b8c2eb0, 
    uc=0x7fff9b8c2d80)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/os/linux/os_linux.cpp:4684
#8  <signal handler called>
#9  ImageStrings::find (endian=0x7f951a5ce028 <NativeEndian::_native>, 
    name=0x7fff9b8c3560 "//java/lang/Shutdown.class", redirect=0x7f9511e6501c, 
    length=33809)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/java.base/share/native/libjimage/imageFile.cpp:88
#10 0x00007f951a5c7103 in ImageFileReader::find_location_index (
    this=0x55e5364e1700, path=0x7fff9b8c3560 "//java/lang/Shutdown.class", 
    size=0x7fff9b8c45a0)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/java.base/share/native/libjimage/imageFile.cpp:467
#11 0x00007f951a5c83c7 in JIMAGE_FindResource (image=0x55e5364e1700, 
    module_name=0x7f951c2ffe50 "", 
    version=0x7f951cee7b40 <get_jimage_version_string()::version_string> "11.0",
    name=0x55e5364ee570 "java/lang/Shutdown.class", size=0x7fff9b8c45a0)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/java.base/share/native/libjimage/jimage.cpp:139
#12 0x00007f951b425b16 in ClassPathImageEntry::open_stream (
    this=0x55e5364fe3f0, name=0x55e5364ee570 "java/lang/Shutdown.class", 
    __the_thread__=0x55e5364f0000)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/classfile/classLoader.cpp:490
#13 0x00007f951b429e31 in ClassLoader::load_class (name=0x7f94f4101430, 
    search_append_only=false, __the_thread__=0x55e5364f0000)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/classfile/classLoader.cpp:1462
#14 0x00007f951c01f9ae in SystemDictionary::load_instance_class (
    class_name=0x7f94f4101430, class_loader=..., __the_thread__=0x55e5364f0000)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/classfile/systemDictionary.cpp:1476
#15 0x00007f951c01d377 in SystemDictionary::resolve_instance_class_or_null (
    name=0x7f94f4101430, class_loader=..., protection_domain=..., 
    __the_thread__=0x55e5364f0000)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/classfile/systemDictionary.cpp:822
#16 0x00007f951c01b84a in SystemDictionary::resolve_or_null (
    class_name=0x7f94f4101430, class_loader=..., protection_domain=..., 
    __the_thread__=0x55e5364f0000)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/classfile/systemDictionary.cpp:257
#17 0x00007f951c01b8c3 in SystemDictionary::resolve_or_null (
    class_name=0x7f94f4101430, __the_thread__=0x55e5364f0000)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/classfile/systemDictionary.cpp:262
#18 0x00007f951c067182 in JavaThread::invoke_shutdown_hooks (
    this=0x55e5364f0000)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/runtime/thread.cpp:4233
#19 0x00007f951c06731b in Threads::destroy_vm ()
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/runtime/thread.cpp:4314
#20 0x00007f951b96c7da in jni_DestroyJavaVM_inner (vm=0x7f951ce623f0 <main_vm>)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/prims/jni.cpp:4116
#21 0x00007f951b96c85f in jni_DestroyJavaVM (vm=0x7f951ce623f0 <main_vm>)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/hotspot/share/prims/jni.cpp:4134
#22 0x000055e535b1eb46 in JavaVM_::DestroyJavaVM (this=<optimized out>)
    at /usr/lib/jvm/java/include/jni.h:1922
#23 mp::JVM::~JVM (this=<optimized out>, this=<optimized out>)
    at /builddir/build/BUILD/mp-7fd4828c934fccf7367499c9e01cc9a1e90a2093/solvers/jacop/java.cc:190
#24 0x00007f951a7b6ac7 in __run_exit_handlers (status=0, 
    listp=0x7f951a93b598 <__exit_funcs>, 
    run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true)
    at exit.c:108
#25 0x00007f951a7b6c70 in __GI_exit (status=<optimized out>) at exit.c:139
#26 0x00007f951a79eb6c in __libc_start_main (main=
    0x55e535abe050 <main(int, char**)>, argc=1, argv=0x7fff9b8c5038, 
    init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fff9b8c5028) at ../csu/libc-start.c:355
#27 0x000055e535abfede in _start () at /usr/include/c++/11/bits/allocator.h:162

A little debugging:

(gdb) frame 9
#9  ImageStrings::find (endian=0x7f951a5ce028 <NativeEndian::_native>, 
    name=0x7fff9b8c3560 "//java/lang/Shutdown.class", redirect=0x7f9511e6501c, 
    length=33809)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/java.base/share/native/libjimage/imageFile.cpp:88
88	    s4 value = endian->get(redirect[index]);
(gdb) print redirect
$1 = (s4 *) 0x7f9511e6501c
(gdb) print index
$2 = 30990
(gdb) print redirect[index]
Cannot access memory at address 0x7f9511e83454
(gdb) print length
$3 = 33809
(gdb) up
#10 0x00007f951a5c7103 in ImageFileReader::find_location_index (
    this=0x55e5364e1700, path=0x7fff9b8c3560 "//java/lang/Shutdown.class", 
    size=0x7fff9b8c45a0)
    at /usr/src/debug/java-11-openjdk-11.0.10.0.1-0.0.ea.fc34.x86_64/openjdk/src/java.base/share/native/libjimage/imageFile.cpp:467
467	    s4 index = ImageStrings::find(_endian, path, _redirect_table, table_length());
(gdb) print *this
$4 = {static _reader_table = {static _growth = 8, _count = 1, _max = 8, 
    _table = 0x55e5364e16b0}, static memory_map_image = true, 
  _name = 0x55e5364e1 <error: Cannot access memory at address 0x55e5364e1>, 
  _use = 910880783, _fd = 21989, 
  _endian = 0x7f951a5ce028 <NativeEndian::_native>, _file_size = 141937687, 
  _header = {_magic = 3405699802, _version = 65536, _flags = 0, 
    _resource_count = 33809, _table_length = 33809, _locations_size = 702019, 
    _strings_size = 768331}, _index_size = 1740850, _index_data = 0x0, 
  _redirect_table = 0x7f9511e6501c, _offsets_table = 0x7f9511e86060, 
  _location_bytes = 0x7f9511ea70a4 <error: Cannot access memory at address 0x7f9511ea70a4>, 
  _string_bytes = 0x7f9511f526e7 <error: Cannot access memory at address 0x7f9511f526e7>, module_data = 0x55e5364e17e0}

Comment 4 Jerry James 2021-01-15 18:05:27 UTC
Valgrind revealed what is going on.  In solvers/jacop/java.h, there is a class named JVM which contains a JavaVM pointer (jvm_) and an environment (env_).  There is also a static instance of this class, named instance_, which is initialized on the fly when it is first accessed.  The JVM destructor is in solvers/jacop/java.cc:

JVM::~JVM() {
  if (jvm_)
    jvm_->DestroyJavaVM();
}

After the jacop tests have run, the test program exits.  This triggers execution of destructors for static and global objects.  At some point, the ImageFileReaderTable destructor is run.  This is an object in OpenJDK's libjimage.so.  **After that**, the destructor for the static instance_ object is run, which results in a call to DestroyJavaVM(), which then runs through the sequence of calls shown in comment 3, culminating in accesses to the already destroyed ImageFileReaderTable.

Comment 5 Jerry James 2021-01-15 22:13:40 UTC
I've checked a patch into git that works around the destructor order problem.  I'll bring the issue up with upstream.  They'll likely want to fix it differently, but the patch will at least be a starting point for discussion.  I have not kicked off a Rawhide build, because the gecode headers are still broken.  Pull request to fix that issue:

https://src.fedoraproject.org/rpms/gecode/pull-request/3

Comment 6 Jerry James 2021-01-15 22:29:39 UTC
Discussion of the issue with upstream: https://github.com/ampl/mp/pull/133

Comment 7 Ben Cotton 2021-11-04 16:18:15 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 8 Ben Cotton 2021-11-30 17:43:15 UTC
Fedora 33 changed to end-of-life (EOL) status on 2021-11-30. Fedora 33 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.