Skip to content

Fix format specifiers for long err in numa bind warning message#1321

Closed
StanFromIreland wants to merge 1 commit into
microsoft:mainfrom
StanFromIreland:spec
Closed

Fix format specifiers for long err in numa bind warning message#1321
StanFromIreland wants to merge 1 commit into
microsoft:mainfrom
StanFromIreland:spec

Conversation

@StanFromIreland

Copy link
Copy Markdown

This was reported by CodeQL in CPython (we bundle a copy).

There are two more alterts in _mi_arena_free:

_mi_error_message(EINVAL, "trying to free from an invalid arena: %p, size %zu, memid: 0x%zx\n", p, size, memid);

_mi_error_message(EINVAL, "trying to free from an invalid arena block: %p, size %zu, memid: 0x%zx\n", p, size, memid);

The 24-byte mi_memid_t struct memid is passed to a %zx (size_t) format specifier which is UB under CodeQL's cpp/wrong-type-format-argument rule. I'm not familiar with mimalloc to know how to fix these :-)

@daanx

daanx commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Thank you so much! I applied it manually to the dev branch (as we cannot merge PR's into main ). Thanks again.

@daanx daanx closed this Jul 7, 2026
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