* Re: need help with dbx on alpha/osf1
1994-12-02 17:45 need help with dbx on alpha/osf1 Noam Stopak
@ 1994-12-05 16:16 ` Peter Thompson
0 siblings, 0 replies; 2+ messages in thread
From: Peter Thompson @ 1994-12-05 16:16 UTC (permalink / raw)
In article <3bnmf3$ofo@explorer.clark.net>, noams@clark.net (Noam Stopak) writes:
|> I get the message
|>
|> "warning: breakpoint location cannot be written"
|>
|> when my process fork()s when running under dbx. Worse, it seems
|> the parent process is hung at that point. Sending an interrupt
|> and looking at the stack trace produces little useful info. Looks
|> like the stack has been stomped:
|>
|> signal Interrupt at [__gettimeofday:41 +0x8,0x3ff800cc808] Source not available
|> (dbx) where
|> > 0 __gettimeofday(0x1400bc600, 0x14000de80, 0x1400bc600, 0x1401b6000, 0x5) ["../../../../../src/usr/ccs/lib/libc/alpha/gettimeofdy.s":41, 0x3ff800cc808]
|> 1 time(0x11fffc068, 0x11fffc038, 0xf41cd, 0x1400bc400, 0x0) ["../../../../../src/usr/ccs/lib/libc/time.c":67, 0x3ff800e66f0]
|>
|> The system is an alpha 2100.
|> dbx version 3.11.6
|>
|> gemini 131 > uname -a
|> OSF1 gemini V3.0 347 alpha
|>
|> Any constructive suggestions?
|>
Sorry, my fault. There is new software in dbx which detects forks in the
debugged process, but I found, much to my chagrin, that it is
too aggressive at 3.0 and doesn't quite work right in all cases. Most
of the fixes are already in for the update, and I'll probably put a
patch together for 3.0 soon, but in the meantime, here's a bit of
what's going on and what might work.
With 3.0 code was put in to detect forks. This catches ALL forks the
process makes and it turns out that some of these are happening
behind the users back and we don't really want to catch all of those.
There is also a behavior inherent in the new support that is unfamiliar
to users and may cause some confusion. This is how it works. Dbx detects
the fork and tries to attach to the new process. At the time dbx detects
it, both the parent and the child are still in the fork code. Dbx advances
the parent and uses the value returned to open and attach to the child
process. The child process then is advanced past the fork code and
then STOPPED. A message is put out to the affect, "New child attached,
use switch to gain access to xxx", where xxx is the process id, and
switch is a new command to switch between the debugged processes.
However, if the parent continues, and is waiting on the child, then
it will basically hang, as the child is in a stopped state. In
some cases, I've found that the child almost immediately calls exec
and becomes a new process, and dbx does not yet control this so
it execs and may finish up. Dbx will not realize this and try to set
a breakpoint but it can't because the process is either dead or dbx does
not have access to that location.
Until a new version is available, you can try using the -noproc switch
to dbx, but that will lose the ability to attach to a running process.
But you can always have 2 windows running dbx, one to run the main
program, and another to do the attaching...
|>
|> Noam Stopak
|> --
|> Noam Stopak - noams@clark.net
PeterT
^ permalink raw reply [flat|nested] 2+ messages in thread