Cedric Blancher
2013-08-30 02:02:56 UTC
ast-ksh.20130829 crashes on Fedora 64bit if <<<"" is used with lots of data:
gdb --args ~/bin/ksh -c 'builtin sum ; sum --method md5 <<<"$(seq
1000000)" ; sum --method md5 < <(seq 1000000)'
(gdb) run
Starting program: /home/ced/bin/ksh -c builtin\ sum\ \;\ sum\
--method\ md5\ \<\<\<\"\$\(seq\ 1000000\)\"\ \;\ sum\ --method\ md5\
\<\ \<\(seq\ 1000000\)
Detaching after fork from child process 58221.
Program received signal SIGSEGV, Segmentation fault.
0x00000000004250fb in io_heredoc (shp=0x808320 <sh>, iop=0x7ffff7f18970,
name=0x7ffff6aa9080
"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70"...,
traceon=0)
at /home/ced/work/ksh_work/src/cmd/ksh93/sh/io.c:1636
1636 outfile->_data[off] = 0;
(gdb) where
#0 0x00000000004250fb in io_heredoc (shp=0x808320 <sh>, iop=0x7ffff7f18970,
name=0x7ffff6aa9080
"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70"...,
traceon=0)
at /home/ced/work/ksh_work/src/cmd/ksh93/sh/io.c:1636
#1 0x00000000004236b5 in sh_redirect (shp=0x808320 <sh>,
iop=0x7ffff7f18970, flag=0) at
/home/ced/work/ksh_work/src/cmd/ksh93/sh/io.c:1146
#2 0x000000000046921d in sh_exec (shp=0x808320 <sh>,
t=0x7ffff7f188f0, flags=4) at
/home/ced/work/ksh_work/src/cmd/ksh93/sh/xec.c:1319
#3 0x000000000046c5f9 in sh_exec (shp=0x808320 <sh>,
t=0x7ffff7f18c40, flags=5) at
/home/ced/work/ksh_work/src/cmd/ksh93/sh/xec.c:2234
#4 0x000000000040f5d3 in exfile (shp=0x808320 <sh>,
iop=0x7ffff7edc4d0, fno=-1) at
/home/ced/work/ksh_work/src/cmd/ksh93/sh/main.c:603
#5 0x000000000040e81e in sh_main (ac=3, av=0x7fffffffe208,
userinit=0x0) at /home/ced/work/ksh_work/src/cmd/ksh93/sh/main.c:375
#6 0x000000000040d9f1 in main (argc=3, argv=0x7fffffffe208) at
/home/ced/work/ksh_work/src/cmd/ksh93/sh/pmain.c:45
The bug appears to be around a bit longer, I can reproduce this with
all release in August 2013.
Ced
gdb --args ~/bin/ksh -c 'builtin sum ; sum --method md5 <<<"$(seq
1000000)" ; sum --method md5 < <(seq 1000000)'
(gdb) run
Starting program: /home/ced/bin/ksh -c builtin\ sum\ \;\ sum\
--method\ md5\ \<\<\<\"\$\(seq\ 1000000\)\"\ \;\ sum\ --method\ md5\
\<\ \<\(seq\ 1000000\)
Detaching after fork from child process 58221.
Program received signal SIGSEGV, Segmentation fault.
0x00000000004250fb in io_heredoc (shp=0x808320 <sh>, iop=0x7ffff7f18970,
name=0x7ffff6aa9080
"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70"...,
traceon=0)
at /home/ced/work/ksh_work/src/cmd/ksh93/sh/io.c:1636
1636 outfile->_data[off] = 0;
(gdb) where
#0 0x00000000004250fb in io_heredoc (shp=0x808320 <sh>, iop=0x7ffff7f18970,
name=0x7ffff6aa9080
"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70"...,
traceon=0)
at /home/ced/work/ksh_work/src/cmd/ksh93/sh/io.c:1636
#1 0x00000000004236b5 in sh_redirect (shp=0x808320 <sh>,
iop=0x7ffff7f18970, flag=0) at
/home/ced/work/ksh_work/src/cmd/ksh93/sh/io.c:1146
#2 0x000000000046921d in sh_exec (shp=0x808320 <sh>,
t=0x7ffff7f188f0, flags=4) at
/home/ced/work/ksh_work/src/cmd/ksh93/sh/xec.c:1319
#3 0x000000000046c5f9 in sh_exec (shp=0x808320 <sh>,
t=0x7ffff7f18c40, flags=5) at
/home/ced/work/ksh_work/src/cmd/ksh93/sh/xec.c:2234
#4 0x000000000040f5d3 in exfile (shp=0x808320 <sh>,
iop=0x7ffff7edc4d0, fno=-1) at
/home/ced/work/ksh_work/src/cmd/ksh93/sh/main.c:603
#5 0x000000000040e81e in sh_main (ac=3, av=0x7fffffffe208,
userinit=0x0) at /home/ced/work/ksh_work/src/cmd/ksh93/sh/main.c:375
#6 0x000000000040d9f1 in main (argc=3, argv=0x7fffffffe208) at
/home/ced/work/ksh_work/src/cmd/ksh93/sh/pmain.c:45
The bug appears to be around a bit longer, I can reproduce this with
all release in August 2013.
Ced
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur