You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python] MemoryMappedFile().resize() segfaults when no file has been opened #51229
Describe the bug, including details regarding any error messages, version, and platform.
Summary
MemoryMappedFile can be directly constructed without opening a file, and resize() on that object terminates the interpreter.
I found this while fuzzing Python C extension modules.
I think this unsupported state should raise a Python exception rather than terminate the process.
I built PyArrow 25.0.0 from source with Clang 18 using ASan and UBSan instrumentation.
UBSan reports a member call on a null arrow::io::MemoryMappedFile in the generated wrapper:
build/lib.cpp:252525:86: runtime error:
member call on null pointer of type 'arrow::io::MemoryMappedFile'
#0 pyarrow.lib.MemoryMappedFile.resize(...)
build/lib.cpp:252525:86
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior
build/lib.cpp:252525:86
ASan then reports a read from address 0x28 on the same path.
The sanitizer process exits with code 134 after ASan aborts.
Activity
apacheGH-51229: Assert the value error with pytest.raises
AlenkaF commentedon Sep 18, 2026
@1fanwang could you comment on the issue so I can assign it to you?
AlenkaF commentedon Sep 18, 2026
ps: you can also comment with
takeand the issue will automatically be assigned to you.1fanwang commentedon Sep 18, 2026
take
GH-51229: [Python] Raise instead of crashing on unopened resize (#51246)
AlenkaF commentedon Sep 21, 2026
Issue resolved by pull request 51246
#51246