[Bug 382214] New: bash script aborts with memory dump if interpreter not specified on first line
https://bugzilla.novell.com/show_bug.cgi?id=382214 User osl2008@googlemail.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c1 Summary: bash script aborts with memory dump if interpreter not specified on first line Product: openSUSE 11.0 Version: Beta 1 Platform: Macintosh OS/Version: openSUSE 11.0 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: osl2008@googlemail.com QAContact: qa@suse.de Found By: --- This works as expected: rpm@iMac:~> cat test #! /bin/bash ls -al .. but this gives a memory dump: rpm@iMac:~> cat test ls -al rpm@iMac:~> ./test *** glibc detected *** -bash: munmap_chunk(): invalid pointer: 0x200dec48 *** ======= Backtrace: ========= /lib/libc.so.6[0x1fdef2d8] -bash[0x2003db00] -bash(hash_flush+0xb4)[0x2005d074] -bash(delete_all_contexts+0x44)[0x20037598] -bash(main+0x1720)[0x2001ef40] /lib/libc.so.6[0x1fd91b60] /lib/libc.so.6[0x1fd91cfc] ======= Memory map: ======== 00100000-00103000 r-xp 00100000 00:00 0 it doesn't seem to matter what the script contents are (problem found when scripting a vncserver) Platform is OSL-11.0 Beta 1 on iMac G3 (PPC) rpm@iMac:~> uname -a Linux iMac 2.6.25-rc9-17-default #1 2008-04-15 22:54:53 +0200 ppc ppc ppc GNU/Linux -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 Martin Mrazik <mmrazik@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team-screening@forge.provo.novell.com |werner@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c1 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |osl2008@googlemail.com Platform|Macintosh |PowerPC --- Comment #1 from Dr. Werner Fink <werner@novell.com> 2008-04-22 03:27:13 MST --- Does it depend on the script name? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User osl2008@googlemail.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c2 richard meek <osl2008@googlemail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|osl2008@googlemail.com | --- Comment #2 from richard meek <osl2008@googlemail.com> 2008-04-22 03:37:38 MST --- No - first time it was ~/bin/v.sh (to start vnc server), second time I used ~/test. Just tried again as root, filename /etc/anewfilename, same behaviour: iMac:~ # cat /etc/anewfilename #! /bin/bash ls -al iMac:~ # /etc/anewfilename total 48 drwx------ 9 root root 4096 Apr 22 10:34 . iMac:~ # vi /etc/anewfilename (first line deleted) iMac:~ # /etc/anewfilename *** glibc detected *** -bash: corrupted double-linked list: 0x200dd478 *** ======= Backtrace: ========= /lib/libc.so.6[0x1fdef2d8] /lib/libc.so.6[0x1fdef630] /lib/libc.so.6[0x1fdf217c] /lib/libc.so.6(__libc_malloc+0xe0)[0x1fdf3f98] /lib/libc.so.6(qsort_r+0xbc)[0x1fdab7f8] -bash(initialize_shell_builtins+0x3c)[0x2007b16c] -bash[0x2001cf44] -bash(main+0x448)[0x2001dc68] /lib/libc.so.6[0x1fd91b60] /lib I don't think I saw this problem on an x86 machine at home yesterday though? Will confirm tonight... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c3 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenther@novell.com, mfabian@suse.de, | |matz@novell.com Platform|PowerPC |All --- Comment #3 from Dr. Werner Fink <werner@novell.com> 2008-04-22 04:07:54 MST --- Happens on all architectures with different results. And as the bash didn't changed since * Wed Apr 02 2008 werner@suse.de - Allow to (re)send signals within trap handlers (bnc#345441) - Clear exit status if not sourcing system profile (bnc#372061) but the gcc a lot I'd like to add the gcc maintainers. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c4 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mfabian@novell.com --- Comment #4 from Dr. Werner Fink <werner@novell.com> 2008-04-22 04:08:12 MST --- Happens on all architectures with different results. And as the bash didn't changed since * Wed Apr 02 2008 werner@suse.de - Allow to (re)send signals within trap handlers (bnc#345441) - Clear exit status if not sourcing system profile (bnc#372061) but the gcc a lot I'd like to add the gcc maintainers. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User mfabian@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c5 --- Comment #5 from Mike Fabian <mfabian@novell.com> 2008-04-22 04:09:16 MST --- I suffer from the same problem. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User mfabian@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c6 --- Comment #6 from Mike Fabian <mfabian@novell.com> 2008-04-22 05:13:31 MST --- Seems to have something to do with SHLVL: mfabian@magellan:~$ sudo su - root@magellan:~$ /home/mfabian/bin/worldtimes → coredump root@magellan:~# env | sort | uniq > /tmp/env1 root@magellan:~# sh root@magellan:~# env | sort | uniq > /tmp/env2 root@magellan:~# diff /tmp/env{1,2} 64c64 < SHLVL=1 ---
SHLVL=2 root@magellan:~# /home/mfabian/bin/worldtimes US/Pacific Tue Apr 22 04:11:40 2008 PDT Navajo Tue Apr 22 05:11:40 2008 MDT US/Mountain Tue Apr 22 05:11:40 2008 MDT US/Central Tue Apr 22 06:11:40 2008 CDT US/Eastern Tue Apr 22 07:11:40 2008 EDT Canada/Eastern Tue Apr 22 07:11:40 2008 EDT Greenwich Tue Apr 22 11:11:40 2008 GMT UTC Tue Apr 22 11:11:40 2008 UTC MET Tue Apr 22 13:11:40 2008 MEST Asia/Hong_Kong Tue Apr 22 19:11:40 2008 HKT Asia/Seoul Tue Apr 22 20:11:40 2008 KST Japan Tue Apr 22 20:11:40 2008 JST root@magellan:~# cat /home/mfabian/bin/worldtimes /usr/sbin/zdump US/Pacific Navajo US/Mountain US/Central US/Eastern Canada/Eastern Greenwich UTC MET Asia/Hong_Kong Asia/Seoul Japan
root@magellan:~# -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c7 --- Comment #7 from Dr. Werner Fink <werner@novell.com> 2008-04-22 09:53:40 MST --- The is more then SHLVL=1 required, as I'm not able to reproduce this within an chroot environmenta for clean building. Also it seems to be required to use `su -' as root it does not help to use `su -' as user which would provide both a SHLVL=1 root shell. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |osl2008@googlemail.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c8 --- Comment #8 from Dr. Werner Fink <werner@novell.com> 2008-04-24 09:20:03 MST --- Created an attachment (id=210248) --> (https://bugzilla.novell.com/attachment.cgi?id=210248) bash-3.2-101.ppc.rpm Please test out this version. Does it avoid the abort from the glibc memory checker? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User osl2008@googlemail.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c9 richard meek <osl2008@googlemail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|osl2008@googlemail.com | --- Comment #9 from richard meek <osl2008@googlemail.com> 2008-04-25 00:45:16 MST --- Not very positive, I'm sorry to report: rpm@iMac:~> su - Password: iMac:~ # cd /home/rpm iMac:/home/rpm # rpm -Uhv bug-382214_bash-3.2-101.ppc.rpm Preparing... ########################################### [100%] 1:bash ########################################### [100%] iMac:/home/rpm # exit logout rpm@iMac:~> cat test2 #! /bin/bash ls -al rpm@iMac:~> ./test2 total 832 drwxr-xr-x 24 rpm users 4096 2008-04-25 07:43 . drwxr-xr-x 5 root root 4096 2008-04-22 11:42 .. -rw-r--r-- 1 rpm users 284321 2008-04-22 11:44 374693-21.log <snipped> rpm@iMac:~> cat test ls -al rpm@iMac:~> ./test - never comes back. No response to ^C etc. - can login on other tty / ssh, no process called "test" Anything else to try? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User osl2008@googlemail.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c10 --- Comment #10 from richard meek <osl2008@googlemail.com> 2008-04-25 01:00:20 MST --- Demonstrating to a colleague, I tried again (on a new tty), and got a memory dump: rpm@iMac:~> ./test *** glibc detected *** -bash: munmap_chunk(): invalid pointer: 0x200dec48 *** ======= Backtrace: ========= /lib/libc.so.6[0x1fdef2d8] -bash[0x2003db80] -bash(hash_flush+0xb4)[0x2005d0f4] -bash(delete_all_contexts+0x44)[0x20037618] -bash(main+0x1720)[0x2001ef70] /lib/libc.so.6[0x1fd91b60] /lib/libc.so.6[0x1fd91cfc] ======= Memory map: ======== 00100000-00103000 r-xp 00100000 00:00 0 1fd73000-1febd000 r-xp 00000000 03:05 55903 /lib/libc-2.8.so 1febd000-1fecd000 ---p 0014a000 03:05 55903 /lib/libc-2.8.so <snip> This time I got my prompt back! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c11 --- Comment #11 from Dr. Werner Fink <werner@novell.com> 2008-04-25 03:44:48 MST --- The only problem is the backtrace is corrupted as the memory its self after the bash had tried to fork a subshell to try to execute the script within a sub shell. There is no execve() but a longjmp() back to the start within main() in the fork()ed sub shell. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c12 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210248|0 |1 is obsolete| | --- Comment #12 from Dr. Werner Fink <werner@novell.com> 2008-04-25 07:11:36 MST --- Created an attachment (id=210499) --> (https://bugzilla.novell.com/attachment.cgi?id=210499) bash-3.2-101.ppc.rpm Next try, just do as the tcsh does, execute /bin/sh. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |osl2008@googlemail.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User osl2008@googlemail.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c13 richard meek <osl2008@googlemail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED Info Provider|osl2008@googlemail.com | --- Comment #13 from richard meek <osl2008@googlemail.com> 2008-04-25 07:56:11 MST --- Had to revert to 11.0-Beta1 version first: iMac:/home/rpm # rpm -Uhv bug-382214_bash-3.2-101.ppc.rpm Preparing... ########################################### [100%] package bash-3.2-101 is already installed file /bin/bash from install of bash-3.2-101 conflicts with file from package bash-3.2-101 file /usr/bin/bashbug from install of bash-3.2-101 conflicts with file from package bash-3.2-101 (used YaST to re-install standard version) iMac:/home/rpm # rpm -q bash bash-3.2-99 iMac:/home/rpm # rpm -Uhv bug-382214_bash-3.2-101.ppc.rpm Preparing... ########################################### [100%] 1:bash ########################################### [100%] iMac:/home/rpm # exit logout {rebooted at this point} rpm@iMac:~> /bin/sh iMac:~> iMac:~> echo $SHLVL 2 iMac:~> ./test total 832 drwxr-xr-x 24 rpm users 4096 2008-04-25 14:52 . drwxr-xr-x 5 root root 4096 2008-04-22 11:42 .. -rw-r--r-- 1 rpm users 284321 2008-04-22 11:44 374693-21.log -rw------- 1 rpm users 1840 2008-04-25 14:52 .bash_history <snip> iMac:~> echo $SHLVL 2 iMac:~> /bin/bash rpm@iMac:~> echo $SHLVL 3 rpm@iMac:~> ./test total 832 drwxr-xr-x 24 rpm users 4096 2008-04-25 07:43 . drwxr-xr-x 5 root root 4096 2008-04-22 11:42 .. -rw-r--r-- 1 rpm users 284321 2008-04-22 11:44 374693-21.log Looks like a fix to me -many thanks! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c14 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #14 from Dr. Werner Fink <werner@novell.com> 2008-04-25 08:15:02 MST --- close as fixed -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User ro@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c15 Ruediger Oertel <ro@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ro@novell.com, gregkh@novell.com Status|RESOLVED |REOPENED Resolution|FIXED | --- Comment #15 from Ruediger Oertel <ro@novell.com> 2008-04-27 18:01:59 MST --- sorry, but this breaks the ARGV counter (found cause it breaks our kernel builds): # cat foo.sh # Substitute CONFIG_ variables echo "arg 1 = $1" echo "arg 2 = $2" # cat foo.sh | /root/foo.sh F G arg 1 = G arg 2 = -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User gregkh@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c16 --- Comment #16 from Greg Kroah-Hartman <gregkh@novell.com> 2008-04-27 19:26:23 MST --- So is this causing a kernel build error on the servers? Or somewhere else? The kernel doesn't seem to be involved in the problem though, right? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User matz@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c17 --- Comment #17 from Michael Matz <matz@novell.com> 2008-04-27 19:51:17 MST --- I fixed the patch for this work-around. I did _not_ look at the real cause, someone eventually will have to debug the original problem for real. Greg: I guess Rudi CCed you only because you might want to know that one of your scripts is a shell script and executable but doesn't contain a #! shebang. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User ro@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c18 --- Comment #18 from Ruediger Oertel <ro@novell.com> 2008-04-28 02:30:41 MST --- the script in the kernel is "config-subst". I have checked in a kernel for STABLE to change that temporarily to fix build. the build has abortedin make oldconfig with CONFIG_EXPERIMENTAL not defined -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c19 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mboman@novell.com --- Comment #19 from Dr. Werner Fink <werner@novell.com> 2008-04-28 03:21:27 MST --- *** Bug 384175 has been marked as a duplicate of this bug. *** https://bugzilla.novell.com/show_bug.cgi?id=384175 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=382214 User werner@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=382214#c20 Dr. Werner Fink <werner@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution| |FIXED --- Comment #20 from Dr. Werner Fink <werner@novell.com> 2008-04-28 03:29:16 MST --- Accordingly to comment #15 from Michael this bug is fixed now. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com