On Fri, Aug 9, 2013 at 12:44 AM, David Korn <[email protected]> wrote:
> cc: [email protected]
> Subject: Re: [ast-developers] Copying .sh.sig data ==> Segmentation fault in  
> ast-ksh.20130807
> --------
>
>> ksh -c 'compound c ; compound -a c.car; integer c.cari=0; trap
>> "typeset -c c.car[\$((c.cari++))]=.sh.sig" USR1; kill -q4 -s USR1 $$;
>> kill -q5 -s USR1 $$; true ; print -v c'
>> Segmentation fault
>>
>> (I don't have a usable stack trace because this is an optimized build.
>> Roland, could to have a look please?)
>>
>
> Here is the stack trace:
> #0  0x0000003ab5e33ba1 in __sigqueue (pid=9200, sig=10, val=...)
>     at ../sysdeps/unix/sysv/linux/sigqueue.c:47
> #1  0x0000000000434d78 in job_kill (pw=0x821de0, sig=10)
>     at /home/gsf/src/cmd/ksh93/sh/jobs.c:1199
> #2  0x00000000004345b1 in job_walk (shp=0x8212a0, file=0x820260,
>     fun=0x434c0c <job_kill>, arg=266, joblist=0x7ffff7f2ca38)
>     at /home/gsf/src/cmd/ksh93/sh/jobs.c:1003
> #3  0x0000000000499716 in b_kill (argc=5, argv=0x7ffff7f2ca38,
>     context=0x821800) at bltins/trap.c:251
> #4  0x0000000000475886 in sh_exec (shp=0x8212a0, t=0x7ffff7f2c930, flags=4)
>     at sh/xec.c:1341
> #5  0x0000000000417fe5 in exfile (shp=0x8212a0, iop=0x7ffff7ef0aa0, fno=11)
>     at /home/gsf/src/cmd/ksh93/sh/main.c:584
> #6  0x000000000041722d in sh_main (ac=2, av=0x7fffffffe0e8, userinit=0)
>     at /home/gsf/src/cmd/ksh93/sh/main.c:356
> #7  0x00000000004162f9 in main (argc=2, argv=0x7fffffffe0e8)
>     at /home/gsf/src/cmd/ksh93/sh/pmain.c:26
>
>
> I don't understand how sigqueue() can be core dumping.

AFAIK it can't... it's possible that the debugger (gdb) got somehow
confused... possible causes are:
1. Wrong binary passed to gdb
2. -fomit-frame-pointer and/or -foptimize-sibling-calls were used by
either gcc/clang... try recompiling with "-fno-omit-frame-pointer
-fno-optimize-sibling-calls". The issue in this case is that some
debuggers can't find the accurate position in the code anymore if the
frame pointer isn't used to point to the correct reference frame
anymore.

[snip]
> Can anyone see how this can core dump?

See http://lists.research.att.com/pipermail/ast-developers/2013q3/003020.html
... the issue is that trying to copy .sh.sig using typeset -c or
typeset -C comvar=.sh.sig is somehow a way to doomsday in
ast-ksh.2013-08-07 ...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to