public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug server/26116] New: gdbserver with zsh as the shell hangs at startup when .zshenv forks
@ 2020-06-14 2:49 simark at simark dot ca
2020-12-04 6:23 ` [Bug server/26116] " dajiang0055 at gmail dot com
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: simark at simark dot ca @ 2020-06-14 2:49 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26116
Bug ID: 26116
Summary: gdbserver with zsh as the shell hangs at startup when
.zshenv forks
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: server
Assignee: unassigned at sourceware dot org
Reporter: simark at simark dot ca
Target Milestone: ---
When using zsh as the shell and a command that forks in ~/.zshenv, like
`/bin/echo` here (plain `echo` is the shell builtin, which doesn't fork):
$ cat ~/.zshenv
echo Before
/bin/echo Hello
echo After
... gdbserver hangs at startup
$ SHELL=zsh ./gdbserver localhost:9000 /bin/ls
Before
Hello
<hangs here>
Note that when using a similar bash feature, the BASH_ENV environment variable,
it doesn't hang:
$ SHELL=bash BASH_ENV=~/.zshenv ./gdbserver localhost:9000 /bin/ls
Before
Hello
After
Process /bin/ls created; pid = 745096
Listening on port 9000
It's also possible that the issue is in zsh, but I haven't dug enough to
understand what's happening exactly.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug server/26116] gdbserver with zsh as the shell hangs at startup when .zshenv forks
2020-06-14 2:49 [Bug server/26116] New: gdbserver with zsh as the shell hangs at startup when .zshenv forks simark at simark dot ca
@ 2020-12-04 6:23 ` dajiang0055 at gmail dot com
2021-05-05 2:14 ` corydoras at ridiculousfish dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: dajiang0055 at gmail dot com @ 2020-12-04 6:23 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26116
dajiang0055 at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dajiang0055 at gmail dot com
--- Comment #1 from dajiang0055 at gmail dot com ---
I had the same problem with tcsh.
It seems that gdbserver hangs in sigsuspend() and wait for SIGTRAP.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug server/26116] gdbserver with zsh as the shell hangs at startup when .zshenv forks
2020-06-14 2:49 [Bug server/26116] New: gdbserver with zsh as the shell hangs at startup when .zshenv forks simark at simark dot ca
2020-12-04 6:23 ` [Bug server/26116] " dajiang0055 at gmail dot com
@ 2021-05-05 2:14 ` corydoras at ridiculousfish dot com
2024-04-22 12:44 ` k4lizen at proton dot me
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: corydoras at ridiculousfish dot com @ 2021-05-05 2:14 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26116
ridiculous_fish <corydoras at ridiculousfish dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |corydoras at ridiculousfish dot co
| |m
--- Comment #2 from ridiculous_fish <corydoras at ridiculousfish dot com> ---
fish shell is also seeing this - see
https://github.com/fish-shell/fish-shell/issues/7957
My investigation got as far as follows: gdbserver forks in preparation for
exec'ing the shell. Before exec, it requests ptrace on itself (in
`linux_ptrace_fun`). This causes signals to be delivered to gdbserver before
the inferior shell; however gdbserver does not then arrange for the signal to
be delivered to the shell so it is dropped. fish (and presumably zsh) relies on
SIGCHLD to reap processes, so fish ends up hanging.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug server/26116] gdbserver with zsh as the shell hangs at startup when .zshenv forks
2020-06-14 2:49 [Bug server/26116] New: gdbserver with zsh as the shell hangs at startup when .zshenv forks simark at simark dot ca
2020-12-04 6:23 ` [Bug server/26116] " dajiang0055 at gmail dot com
2021-05-05 2:14 ` corydoras at ridiculousfish dot com
@ 2024-04-22 12:44 ` k4lizen at proton dot me
2024-09-25 19:57 ` tromey at sourceware dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: k4lizen at proton dot me @ 2024-04-22 12:44 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26116
k4lizen <k4lizen at proton dot me> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |k4lizen at proton dot me
--- Comment #3 from k4lizen <k4lizen at proton dot me> ---
Encountered this downstream:
https://github.com/Gallopsled/pwntools/issues/2377
workaround: https://github.com/Gallopsled/pwntools/pull/2378
https://github.com/Gallopsled/pwntools/pull/2321
which links: https://github.com/Gallopsled/pwntools/issues/2030
https://github.com/Gallopsled/pwntools/issues/2060
https://github.com/cvanloo/rop/blob/ec10a12e3256344e38e4c745781962f5245f5715/README.md?plain=1#L481
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug server/26116] gdbserver with zsh as the shell hangs at startup when .zshenv forks
2020-06-14 2:49 [Bug server/26116] New: gdbserver with zsh as the shell hangs at startup when .zshenv forks simark at simark dot ca
` (2 preceding siblings ...)
2024-04-22 12:44 ` k4lizen at proton dot me
@ 2024-09-25 19:57 ` tromey at sourceware dot org
2025-01-16 12:33 ` jremus at linux dot ibm.com
2025-01-24 15:39 ` sam at gentoo dot org
5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2024-09-25 19:57 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26116
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |beatussum at protonmail dot com
--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
*** Bug 31731 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug server/26116] gdbserver with zsh as the shell hangs at startup when .zshenv forks
2020-06-14 2:49 [Bug server/26116] New: gdbserver with zsh as the shell hangs at startup when .zshenv forks simark at simark dot ca
` (3 preceding siblings ...)
2024-09-25 19:57 ` tromey at sourceware dot org
@ 2025-01-16 12:33 ` jremus at linux dot ibm.com
2025-01-24 15:39 ` sam at gentoo dot org
5 siblings, 0 replies; 7+ messages in thread
From: jremus at linux dot ibm.com @ 2025-01-16 12:33 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26116
Jens Remus <jremus at linux dot ibm.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jremus at linux dot ibm.com
--- Comment #5 from Jens Remus <jremus at linux dot ibm.com> ---
Very annoying! Ran into this running the GDB testsuite on s390x. My shell is
zsh. Nearly all gdb.server tests hang and run into a timeout.
I could workaround by running the testsuite with SHELL=bash as follows:
$ SHELL=bash make check
Would it make sense to skip all gdb.server tests if the shell is one of the
known problematic ones or use --no-startup-with-shell in those tests?
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug server/26116] gdbserver with zsh as the shell hangs at startup when .zshenv forks
2020-06-14 2:49 [Bug server/26116] New: gdbserver with zsh as the shell hangs at startup when .zshenv forks simark at simark dot ca
` (4 preceding siblings ...)
2025-01-16 12:33 ` jremus at linux dot ibm.com
@ 2025-01-24 15:39 ` sam at gentoo dot org
5 siblings, 0 replies; 7+ messages in thread
From: sam at gentoo dot org @ 2025-01-24 15:39 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=26116
Sam James <sam at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://github.com/fish-she
| |ll/fish-shell/issues/7957,
| |https://github.com/Gallopsl
| |ed/pwntools/issues/2377,
| |https://github.com/Gallopsl
| |ed/pwntools/pull/2378,
| |https://github.com/Gallopsl
| |ed/pwntools/pull/2321,
| |https://github.com/Gallopsl
| |ed/pwntools/issues/2030,
| |https://github.com/Gallopsl
| |ed/pwntools/issues/2060
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-01-24 15:39 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-14 2:49 [Bug server/26116] New: gdbserver with zsh as the shell hangs at startup when .zshenv forks simark at simark dot ca
2020-12-04 6:23 ` [Bug server/26116] " dajiang0055 at gmail dot com
2021-05-05 2:14 ` corydoras at ridiculousfish dot com
2024-04-22 12:44 ` k4lizen at proton dot me
2024-09-25 19:57 ` tromey at sourceware dot org
2025-01-16 12:33 ` jremus at linux dot ibm.com
2025-01-24 15:39 ` sam at gentoo dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).