Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 197451

Summary: daily prelink aborts sith SIGSEGV
Product: [Fedora] Fedora Reporter: John Reiser <jreiser>
Component: prelinkAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: michal, oliva
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.3.9-2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-04 01:07:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Reiser 2006-07-01 21:05:51 UTC
Description of problem:
"prelink -av -mR -q"  gets SIGSEGV.

Version-Release number of selected component (if applicable):
prelink-0.3.8-1

How reproducible:
always

Steps to Reproduce:
1. prelink -av -mR -q
2.
3.
  
Actual results:
SIGSEGV

Expected results:
normal run to completion, no SIGSEGV

Additional info:
I run prelink by hand after "yum update" that includes firefox [etc.], in oder
to get the benefits of prelinking without waiting for daily update.

LANG=en_US.UTF-8

Here is the traceback under gdb:
# gdb /usr/sbin/prelink
GNU gdb Red Hat Linux (6.3.0.0-1.132.FC6rh)
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".

(gdb) run -av -mR -q
Starting program: /usr/sbin/prelink -av -mR -q
warning: shared library handler failed to enable breakpoint

Program received signal SIGSEGV, Segmentation fault.
deps_cmp (A=0x7fffbf7c5b38, B=0x7fffbf7c5ba8) at cache.c:344
344       if (a->type == ET_NONE && b->type != ET_NONE)
(gdb) bt
#0  deps_cmp (A=0x7fffbf7c5b38, B=0x7fffbf7c5ba8) at cache.c:344
#1  0x000000000043d46b in msort_with_tmp ()
#2  0x000000000043d3b5 in msort_with_tmp ()
#3  0x000000000043d3cb in msort_with_tmp ()
#4  0x000000000043d3b5 in msort_with_tmp ()
#5  0x000000000043d3b5 in msort_with_tmp ()
#6  0x000000000043d3cb in msort_with_tmp ()
#7  0x000000000043d3b5 in msort_with_tmp ()
#8  0x000000000043d3b5 in msort_with_tmp ()
#9  0x000000000043d5e2 in qsort ()
#10 0x0000000000400fbd in prelink_load_cache () at cache.c:465
#11 0x000000000040e040 in main (argc=4, argv=0x7fffbf7cbf98) at main.c:390
#12 0x0000000000436bb0 in __libc_start_main ()
#13 0x00000000004001b9 in _start ()
#14 0x00007fffbf7cbf88 in ?? ()
#15 0x0000000000000000 in ?? ()
(gdb) info reg
rax            0x0      0
rbx            0x8      8
rcx            0x0      0
rdx            0x0      0
rsi            0x7fffbf7c5ba8   140736405986216
rdi            0x7fffbf7c5b38   140736405986104
rbp            0x1      0x1
rsp            0x7fffbf7c47f8   0x7fffbf7c47f8
r8             0x830dc8 8588744
r9             0x73c700 7587584
r10            0x7fffbf7c5b40   140736405986112
r11            0x206    518
r12            0x1b     27
r13            0x1      1
r14            0x7fffbf7c5ba8   140736405986216
r15            0x830d00 8588544
rip            0x400310 0x400310 <deps_cmp+16>
eflags         0x10246  66118
cs             0x33     51
ss             0x2b     43
ds             0x0      0
es             0x0      0
fs             0x63     99
---Type <return> to continue, or q <return> to quit---
gs             0x0      0
(gdb) x/5i $pc
0x400310 <deps_cmp+16>: mov    0x58(%rdx),%edi
0x400313 <deps_cmp+19>: test   %edi,%edi
0x400315 <deps_cmp+21>: jne    0x40033b <deps_cmp+59>
0x400317 <deps_cmp+23>: mov    0x58(%rax),%esi
0x40031a <deps_cmp+26>: test   %esi,%esi
(gdb) x/16i $pc-0x20
0x4002f0 <filename_hash+48>:    lock mov %esi,%edx
0x4002f3 <filename_hash+51>:    shl    $0x11,%edx
0x4002f6 <filename_hash+54>:    add    %ecx,%eax
0x4002f8 <filename_hash+56>:    add    %eax,%edx
0x4002fa <filename_hash+58>:    mov    %edx,%eax
0x4002fc <filename_hash+60>:    retq
0x4002fd <filename_hash+61>:    data16
0x4002fe <filename_hash+62>:    data16
0x4002ff <filename_hash+63>:    nop
0x400300 <deps_cmp>:    mov    (%rdi),%rdx
0x400303 <deps_cmp+3>:  mov    (%rsi),%rax
0x400306 <deps_cmp+6>:  test   %rdx,%rdx
0x400309 <deps_cmp+9>:  je     0x400330 <deps_cmp+48>
0x40030b <deps_cmp+11>: test   %rax,%rax
0x40030e <deps_cmp+14>: je     0x400342 <deps_cmp+66>
0x400310 <deps_cmp+16>: mov    0x58(%rdx),%edi
(gdb) x/xg $rdi
0x7fffbf7c5b38: 0x0000000000000000
(gdb) x/xg $rsi
0x7fffbf7c5ba8: 0x0000000000000000
(gdb)

Comment 1 Alexandre Oliva 2006-07-28 20:01:28 UTC
Fixed in the upcoming prelink-0.3.9-2.

Comment 2 Michal Jaegermann 2006-07-29 19:42:59 UTC
*** Bug 200160 has been marked as a duplicate of this bug. ***