Skip to content

fix: fix possible fmt exceptions where we might have passed null string#5115

Open
lgritz wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
lgritz:lg-fmtexception
Open

fix: fix possible fmt exceptions where we might have passed null string#5115
lgritz wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
lgritz:lg-fmtexception

Conversation

@lgritz
Copy link
Copy Markdown
Collaborator

@lgritz lgritz commented Mar 27, 2026

I've heard occasional reports of uncaught exceptions in print statements. I haven't caught it in the act yet, but one set of reports involved the following output:

OpenImageIO/detail/fmt/format-inl.h:40: assertion failed: string pointer is null

So I'm proactively trying to find places that might be passing a null as a string. I'm just guessing here, but these are plausible candidates.

I've heard occasional reports of uncaught exceptions in print
statements. I haven't caught it in the act yet, but one set of reports
involved the following output:

    OpenImageIO/detail/fmt/format-inl.h:40: assertion failed: string pointer is null

So I'm proactively trying to find places that might be passing a null
as a string. I'm just guessing here, but these are plausible candidates.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Larry Gritz <lg@larrygritz.com>
Copy link
Copy Markdown
Contributor

@jessey-git jessey-git left a comment

Choose a reason for hiding this comment

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

Seems alright now.

@jessey-git
Copy link
Copy Markdown
Contributor

Oh, hmm, I'll note here that based on the upstream code in libraw, it looks like libraw_strerror will always return some sort of string (never null). So the changes here are just defensive and the elusive null being passed to fmt is still out there 👻

@lgritz
Copy link
Copy Markdown
Collaborator Author

lgritz commented Mar 28, 2026

I think these are worth keeping to protect against future mistakes or changed behavior in libraw?

I had no evidence that these were the fmt problems; I just was searching for ANY places where it could be null ptr.

Maybe after merging #5118 it will force a few more exceptions (in main) and we'll find the real source quickly?

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