Skip to content
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

No support for /proc/self/mem #547

Open
fpmurphy opened this issue Jun 17, 2016 · 8 comments
Open

No support for /proc/self/mem #547

fpmurphy opened this issue Jun 17, 2016 · 8 comments
Labels

Comments

@fpmurphy
Copy link

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

Please consider adding this functionality to WSL.

@aseering
Copy link
Contributor

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
Copy link

nwn commented Sep 15, 2017

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

@iROOT
Copy link

iROOT commented Jul 4, 2018

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

@benhillis benhillis changed the title No support for /proc//self/mem No support for /proc/\self/mem Jul 11, 2018
@benhillis benhillis changed the title No support for /proc/\self/mem No support for /proc/self/mem Jul 11, 2018
@analogrelay
Copy link
Member

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
Copy link

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

@therealkenc
Copy link
Collaborator

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
Copy link

hzqmwne commented May 2, 2022

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants