Skip to content

Intermittent crash in LLVM when used from OSL (Open Shading Language) in interactive use case (seemingly due to insufficient 32 bit relocation offsets?) #65641

@ZapAndersson

Description

@ZapAndersson

I reported this bug first as an OSL bug here: AcademySoftwareFoundation/OpenShadingLanguage#1712 but it seems the "bug" is in LLVM itself.

TL;DR - in a heavey interactive session when compiling OSL shaders while rendering high-resolution images, we sometimes, super-intermittently, seemingly randomly, end up crashing (= fatal error aborting) here:

image

Basically, whatever assumptions is being made of memory blocks being within 2Gb of each other, do not hold (probably cause other threads have been allocating multi-gigabyte chunks in the meantime).

This of course explains the intermittent behavior of the bug, and that it only happens while heavy things are happening concurrently in other threads (which has made it quite difficult to track down.)

Not understanding much of LLVM, but realizing that 32 bit offsets is highly likely not to be enough, as a test, I made an ugly hackaround and replaced the use of IMAGE_REL_AMD64_ADDR32NB relocations (which seems to be the 32 bit offsets) with IMAGE_REL_AMD64_ADDR64 (which looks to my eye as full 64 bit offsets?) and the problem goes away!!

But being an utter LLVM coding noob, I sincerely doubt this is the "right solution".

For the "long explanation", see the issue in the OSL GitHub linked above, including my "godawful hackaround".

What is the "right solution" here, or are we doing something fundamentally wrong somewhere?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions