Open fpmurphy opened 8 years ago
Thanks for reporting this! I'm curious, though -- do you have an example of a program that does this? /proc/self/mem seems like a cool feature but I've never actually seen it in use.
@aseering I'm late by a year, but it's often used in debuggers to access the target's virtual memory.
Examples of changing memory in another process do not work, because there is no mem file. https://blog.holbertonschool.com/hack-the-virtual-memory-c-strings-proc/
$ sudo python3 ~/read_write_heap.py 14 Holberton "Fun w vm!"
[*] maps: /proc/14/maps
[*] mem: /proc/14/mem
[*] Found [heap]:
pathname = [heap]
addresses = 7fffd2268000-7fffd2289000
permisions = rw-p
offset = 00000000
inode = 0
Addr start [7fffd2268000] | end [7fffd2289000]
[ERROR] Can not open file /proc/14/mem:
I/O error(2): No such file or directory
Another practical example: /proc/[pid]/mem
(which also doesn't seem to work) is used by .NET Core's createdump
tool to collect a memory dump
We have a debugger that uses /proc/[pid]/mem.
Now gdb
12.0.90-0ubuntu1
from Ubuntu 22.04 requires /proc/self/mem
(see this commit ), so lack of this feature causes gdb almost unusable on Ubuntu 22.04 under WSL1.
This issue finally becomes a serious problem.
Related issue: #8356
7 years later Microsoft still hasn't fixed this in WSL 1 👎
Many tools and utilities expect to be able to access process memory via /proc/self/mem.
Please consider adding this functionality to WSL.