[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gdb and strace mal-functioning in a telnet console



On Thu, 13 Aug 1998, guy keren wrote:

> 
> On Sun, 9 Aug 1998, Shlomi Fish wrote:
> 
> > Similiarly, if I type "strace ls" then strace prints
> > "execve("/bin/ls"...)" and then gets stuck. This time, I can terminate it
> > with Ctrl+C.
> > 
> > Does anybody have any idea what is causing this problem and how to resolve
> > it?
> 
> no, but we can try to come up with some strange ideas:
> 
> 1. run the command in the background, and then attach the debugger (or
>    strace) to it - debugger by supplying pid after binary file name.
>    strace - using the '-p' flag. does that work any better?
>

Well, it causes the background process to get stuck.
 
> 2. 'su' to root and try runing 'strace' under root?
> 

I can't because I'm not the sys-admin of that host. I suspect it may have
something to do with the permission on the /proc file-system which only
root can view, but like I said I can't check it out.

> 3. does the 'ls' program run properly without using strace on it? that was
>    not mentioned in your original letter, i think.
> 

Yes, ls and every other program except gdb and strace run perfectly.

> 4. try running 'ldd /bin/ls' - does it work - or also gets stuck?
>    if it gets stuck, start suspecting that your '/bin/ld.so' has lost it.
>    maybe just running 'ldconfig' would solve a stale ld.so cache problem?
>    maybe removal of /etc/ld.so.cache and then ldconfig would solve it?
>

There isn't a problem with ldd.
    
> 5. did that machine ever had gdb and strace working properly and then it
>    got screwed up sometime, or gdb and strace never worked properly on it?
> 

I don't think I tried using gdb and strace their before, but I'm not sure.
In any case, the machine runs RedHat 4.2 which without any modifications
can run gdb and strace just fine.

BTW, I did some tests and find out that after a call to the ptrace()
function, the EXECVE system call won't work.

	Shlomi Fish