Stop linking gccpp outside Windows (fixes silent Vulkan render failure with lavapipe) - #644
Open
charlesstaats wants to merge 2 commits into
Open
charlesstaats wants to merge 2 commits into
charlesstaats wants to merge 2 commits into
Conversation
gccpp replaces the global operator new/delete, and on ELF platforms that replacement also applies to dlopened libraries. When Vulkan export uses lavapipe, LLVM allocates on lavapipe's own threads, which the GC doesn't know about. When one of those allocations triggers a collection, bdwgc aborts with "Collecting from unknown thread". This happens in the forked render child, so asy still exits 0 but writes no image. The autotools build has never linked gccpp against the bundled gc, and asy keeps its GC pointers in gc-allocated memory (mem:: containers, gc_allocator). Windows keeps gccpp, because replacing operator new there does not reach other DLLs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AC_CHECK_LIB([gccpp],[GC_throw_bad_alloc]) looks for a C-linkage symbol, but bdwgc declares GC_throw_bad_alloc with C++ linkage, so libgccpp only exports the mangled name and the probe never succeeds. GCPPLIB was never assigned, so GCLIBS was just GCLIB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: Stop linking gccpp outside Windows (fixes silent Vulkan render failure with lavapipe)
On Linux, the CMake build linked bdwgc's
gccpp, which replaces the globaloperator new/deletefor the whole process, including libraries loaded withdlopen. With Mesa's lavapipe (CPU Vulkan), LLVM allocates on lavapipe's own threads, which the GC doesn't know about. When one of those allocations triggers a collection, bdwgc aborts with "Collecting from unknown thread". The crash happens in the forked render child, soasystill exits 0 and simply writes no image.gccpponly on Windows, where replacingoperator newdoesn't reach other DLLs. This matches the autotools build, which stopped linking the bundledlibgccpp.ain 2007; asy keeps its GC pointers in gc-allocated memory (mem::containers,gc_allocator).AC_CHECK_LIB([gccpp],[GC_throw_bad_alloc])probes. They look for a C-linkage symbol, but bdwgc declaresGC_throw_bad_allocwith C++ linkage, so the library exports only the mangled name and the probes cannot succeed (confirmed against Debian'slibgccpp). Also removeGCPPLIB, which was never assigned.Testing (Debian trixie, lavapipe, no
GC_DONT_GC):linux/release): ctest 7/7 passed. Teapot and cube render at-render=4. 35 of 40 3D examples render; four stop on missing LaTeX packages, andBezierSurfacewriteslabel.pngbecause of itsembed("label", …)../autogen.sh && ./configuretakes the Vulkan branch, andmake asyandmake checkpass. The teapot renders throughlibasyvulkan.so, lavapipe and LLVM.🤖 Generated with Claude Code