Hi, we've found another problem with ksh hanged.
ksh -c 'echo $( ( seq 60000 ) )' is always working reproducer. (Maybe this was already discussed on the list but I can't find it) In fact 21648 is the last working number and 21649 is first that hangs, but length of that seq output (which is 118788) does not seem like any limit or hardcoded buffer size. When ksh hangs there is seq process that tries to exit and flush it's output. "649\n" are extra bytes that cause this block (649 from last number 21649). Seems like seq is waiting for ksh to read that data but ksh does not want them. I've found 20080725 is the last version that is working. Most important change is subshell.c : sh_subtmpfile(int) and pipe usage changes. When I tried to set int argument to 0 alwyas (as first command this function), the reproducer works correctly (but a much more things become broken completely). Seems like pipes does not work correctly. Do you have any idea what causes this? Is it related to the socketpair bug in the other post? Regards, Michal Hlavinka backtraces: seq: #0 __write_nocancel () #1 _IO_new_file_write (f=0x3ada781780, data=, n=4) #2 new_do_write (fp=0x3ada781780, data=0x7f8af747e000 "649\n967\n20968\n"..., to_do=4) #3 _IO_new_do_write (fp=0x3ada781780, data=0x7f8af747e000 "649\n967\n20968\n"..., to_do=4) #4 _IO_new_file_close_it (fp=0x3ada781780) #5 _IO_new_fclose (fp=0x3ada781780) #6 close_stream (stream=0x3ada781780) #7 close_stdout () #8 __run_exit_handlers (status=0) #9 exit (status=0) #10 main (argc=, argv=) subshell: #0 __libc_waitpid (pid=, stat_loc=0x7fff50dfa66c, options=10) #1 job_reap (sig=) at cmd/ksh93/sh/jobs.c:280 #2 job_wait (pid=27026) at cmd/ksh93/sh/jobs.c:1433 #3 sh_exec (t=, flags=) at cmd/ksh93/sh/xec.c:1268 #4 sh_subshell (t=, flags=, comsub=) at cmd/ksh93/sh/subshell.c:573 #5 sh_exec (t=, flags=) at cmd/ksh93/sh/xec.c:1478 #6 sh_subshell (t=, flags=, comsub=) at cmd/ksh93/sh/subshell.c:573 #7 comsubst (mp=, t=0x1f16500, type=) at cmd/ksh93/sh/macro.c:1999 #8 varsub (mp=0x1f0c0e0) at cmd/ksh93/sh/macro.c:1106 #9 copyto (mp=, endch=, newquote=) at cmd/ksh93/sh/macro.c:587 #10 sh_macexpand (shp=0x738d80, argp=0x1f164b0, arghead=0x7fff50dfc0e8, flag=) at cmd/ksh93/sh/macro.c:235 #11 arg_expand (shp=0x738d80, nargs=0x7fff50dfc61c, comptr=, flag=0) at cmd/ksh93/sh/args.c:867 #12 sh_argbuild (shp=0x738d80, nargs=0x7fff50dfc61c, comptr=, flag=0) at cmd/ksh93/sh/args.c:728 #13 sh_exec (t=, flags=) at cmd/ksh93/sh/xec.c:713 #14 exfile () #15 sh_main () #16 __libc_start_main (...) #17 _start () shell: #0 __libc_waitpid (pid=, stat_loc=0x7fff50dfab9c, options=10) #1 job_reap (sig=) at cmd/ksh93/sh/jobs.c:280 #2 job_wait (pid=27025) at cmd/ksh93/sh/jobs.c:1433 #3 sh_subshell (t=, flags=, comsub=) at cmd/ksh93/sh/subshell.c:741 #4 sh_exec (t=, flags=) at cmd/ksh93/sh/xec.c:1478 #5 sh_subshell (t=, flags=, comsub=) at cmd/ksh93/sh/subshell.c:573 #6 comsubst (mp=, t=0x1f16500, type=) at cmd/ksh93/sh/macro.c:1999 #7 varsub (mp=0x1f0c0e0) at cmd/ksh93/sh/macro.c:1106 #8 copyto (mp=, endch=, newquote=) at cmd/ksh93/sh/macro.c:587 #9 sh_macexpand (shp=0x738d80, argp=0x1f164b0, arghead=0x7fff50dfc0e8, flag=) at cmd/ksh93/sh/macro.c:235 #10 arg_expand (shp=0x738d80, nargs=0x7fff50dfc61c, comptr=, flag=0) at cmd/ksh93/sh/args.c:867 #11 sh_argbuild (shp=0x738d80, nargs=0x7fff50dfc61c, comptr=, flag=0) at cmd/ksh93/sh/args.c:728 #12 sh_exec (t=, flags=) at cmd/ksh93/sh/xec.c:713 #13 exfile () #14 sh_main () #15 __libc_start_main (...) #16 _start () _______________________________________________ ast-developers mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-developers
