Skip to content

fix: crash in exception handling after OSL JIT#2113

Merged
lgritz merged 1 commit intoAcademySoftwareFoundation:mainfrom
sergeyvfx:fix_eh_frame_crash
Apr 23, 2026
Merged

fix: crash in exception handling after OSL JIT#2113
lgritz merged 1 commit intoAcademySoftwareFoundation:mainfrom
sergeyvfx:fix_eh_frame_crash

Conversation

@sergeyvfx
Copy link
Copy Markdown
Contributor

This change fixes crashes that could be observed on Ubuntu 24.04. The crash happens in exception handling after rendering a scene with OSL shaders.

This seems to be a bug in libgcc which was fixed in 14.3, but Ubuntu 24.04 is shipped with 14.2. There is a report in the GCC bug tracker:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119151

Note that this is a runtime dependency, so it doesn't really matter that a different GCC version was using during compilation as the EH frames registration happens at runtime.

The easiest solution is to simply disable EH frames registration in OSL's MemoryManager. This should not affect any runtime exception unwinding as this MemoryManager is only used during JIT, so all the EH frames are unregistered from the process when the JIT code is actually executed.

The issue was originally noticed in Blender, here is the report with some extra investigation and details:

https://projects.blender.org/blender/blender/issues/156348

@sergeyvfx sergeyvfx force-pushed the fix_eh_frame_crash branch from ccfe328 to c29d692 Compare April 21, 2026 10:52
This change fixes crashes that could be observed on Ubuntu 24.04.
The crash happens in exception handling after rendering a scene
with OSL shaders.

This seems to be a bug in libgcc which was fixed in 14.3, but
Ubuntu 24.04 is shipped with 14.2. There is a report in the GCC
bug tracker:

  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119151

Note that this is a runtime dependency, so it doesn't really matter
that a different GCC version was using during compilation as the
EH frames registration happens at runtime.

The easiest solution is to simply disable EH frames registration
in OSL's MemoryManager. This should not affect any runtime exception
unwinding as this MemoryManager is only used during JIT, so all the
EH frames are unregistered from the process when the JIT code is
actually executed.

The issue was originally noticed in Blender, here is the report with
some extra investigation and details:

  https://projects.blender.org/blender/blender/issues/156348

Signed-off-by: Sergey Sharybin <sergey@blender.org>
@sergeyvfx sergeyvfx force-pushed the fix_eh_frame_crash branch from ce32486 to 96ef20f Compare April 21, 2026 12:44
Copy link
Copy Markdown
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I'm taking for granted that this fixes the problem on your end, it's not one I'd seen or reproduced.

@lgritz lgritz merged commit c3be3c6 into AcademySoftwareFoundation:main Apr 23, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants