Current-Users archive

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

Re: Script command under NetBSD-current



On Mon, 14 Jun 2021, Dave Tyson wrote:

Both appear to be idle. Killing the parent process returns a command prompt.

Anyone else seeing this?


Yes, I've seen this bug with script in -HEAD (I don't recall encountering
this in 9.x). The program "freezes" sometimes upon exiting.

$ ps -d
 PID TTY   STAT    TIME COMMAND
...
2655 pts/3 I+   0:00.00 `-- script
1171 pts/3 I+   0:00.01   `-- script
...

The child process gets "stuck" in "___lwp_park60()" when after it exit()s,
and only a kill -9 will terminate it.

$ gdb -p 1171
Attaching to process 1171
Reading symbols from /usr/bin/script...
(No debugging symbols found in /usr/bin/script)
Reading symbols from /usr/lib/libutil.so.7...
(No debugging symbols found in /usr/lib/libutil.so.7)
Reading symbols from /usr/lib/libc.so.12...
(No debugging symbols found in /usr/lib/libc.so.12)
Reading symbols from /usr/libexec/ld.elf_so...
(No debugging symbols found in /usr/libexec/ld.elf_so)
[Switching to LWP 1171 of process 1171]
0x00007f7fbfa0ab3a in ___lwp_park60 () from /usr/libexec/ld.elf_so
(gdb) bt
#0  0x00007f7fbfa0ab3a in ___lwp_park60 () from /usr/libexec/ld.elf_so
#1 0x00007f7fbfa0265d in _rtld_exclusive_enter () from /usr/libexec/ld.elf_so
#2  0x00007f7fbfa03125 in _rtld_exit () from /usr/libexec/ld.elf_so
#3  0x000079097fb6bb1f in __cxa_finalize () from /usr/lib/libc.so.12
#4  0x000079097fb6b73d in exit () from /usr/lib/libc.so.12
#5  0x0000000001401771 in done ()
#6  0x0000000001401853 in finish ()
#7  <signal handler called>
#8  0x00007f7fbfa04bae in _rtld_symlook_obj () from /usr/libexec/ld.elf_so
#9 0x00007f7fbfa04fa5 in _rtld_symlook_list () from /usr/libexec/ld.elf_so #10 0x00007f7fbfa05458 in _rtld_symlook_default () from /usr/libexec/ld.elf_so
#11 0x00007f7fbfa057c7 in _rtld_find_symdef () from /usr/libexec/ld.elf_so
#12 0x00007f7fbfa058ba in _rtld_find_plt_symdef () from /usr/libexec/ld.elf_so
#13 0x00007f7fbfa00bc3 in _rtld_bind () from /usr/libexec/ld.elf_so
#14 0x00007f7fbfa0082d in _rtld_bind_start () from /usr/libexec/ld.elf_so
#15 0x0000000000000246 in ?? ()
#16 0x0000000000000000 in ?? ()
(gdb) quit
A debugging session is active.

        Inferior 1 [process 1171] will be detached.

Quit anyway? (y or n) y
Detaching from program: /usr/bin/script, process 1171
[Inferior 1 (process 1171) detached]

The parent process is reading from the child:
$ gdb -p 2655
Attaching to process 2655
Reading symbols from /usr/bin/script...
(No debugging symbols found in /usr/bin/script)
Reading symbols from /usr/lib/libutil.so.7...
(No debugging symbols found in /usr/lib/libutil.so.7)
Reading symbols from /usr/lib/libc.so.12...
(No debugging symbols found in /usr/lib/libc.so.12)
Reading symbols from /usr/libexec/ld.elf_so...
(No debugging symbols found in /usr/libexec/ld.elf_so)
[Switching to LWP 2655 of process 2655]
0x000079097fa4499a in read () from /usr/lib/libc.so.12
(gdb) bt
#0  0x000079097fa4499a in read () from /usr/lib/libc.so.12
#1  0x0000000001402012 in main ()
(gdb) quit
A debugging session is active.

        Inferior 1 [process 2655] will be detached.

Quit anyway? (y or n) y
Detaching from program: /usr/bin/script, process 2655
[Inferior 1 (process 2655) detached]
$

You can kill it normally and then the child also exits.

-RVP


Home | Main Index | Thread Index | Old Index