LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-08-2011, 05:01 PM   #1
Valentin
LQ Newbie
 
Registered: Jun 2011
Posts: 8

Rep: Reputation: Disabled
strace crashes shell/system when being used on current bash


Good evening,

I hope this is the adequate sub forum and I found a good thread title.

My apologies if it is somehow misleading. I have to admit that I do better in describing an issue in my native language, German.

Well, to the topic: I am observing a very strange behavior when using strace and don't know the reasons for it.

I do:
pstree -Aapnul |less -p bash
on my Ubuntu VM which is run with the help of Virtual Box.

I see:

|-gnome-terminal,1418,valentin
| |-gnome-pty-helpe,1419
| |-bash,1420
| | |-pstree,1471 -Aapnul
| | `-less,1472 -p bash
| `-{gnome-terminal},1421


I was curious: What would it look like to strace gnome-terminal and see what this process is doing?
I know, this is senseless and just playing around, but at the same time, it should work. Right?

Well, as a normal user I run:
strace -p 1418

-> And suddenly the windows showing the "terminal" freezes. It becomes grey and does not respond.
When I try to run another terminal, the windows will never appear and nothing happens. The whole machine behaves strangely and gets slowed down.

I am able to reproduce this problem as often as I like on this machine.

When I ran this strace command as root once, the whole system froze. Unfortunately I am not able to reproduce this one and prove it to you.

Now my question is: What happens there, why does it happen and is there any logic I am not aware of? Like there is a sort of "loop" or an unwritten rule that you may never ever trace your own "terminal"?

Ubuntu version: 10.04 (Lucid Lynx)
Kernel: 2.6.32-24-generic #43-Ubuntu
strace version: 4.5.19-2
Desktop: gnome


Best regards,
Valentin
 
Old 06-08-2011, 10:14 PM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 475

Rep: Reputation: 73
If you are attempting to strace the shell you are launching strace it end up in a loop which will consume resources and [potentially] render a system inoperable.

What happens if you launch two shells and strace shellA from shellB?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I run a command on another shell without changing the current shell? quanba Other *NIX 3 04-05-2010 01:19 PM
intercepting system call / alternative to strace mrshanim Linux - Kernel 2 10-24-2009 10:07 PM
Strace Linux System Call Peter_APIIT Programming 2 05-25-2009 01:12 AM
how to change current bash to a login shell jackandking Linux - Newbie 13 10-22-2008 12:24 PM
bash + strace = ..... gearoid Programming 3 05-19-2004 04:05 AM


All times are GMT -5. The time now is 03:46 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration