NetBSD-Bugs archive

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

bin/52302: sh segfault



>Number:         52302
>Category:       bin
>Synopsis:       sh segfault
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun 15 19:25:00 +0000 2017
>Originator:     coypu
>Release:        NetBSD 8.99.1
>Organization:
>Environment:
NetBSD loggy 8.99.1 NetBSD 8.99.1 (GENERIC) #77: Thu Jun 15 17:12:52 IDT 2017  fly@loggy:/home/fly/obj/sys/arch/amd64/compile/GENERIC amd64

>Description:
Source date Thu Jun 15 22:18:32 IDT 2017

This was attempted as a result of a miscommunication, but caused sh to segfault.
segfault is probably never the right thing.

loggy$ gdb /bin/sh
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64--netbsd".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /bin/sh...done.
(gdb) r
Starting program: /bin/sh 
loggy$ <<su root -c "sh script.sh">>
sh: 1: Syntax error: newline unexpected
loggy$ 
loggy$ ls
> ^Dsh: 3: Syntax error: EOF reading here (<<) document
loggy$ 
loggy$ 
loggy$ ls

Program received signal SIGSEGV, Segmentation fault.
readheredocs () at parser.c:954
954			line = heredoclist->startline + 1;
(gdb) bt full
#0  readheredocs () at parser.c:954
        here = <optimized out>
        n = <optimized out>
        line = 0
        l = <optimized out>
#1  0x0000000179615e83 in list (nlflag=nlflag@entry=1, erflag=erflag@entry=0) at parser.c:222
        n1 = 0x1798271b8 <stackbase+56>
        n2 = 0x1798271b8 <stackbase+56>
        n3 = <optimized out>
        tok = 1
#2  0x00000001796176d4 in parsecmd (interact=<optimized out>) at parser.c:166
        t = <optimized out>
        n = <optimized out>
#3  0x000000017961217c in cmdloop (top=1) at main.c:277
        n = <optimized out>
        smark = {stackp = 0x179827180 <stackbase>, stacknxt = 0x179827188 <stackbase+8> "ls", stacknleft = 504, 
          marknext = 0x0}
        inter = <optimized out>
        numeof = 0
        skip = <optimized out>
#4  0x00000001796126f2 in main (argc=1, argv=0x7f7fff51c688) at main.c:240
        jmploc = {loc = {140187721125856, 6333557024, 140187721123440, 0, 7442952784, 0, 140187721123224, 6331376595, 
            6333555680, 140187721125856, 140187721125856}}
        smark = {stackp = 0x179827180 <stackbase>, stacknxt = 0x179827188 <stackbase+8> "ls", stacknleft = 504, 
          marknext = 0x0}
        state = 4
        shinit = <optimized out>
        uid = 1000
        gid = 100

>How-To-Repeat:

>Fix:



Home | Main Index | Thread Index | Old Index