Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 894768 - dev-java/openjdk:17 failed assertion with several java proprietary games
Summary: dev-java/openjdk:17 failed assertion with several java proprietary games
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-16 13:45 UTC by hoelbezier
Modified: 2024-03-07 12:32 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
game console output with LD_DEBUG=all (ld_debug_stuck.bz2,592.29 KB, application/x-bzip2)
2023-02-18 17:56 UTC, hoelbezier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hoelbezier 2023-02-16 13:45:23 UTC
Hi,

several proprietary java games fail to run with dev-java/openjdk:17 with the following error:

Inconsistency detected by ld.so: dl-lookup.c: 107: check_match: Assertion `version->filename == NULL || ! _dl_name_match_p (version->filename, map)' failed!

A list of such games can be found here:

- https://forge.dotslashplay.it/play.it/games/-/issues/880

The fix proposed on this link is to build OpenJDK17 without the --as-needed ld flag or equivalently with the --no-as-needed flag.

I have tested this locally and can confirm that it fixes the issue.

On Gentoo the --as-needed flag is set by the default/linux profile, so I expect every Gentoo user to be affected.

dev-java/openjdk-bin:17 is not affected by this issue as Eclipse Temurin already build OpenJDK without the --as-needed flag.

Thanks
Comment 1 Georgy Yakovlev archtester gentoo-dev 2023-02-17 08:07:31 UTC
Can you provide full error output with LD_DEBUG=all ?
export LD_DEBUG=all
Run your game from same shell.

This error comes from glibc/stdc++ and not from jdk it seems.
Not sure if passing -no-as-needed for source build is a good idea.
Temurin is built differently and they can do it, source version can have problems with it. Like being broken by dependency updates and being unable to rebuild itself.
Comment 2 hoelbezier 2023-02-18 17:56:13 UTC
Created attachment 852718 [details]
game console output with LD_DEBUG=all

Arf, this seems like the kind of bug that does not happen when someone is looking too much at it. ><

So, I’ve run the game after adding LD_DEBUG=all to its environment, and… it doesn’t crash. It doesn’t run either, it just hangs forever (I’ve let it hang for three hours, then I SIGINTed it).

I’m attaching the debug output, until the point where it hangs (there’s more output when I SIGINT it, but I guess it’s irrelevant). It’s compressed with bzip2 as the original text file is more than 24MB.
Comment 3 Georgy Yakovlev archtester gentoo-dev 2023-02-22 20:36:20 UTC
thanks for upload.
I'll check it but it's probably does not contain what I want, because bug is not reproduced with debug active...

I found a small reproducer on ubuntu bugtracker, will try to poke it.
but both debian and ubuntu refused to build with --no-as-needed for valid reasons.

it may be gcc/glibc/binutils bug after all, not jdk. need more investigation.
something fails looking up symbol of one of prebuilt libraries that are shipped with the game.



meanwhile please use -bin for those games.
did you know you can set java used per application?

you can still have openjdk set system-wide
and have openjdk-bin installed.


GENTOO_VM=openjdk-bin-17 java -jar blablabla.jar

it will run it with -bin.

you can edit .desktop file for that game too

Exec=env GENTOO_VM=openjdk-bin-17 ....

as long as game calls /usr/bin/java (it's a shell script) - it will use GENTOO_VM jdk.

list of jdks to use for GENTOO_VM
ls -1 /usr/lib/jvm/
Comment 4 hoelbezier 2023-07-08 09:50:53 UTC
Debian fixed the issue by linking with --no-as-needed[0].

One of Debian developpers also gave a pretty complete explanation of the reasons behind this assertion failure[1].

Hope this helps you in finding a solution to this issue.

[0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031521#34
[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1031521#29
Comment 5 Volkmar W. Pogatzki 2024-03-07 09:46:29 UTC
Since comment #4 of this bug report there were 2 new versions of openjdk:17 and the old is gone. 
Closing. Feel free to re-open should the errors persist.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-07 12:32:12 UTC
Do you have some small example we can try, ideally not proprietary?