Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]gdb won't give me a back trace of a running process
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2614
Location: Hamburg/Germany

PostPosted: Tue Oct 08, 2013 8:58 pm    Post subject: [solved]gdb won't give me a back trace of a running process Reply with quote

While trying to debug a user mode linux issue I got
Code:
tfoerste@n22 ~ $ sudo gdb /home/tfoerste/devel/linux/linux 15576 -n -batch -ex bt
warning: process 15576 is already traced by process 971
ptrace: Operation not permitted.
/home/tfoerste/15576: No such file or directory.
No stack.
WHat irritates me is "/home/tfoerste/15576" - shouldn't gdb look into /proc instead ?

Last edited by toralf on Wed Oct 09, 2013 5:16 pm; edited 1 time in total
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1406

PostPosted: Tue Oct 08, 2013 9:04 pm    Post subject: Reply with quote

What is process 971?
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2614
Location: Hamburg/Germany

PostPosted: Tue Oct 08, 2013 9:20 pm    Post subject: Reply with quote

that is the "root" of all linux - processes of the user mode linux guests:
Code:
$ pgrep -a linux
971 /home/tfoerste/devel/linux/linux earlyprintk ubda=/home/tfoerste/virtual/uml/trinity ubdb=/mnt/ramdisk/trinity_swap eth0=tuntap,tap0,72:ef:3d:9f:c3:5a mem=1025M con0=fd:0,fd:1 con=pts umid=uml_trinity rootfstype=ext4
978 /home/tfoerste/devel/linux/linux earlyprintk ubda=/home/tfoerste/virtual/uml/trinity ubdb=/mnt/ramdisk/trinity_swap eth0=tuntap,tap0,72:ef:3d:9f:c3:5a mem=1025M con0=fd:0,fd:1 con=pts umid=uml_trinity rootfstype=ext4
979 /home/tfoerste/devel/linux/linux earlyprintk ubda=/home/tfoerste/virtual/uml/trinity ubdb=/mnt/ramdisk/trinity_swap eth0=tuntap,tap0,72:ef:3d:9f:c3:5a mem=1025M con0=fd:0,fd:1 con=pts umid=uml_trinity rootfstype=ext4
980 /home/tfoerste/devel/linux/linux earlyprintk ubda=/home/tfoerste/virtual/uml/trinity ubdb=/mnt/ramdisk/trinity_swap eth0=tuntap,tap0,72:ef:3d:9f:c3:5a mem=1025M con0=fd:0,fd:1 con=pts umid=uml_trinity rootfstype=ext4
981 linux
1072 linux
1774 linux
5940 linux
5943 linux
6076 linux
6156 linux
6456 linux
6713 linux
6881 linux
6945 linux
7143 linux
7185 linux
7187 linux
7209 linux
7226 linux
7227 linux
13127 linux
13252 linux
13255 linux
13262 linux
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1406

PostPosted: Tue Oct 08, 2013 9:35 pm    Post subject: Reply with quote

Try:
Code:
sudo gdb /home/tfoerste/devel/linux/linux 971 -n -batch -ex bt


I don't think you'll ever get 15576 because 15576 is forked
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8592

PostPosted: Tue Oct 08, 2013 9:57 pm    Post subject: Re: gdb won't give me a back trace of a running process Reply with quote

toralf wrote:
While trying to debug a user mode linux issue I got
Code:
tfoerste@n22 ~ $ sudo gdb /home/tfoerste/devel/linux/linux 15576 -n -batch -ex bt
warning: process 15576 is already traced by process 971
ptrace: Operation not permitted.
/home/tfoerste/15576: No such file or directory.
No stack.
WHat irritates me is "/home/tfoerste/15576" - shouldn't gdb look into /proc instead ?
GDB tried to attach to the process and failed. It then tried to treat the identifier as a program in the current working directory. Arguably, it should skip that latter check if the former found a valid process but still failed to attach.

You cannot ptrace a process that is already under ptrace. According to the gdb output, process 971 is already tracing your target. Normally, I would suggest killing 971 and trying again, but since you say that is the UML process, killing it might bring down the whole UML environment.
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2614
Location: Hamburg/Germany

PostPosted: Wed Oct 09, 2013 5:16 pm    Post subject: Reply with quote

ah - thx.
So probably worth a minor bug report/enhancement request.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum