Bug 17765

Summary: sh in free(): warning: junk pointer, too low to make sense.
Product: Base System Reporter: Andre Albsmeier <Andre.Albsmeier>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.4-STABLE   
Hardware: Any   
OS: Any   

Description Andre Albsmeier 2000-04-03 08:00:02 UTC
There have been some recent changes to /bin/sh. I have observed
the above error message with a shell script that ran fine before.

Fix: 

Unknown. If you want me to test something or have some fix, tell me.
How-To-Repeat: 
Until now, I observed the errorneous behaviour only with this special
shell script. I won't post it here since it is quite long and will
only run in my environment. However, if someone ist still interested
in it, please let me now and I will send it in private mail.

I have compiled sh with -g and ran the script within it and gdb:

root@bali:/people/andre/x>gdb ./sh
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
(gdb) set args ./csf cu pr se ba
(gdb) run
Starting program: ./sh ./csf cu pr se ba

checking hosts:....
unreachable: none
targets: 4


Files in /server/FreeBSD/conf/3/curry:
-----------------------------------------------------------------------
sh in free(): warning: junk pointer, too low to make sense.

Program received signal SIGSEGV, Segmentation fault.
popstackmark (mark=0xbfbfd6e0) at /src/src-3/bin/sh/memalloc.c:191
191                     stackp = sp->prev;
(gdb) where
#0  popstackmark (mark=0xbfbfd6e0) at /src/src-3/bin/sh/memalloc.c:191
#1  0x804b069 in evalfor (n=0x80ac948) at /src/src-3/bin/sh/eval.c:364
#2  0x804ad76 in evaltree (n=0x80ac948, flags=0)
    at /src/src-3/bin/sh/eval.c:251
#3  0x804ad54 in evaltree (n=0x80acd64, flags=0)
    at /src/src-3/bin/sh/eval.c:241
#4  0x804ac2b in evaltree (n=0x80acdc4, flags=0)
    at /src/src-3/bin/sh/eval.c:203
#5  0x804ad54 in evaltree (n=0x80ac558, flags=0)
    at /src/src-3/bin/sh/eval.c:241
#6  0x804ad54 in evaltree (n=0x80acdd4, flags=0)
    at /src/src-3/bin/sh/eval.c:241
#7  0x804ac2b in evaltree (n=0x80ace50, flags=0)
    at /src/src-3/bin/sh/eval.c:203
#8  0x804ac2b in evaltree (n=0x80acf28, flags=0)
    at /src/src-3/bin/sh/eval.c:203
#9  0x804ac2b in evaltree (n=0x80ae760, flags=0)
    at /src/src-3/bin/sh/eval.c:203
#10 0x804ac2b in evaltree (n=0x80ae7c0, flags=0)
    at /src/src-3/bin/sh/eval.c:203
#11 0x804ac2b in evaltree (n=0x80ae824, flags=0)
    at /src/src-3/bin/sh/eval.c:203
#12 0x804ac2b in evaltree (n=0x80ae8fc, flags=0)
    at /src/src-3/bin/sh/eval.c:203
#13 0x804ac2b in evaltree (n=0x80af128, flags=0)
    at /src/src-3/bin/sh/eval.c:203
#14 0x804ac2b in evaltree (n=0x80af188, flags=0)
    at /src/src-3/bin/sh/eval.c:203
#15 0x804afe2 in evalfor (n=0x80a55ec) at /src/src-3/bin/sh/eval.c:351
#16 0x804ad76 in evaltree (n=0x80a55ec, flags=0)
    at /src/src-3/bin/sh/eval.c:251
#17 0x805266b in cmdloop (top=1) at /src/src-3/bin/sh/main.c:254
#18 0x8052583 in main (argc=6, argv=0xbfbfd904) at /src/src-3/bin/sh/main.c:203
#19 0x80480ed in _start ()
Comment 1 Martin Cracauer 2000-04-03 08:33:43 UTC
In <200004030657.IAA17316@internal>, Andre Albsmeier wrote: 
> There have been some recent changes to /bin/sh. I have observed
> the above error message with a shell script that ran fine before.
> 
> >How-To-Repeat:
> 
> Until now, I observed the errorneous behaviour only with this special
> shell script. I won't post it here since it is quite long and will
> only run in my environment. However, if someone ist still interested
> in it, please let me now and I will send it in private mail.

Please send me a copy.

Thanks
	Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer/
  Tel.: (private) +4940 5221829 Fax.: (private) +4940 5228536
Comment 2 Martin Cracauer freebsd_committer freebsd_triage 2000-09-07 07:51:55 UTC
State Changed
From-To: open->closed

Author says it is fixed in 
20000907070059.A80754@curry.mchp.siemens.de