[Mesa-dev] [Bug 108933] Unreal Tournament (UT99) segfault on opengl init

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Dec 9 01:51:55 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=108933

--- Comment #12 from Gustaw Smolarczyk <wielkiegie at gmail.com> ---
(In reply to iive from comment #10)
> You solved the mystery!
> 
> It makes sense since this is the last called function in the disassembly.
> 
> I can confirm that the issue does go away after changing the string
> "__dynamic_cast" to "__dynamicZcast" in Core.so .
> 
> Can you recommend a more clean way to remove that?

As you have already found, that doesn't work unless the symbol is unused.

You could try patching all of the binaries that reference __dynamic_cast, but I
can't promise it would work correctly in the end.

> How about versioning __dynamic_cast?
> If it behaves differently in different version...

That's a question for libstdc++ developers. It's possible that UT was
statically linked against libstdc++.so.5 which is completely incompatible with
libstdc++.so.6 that is used today. If it wasn't, that might imply there is some
kind of a bug in compatibility between different libstdc++.so.6 versions. Also,
I recall there being strange stuff going on with RTTI and static libstdc++
(like dynamic casts not working correctly across libraries), though I don't
think they would end up with a crash...

> Another solution might be linking Mesa plugins statically to the g++
> listdc++. I'm not sure if this is supported atm. It would have been very
> useful when Steam used older version.

Right, but I don't think it's currently supported. It would increase the disk
and memory usage for everything that uses mesa. You would also need to do the
same for LLVM, unless you use a driver that doesn't need it (like i965).

Maybe just adding -static-libstdc++ to the linker options would suffice. It is
currently used for scons on Windows build.

> Mesa3D is mostly written in C. There are few parts in C++ and it seems that
> the files I've patched are the only ones using "iostream". Since iostream is
> used only for debugging, it is feasible to disable it on release builds.

<iostream> might not be the only include that you need to be wary about. It
might be that any ios thing is dangerous, like fstream.

Making mesa compatible with applications that link statically against any
libstdc++ might be desirable, but that needs to be discussed. You might want to
send your patch to the mailing list [1] if you want to trigger the discussion.

> But as I've said before, I don't know what LLVM compiled with latest
> libstdc++ would do.

I believe recent libstdc++ versions are compatible with each other. Moreover, I
think LLVM is 99% of the time linked against /usr/lib/libstdc++.so.6, so it
will use the most recent version all the time, even if it was compiled with an
older version.

On a slightly unrelated topic, UT99 seems to work fine (at least for me) while
run on wine (or Steam's proton). You might want to try this path as a
work-around.

[1] https://www.mesa3d.org/submittingpatches.html

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181209/c2e58585/attachment.html>


More information about the mesa-dev mailing list