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. 

The line is
                r = sigqueue(pid,sig,sig_val);

union sigval sig_val;
sig_val.sival_int = shp->sigval;
Here is what the debugger shows for the value of sig_val
        {sival_int = 4, sival_ptr = 0x4}

Can anyone see how this can core dump?

David Korn
[email protected]
_______________________________________________
ast-developers mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to