* [uml-devel] Debian bug 271069, gdb startup fails
@ 2004-11-13 21:14 Daniel Jacobowitz
2004-11-13 21:52 ` [uml-devel] " Daniel Jacobowitz
2004-11-18 2:43 ` [uml-devel] " Jeff Dike
0 siblings, 2 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2004-11-13 21:14 UTC (permalink / raw)
To: 271069-submitter, 271069, user-mode-linux-devel
History:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=271069
I've been looking at this bug. I've already fixed the EINTR problem;
I didn't see your patch (not sure why the BTS didn't forward it to me).
But 2.6.10-rc1 does the same thing outside of UML, so I needed to fix
it anyway.
However, GDB startup still fails in UML using './linux debug'. Here's
what happens:
- GDB forks
- the child issues TRACEME
- GDB waits for it, successfully now that EINTR is handled
- GDB issues PTRACE_SETOPTIONS (returns -EINVAL because the proxy
does not support it)
- GDB decides that the feature isn't available (good so far; it isn't)
- GDB tries to clean up. It sends PTRACE_KILL to the child it forked.
- GDB waits for the child to exit. Which it never does.
I imagine the proxy is just not able to cope with this. It certainly
doesn't look as if it can. For instance, arg2 is completely ignored
except for PTRACE_ATTACH; I think what has happened is that the
PTRACE_KILL was sent to the wrong process. And the waitpids are
probably waiting for the wrong process too.
I think the only way to fix this is to teach the UML proxy to get out
of the way if the pid is not the expected one, for at least PTRACE_KILL
and waitpid; but it should probably continue to return failure for
PTRACE_SETOPTIONS.
--
Daniel Jacobowitz
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [uml-devel] Re: Debian bug 271069, gdb startup fails
2004-11-13 21:14 [uml-devel] Debian bug 271069, gdb startup fails Daniel Jacobowitz
@ 2004-11-13 21:52 ` Daniel Jacobowitz
2004-11-18 2:43 ` [uml-devel] " Jeff Dike
1 sibling, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2004-11-13 21:52 UTC (permalink / raw)
To: 271069-submitter, 271069, user-mode-linux-devel
On Sat, Nov 13, 2004 at 04:14:43PM -0500, Daniel Jacobowitz wrote:
> History:
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=271069
>
> I've been looking at this bug. I've already fixed the EINTR problem;
> I didn't see your patch (not sure why the BTS didn't forward it to me).
> But 2.6.10-rc1 does the same thing outside of UML, so I needed to fix
> it anyway.
>
> However, GDB startup still fails in UML using './linux debug'. Here's
> what happens:
>
> - GDB forks
> - the child issues TRACEME
> - GDB waits for it, successfully now that EINTR is handled
> - GDB issues PTRACE_SETOPTIONS (returns -EINVAL because the proxy
> does not support it)
> - GDB decides that the feature isn't available (good so far; it isn't)
> - GDB tries to clean up. It sends PTRACE_KILL to the child it forked.
> - GDB waits for the child to exit. Which it never does.
>
> I imagine the proxy is just not able to cope with this. It certainly
> doesn't look as if it can. For instance, arg2 is completely ignored
> except for PTRACE_ATTACH; I think what has happened is that the
> PTRACE_KILL was sent to the wrong process. And the waitpids are
> probably waiting for the wrong process too.
>
> I think the only way to fix this is to teach the UML proxy to get out
> of the way if the pid is not the expected one, for at least PTRACE_KILL
> and waitpid; but it should probably continue to return failure for
> PTRACE_SETOPTIONS.
Actually, while the proxy probably should be fixed anyway, I've worked
around this in GDB. It will be in the Debian 6.3-2 packages, which I'm
working on right now.
Should "kill" work from the GDB prompt? If so, that does need some
work in the proxy.
--
Daniel Jacobowitz
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] Debian bug 271069, gdb startup fails
2004-11-18 2:43 ` [uml-devel] " Jeff Dike
@ 2004-11-18 0:47 ` Daniel Jacobowitz
2004-11-18 4:53 ` Jeff Dike
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2004-11-18 0:47 UTC (permalink / raw)
To: Jeff Dike; +Cc: 271069-submitter, 271069, user-mode-linux-devel
On Wed, Nov 17, 2004 at 09:43:42PM -0500, Jeff Dike wrote:
> dan@debian.org said:
> > - GDB forks
> > - the child issues TRACEME
> > - GDB waits for it, successfully now that EINTR is handled
> > - GDB issues PTRACE_SETOPTIONS (returns -EINVAL because the proxy
> > does not support it)
> > - GDB decides that the feature isn't available (good so far; it isn't)
> > - GDB tries to clean up. It sends PTRACE_KILL to the child it forked.
> > - GDB waits for the child to exit. Which it never does.
>
> >From your description above (I haven't seen this personally), there are a
> couple of things I don't understand.
>
> First, I don't see how a PTRACE_KILL can be going to the wrong process. I see
> only one child under ptrace.
>
> Second, it would seem that, even if this was successful, the end result is
> './linux debug' just dropping you back to a shell prompt. This may be better
> than the current hang, but it's not the desired result.
GDB isn't trying to kill UML; it's trying to kill a process that it
forked, for the express purpose of figuring out whether certain debug
facilities are available on the system. So GDB is "attached" to both
UML and this new child. It's trying to kill (as well as do other
things to) the new child; but UML's proxy layer assumes that anything
GDB does by ptrace is intended to go to UML instead.
--
Daniel Jacobowitz
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] Debian bug 271069, gdb startup fails
2004-11-13 21:14 [uml-devel] Debian bug 271069, gdb startup fails Daniel Jacobowitz
2004-11-13 21:52 ` [uml-devel] " Daniel Jacobowitz
@ 2004-11-18 2:43 ` Jeff Dike
2004-11-18 0:47 ` Daniel Jacobowitz
1 sibling, 1 reply; 5+ messages in thread
From: Jeff Dike @ 2004-11-18 2:43 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: 271069-submitter, 271069, user-mode-linux-devel
dan@debian.org said:
> - GDB forks
> - the child issues TRACEME
> - GDB waits for it, successfully now that EINTR is handled
> - GDB issues PTRACE_SETOPTIONS (returns -EINVAL because the proxy
> does not support it)
> - GDB decides that the feature isn't available (good so far; it isn't)
> - GDB tries to clean up. It sends PTRACE_KILL to the child it forked.
> - GDB waits for the child to exit. Which it never does.
From your description above (I haven't seen this personally), there are a
couple of things I don't understand.
First, I don't see how a PTRACE_KILL can be going to the wrong process. I see
only one child under ptrace.
Second, it would seem that, even if this was successful, the end result is
'./linux debug' just dropping you back to a shell prompt. This may be better
than the current hang, but it's not the desired result.
Jeff
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [uml-devel] Debian bug 271069, gdb startup fails
2004-11-18 0:47 ` Daniel Jacobowitz
@ 2004-11-18 4:53 ` Jeff Dike
0 siblings, 0 replies; 5+ messages in thread
From: Jeff Dike @ 2004-11-18 4:53 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: 271069-submitter, 271069, user-mode-linux-devel
dan@debian.org said:
> GDB isn't trying to kill UML; it's trying to kill a process that it
> forked, for the express purpose of figuring out whether certain debug
> facilities are available on the system.
Ahh, thanks for the clarification.
Jeff
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-11-18 2:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-13 21:14 [uml-devel] Debian bug 271069, gdb startup fails Daniel Jacobowitz
2004-11-13 21:52 ` [uml-devel] " Daniel Jacobowitz
2004-11-18 2:43 ` [uml-devel] " Jeff Dike
2004-11-18 0:47 ` Daniel Jacobowitz
2004-11-18 4:53 ` Jeff Dike
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.