-
-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
SIGBUS: writing to mmap
ed device beyond file size
#119817
Comments
May I ask if the |
Can not reproduced on Linux 6.9 |
@Zheaoli The bug is reproducible on I suppose you overlooked the [manjaro@manjaro ~]$ sudo sh
sh-5.2# uname -a
Linux manjaro 6.9.2-1-MANJARO #1 SMP PREEMPT_DYNAMIC Mon May 27 03:56:18 UTC 2024 x86_64 GNU/Linux
sh-5.2# python -VV
Python 3.12.3 (main, Apr 23 2024, 09:16:07) [GCC 13.2.1 20240417]
sh-5.2# modprobe brd rd_nr=1 rd_size=1024
sh-5.2# DEV=/dev/ram0
sh-5.2# SIZE=$(blockdev --getsize64 $DEV)
sh-5.2# tail $DEV
sh-5.2# python3.12 -c "from mmap import mmap;file=open('$DEV','r+b');m=mmap(file.fileno(),$SIZE+1);m.seek($SIZE-4);[m.write(bytes([b])) for b in b'hello world!']"
Bus error (core dumped)
sh-5.2# tail $DEV
hellsh-5.2# Notice the |
The issue confirmed, But I think it's not Python bug I think The core reason here is that the file size is You need to take care of the SIGBUS when you use the |
On POSIX, |
Crash report
What happened?
I hope you don't mind my reference to Madagascar
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.12.3 (main, Apr 27 2024, 19:00:21) [GCC 11.4.0]
The text was updated successfully, but these errors were encountered: