microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.4k stars 819 forks source link

No support for /proc/self/mem #547

Open fpmurphy opened 8 years ago

fpmurphy commented 8 years ago

Many tools and utilities expect to be able to access process memory via /proc/self/mem.

Please consider adding this functionality to WSL.

aseering commented 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.

nwn commented 7 years ago

@aseering I'm late by a year, but it's often used in debuggers to access the target's virtual memory.

iROOT commented 6 years ago

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
analogrelay commented 6 years ago

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

secoskyj commented 5 years ago

We have a debugger that uses /proc/[pid]/mem.

therealkenc commented 5 years ago

Thanks for reporting this! I'm curious, though -- do you have an example of a program that does this?

gcore(1)

We have a debugger that uses /proc/[pid]/mem.

Yep. This issue is spiritually dupe #1262. Best hope is to get this User Voice out of two digit territory.

hzqmwne commented 2 years ago

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

klikevil commented 1 year ago

7 years later Microsoft still hasn't fixed this in WSL 1 👎