tracy icon indicating copy to clipboard operation
tracy copied to clipboard

Fix suspending processes in bash.

Open MerlijnWajer opened this issue 13 years ago • 7 comments

MerlijnWajer avatar Jun 22 '12 15:06 MerlijnWajer

It would appear that this works in latest master. (4a783d57771a01a65ae0c0d2bd2d8f971f5a1ba8)

I don't know what fixed it.

MerlijnWajer avatar Jul 12 '12 15:07 MerlijnWajer

This is actually not yet fixed. But strace seems to suffer from the same behaviour. I'll investigate further in a bit.

MerlijnWajer avatar Jul 13 '12 11:07 MerlijnWajer

Seems to have regressed; starting Python in (a traced) bash already causes an issue.

Whoops: Invalid argument Function: tracy_wait_event, File: tracy-event.c, Line: 519 Arguments: PTRACE_GETSIGINFO, pid (2926), ((void *)0), &(s->siginfo)

MerlijnWajer avatar Apr 30 '13 09:04 MerlijnWajer

Test case:

merlijn@chrometwo ~/projects/tracy/src/tests $ ./bash /bin/bash

 * keychain 2.7.1 ~ http://www.funtoo.org
 * Found existing gpg-agent: 2638

merlijn@chrometwo ~/projects/tracy/src/tests $ export PS1="$ "
$ cat
^Z
--------------------------------------------------------------------------------
Whoops: Invalid argument
Function: tracy_wait_event, File: tracy-event.c, Line: 544
Arguments: PTRACE_GETSIGINFO, pid (4422), ((void *)0), &(s->siginfo)
--------------------------------------------------------------------------------
Backtrace failed!
tracy_main: tracy_wait_Event returned NULL

[1]+  Stopped                 cat

MerlijnWajer avatar Sep 14 '14 09:09 MerlijnWajer

After this test case, typing 'fg' will bring the cat process to the front, but it's buggy.

MerlijnWajer avatar Sep 14 '14 09:09 MerlijnWajer

There's something with the following signals: SIGTSTP, SIGTTIN and SIGTTOU

  • https://www.gnu.org/software/libc/manual/html_node/Job-Control-Signals.html
  • https://stackoverflow.com/questions/11886812/whats-the-difference-between-sigstop-and-sigtstp
  • "group stop" http://man7.org/linux/man-pages/man2/ptrace.2.html

MerlijnWajer avatar Sep 14 '14 14:09 MerlijnWajer

maybe the following problem is related:(it's not important for my application though) works:

adb shell
/tmp/test sh

starts, but shell doesn't seem to receive stdin:

adb shell /tmp/test sh

M1cha avatar Sep 15 '14 09:09 M1cha