Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TypeDesc SEGFAULT from Copy Constructor #4321

Open
Cthuflu opened this issue Jul 4, 2024 · 2 comments
Open

[BUG] TypeDesc SEGFAULT from Copy Constructor #4321

Cthuflu opened this issue Jul 4, 2024 · 2 comments

Comments

@Cthuflu
Copy link

Cthuflu commented Jul 4, 2024

Crash somewhat consistently occurs here in Blender 4.1.1 (OpenImageIO v2.5.12.0) on Fedora 40:

memcpy(ptr, _value, size); //NOSONAR

When crash doesn't occur, programs like Blender (4.1.1 built with v2.5.6.0) continue running but with no icons, and the welcome image is also a black box. Tested with v2.5.6.0 up to v2.5.13.0, with v2.5.9.0 and later having the bug.

Cause of the issue seems to be the new default on Copy Constructor in PR #4162. Programs built with v2.5.6.0 but using a linked version later than v2.5.8.0 will SEGFAULT from the Copy Constructor change in distributed headers. In the Blender case it somehow changes the arraylen from 0 to 32727 for a TypeDesc from changing a property in ImageDesc.

Temporarily reverting these changes does fix the issue for those cases. With this being built into distributed system headers it seems like it would be a breaking change for a minor API version; the alternative is tracking down how the arraylen value changes without touching any other code. rebuilding applications with the newer headers.

@lgritz
Copy link
Collaborator

lgritz commented Aug 10, 2024

Sorry for the delay in looking at this.

I didn't expect that change to make an incompatibility, but I guess it did somehow. In retrospect, I wish I'd kept that fix strictly in master and not backported it.

I'm not sure that reverting is going to help much at this point -- it might make 2.5.>=15 be compatible again with 2.5.<=8, but we'll still (forever) be in the situation where mixing headers and libraries for 2.5.<=8 and 2.5.9-14 will be incompatible and so will be mixing 2.5.9-14 and 2.5.15+. That feels like it's just shifting the problem around and not eliminating it.

Given that 2.6/3.0 will be the main supported release family soon, is it worth trying to fix this in 2.5? Do you (or anyone else reading) even have a specific suggestion for how to fix 2.5 for real? Or is the best we can do to advise everybody to upgrade to 2.5.9+ and try not to mix headers and libraries from different sides of that boundary?

@Cthuflu
Copy link
Author

Cthuflu commented Aug 12, 2024

I believe at this point it is best to mark that version as a boundary.

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

No branches or pull requests

2 participants