git-apply segfault.

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

git-apply segfault.

From: Dave Jones <hidden>
Date: 2016-06-15 22:42:18

I managed to get git-apply to segfault.

(18:35:37:davej@hera:agpgart)$ apply-mbox ~/Mail/mbox

Applying 'help text updates'

/home/davej/bin/applypatch: line 64: 17990 Segmentation fault      (core dumped) git-apply --index $PATCHFILE
(18:35:40:davej@hera:agpgart)$ file core
core: ELF 64-bit LSB core file AMD x86-64, version 1 (SYSV), SVR4-style, from 'git-apply'
(18:35:45:davej@hera:agpgart)$ gdb `which git-apply` core
GNU gdb Red Hat Linux (6.3.0.0-1.84rh)
Copyright 2004 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 "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/libthread_db.so.1".

Core was generated by `git-apply --index .dotest/patch'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib64/libz.so.1...done.
Loaded symbols for /usr/lib64/libz.so.1
Reading symbols from /lib64/libcrypto.so.5...done.
Loaded symbols for /lib64/libcrypto.so.5
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
#0  0x0000003287f73474 in memset () from /lib64/libc.so.6
(gdb) bt
#0  0x0000003287f73474 in memset () from /lib64/libc.so.6
#1  0x0000003287f6c92a in calloc () from /lib64/libc.so.6
#2  0x0000000000407399 in read_cache () at read-cache.c:537
#3  0x0000000000404e1b in apply_patch (fd=-1) at apply.c:1749
#4  0x0000000000405632 in main (argc=3, argv=0x7fffff841c38) at apply.c:1860
#5  0x0000003287f1c3cf in __libc_start_main () from /lib64/libc.so.6
#6  0x0000000000402459 in _start ()
#7  0x00007fffff841c28 in ?? ()
#8  0x0000000000000000 in ?? ()


git on hera is 1.1.6-1

		Dave

Re: git-apply segfault.

From: Linus Torvalds <torvalds@osdl.org>
Date: 2016-06-15 22:42:18


On Fri, 10 Feb 2006, Dave Jones wrote:
(gdb) bt
#0  0x0000003287f73474 in memset () from /lib64/libc.so.6
#1  0x0000003287f6c92a in calloc () from /lib64/libc.so.6
#2  0x0000000000407399 in read_cache () at read-cache.c:537
Ouch. Looks like malloc heap corruption.
git on hera is 1.1.6-1
Can you try running "valgrind" on it? That should show what corrupts the 
heap.

		Linus

Re: git-apply segfault.

From: Dave Jones <hidden>
Date: 2016-06-15 22:42:18

On Fri, Feb 10, 2006 at 11:22:46AM -0800, Linus Torvalds wrote:
 > 
 > 
 > On Fri, 10 Feb 2006, Dave Jones wrote:
 > >
 > > (gdb) bt
 > > #0  0x0000003287f73474 in memset () from /lib64/libc.so.6
 > > #1  0x0000003287f6c92a in calloc () from /lib64/libc.so.6
 > > #2  0x0000000000407399 in read_cache () at read-cache.c:537
 > 
 > Ouch. Looks like malloc heap corruption.

Indeed. Self-inflicted in this case.

 > > git on hera is 1.1.6-1
 > Can you try running "valgrind" on it? That should show what corrupts the 
 > heap.

Actually it's a glibc bug (fixed last September, but not backported to older releases).
Jakub is working on an FC4 update.

(It also only hits you if you're a loony and have something like
 export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
 in your ~/.bashrc)

		Dave
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help