Bug 505777 - yum update segfaults
yum update segfaults
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
11
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Florian Festi
Fedora Extras Quality Assurance
:
: 506801 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-13 14:41 EDT by Stas Sergeev
Modified: 2014-01-21 18:09 EST (History)
6 users (show)

See Also:
Fixed In Version: 4.7.0-2.fc11
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-07-11 12:55:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stas Sergeev 2009-06-13 14:41:07 EDT
Description of problem:
$ sudo yum update supertuxkart
Loaded plugins: dellsysidplugin2, refresh-packagekit, refresh-updatesd
Trying other mirror.
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package supertuxkart.x86_64 0:0.6.1-2.fc11 set to be updated
--> Finished Dependency Resolution
Total size: 101 M
Выполнить [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Segmentation fault

Dependencies Resolved


Version-Release number of selected component (if applicable):
yum-3.2.22-4.fc11.noarch
rpm-4.7.0-1.fc11.x86_64

How reproducible:
Always, on my system at least.

Steps to Reproduce:
1. $ sudo yum update supertuxkart
  
Actual results:
Segmentation fault

Expected results:
Updated package

Additional info:
Program received signal SIGSEGV, Segmentation fault.
fpLookupSubdir (symlinks=<value optimized out>, fphash=<value optimized out>, 
    fpc=<value optimized out>, p=<value optimized out>, 
    filenr=<value optimized out>) at fprint.c:355
355		 while (*endbasename != '\0' && *endbasename != '/')
Current language:  auto; currently minimal
(gdb) bt
#0  fpLookupSubdir (symlinks=<value optimized out>, 
    fphash=<value optimized out>, fpc=<value optimized out>, 
    p=<value optimized out>, filenr=<value optimized out>) at fprint.c:355
#1  0x00007f6e6f99fc00 in addFingerprints (ts=0x8672530, 
    fileCount=<value optimized out>, ht=<value optimized out>, fpc=0x87ff340)
    at transaction.c:940
#2  0x00007f6e6f9a17f7 in rpmtsPrepare (ts=<value optimized out>)
    at transaction.c:1048
#3  0x00007f6e6f9a216f in rpmtsRun (ts=0x8672530, okProbs=0x0, 
    ignoreSet=116278608) at transaction.c:1187
#4  0x00007f6e6fdfa89a in rpmts_Run (s=0x8cd2db0, args=<value optimized out>, 
    kwds=<value optimized out>) at rpmts-py.c:948
#5  0x00007f6e75dcc473 in call_function (oparg=<value optimized out>, 
    pp_stack=<value optimized out>) at Python/ceval.c:3679
#6  PyEval_EvalFrameEx (oparg=<value optimized out>, 
    pp_stack=<value optimized out>) at Python/ceval.c:2370

(gdb) list
350		 }
351		 endsubdir = endbasename;
352	
353		 /* set baseName to the next lower dir */
354		 endbasename++;
355		 while (*endbasename != '\0' && *endbasename != '/')
356		      endbasename++;
357		 *endbasename = '\0';
358		 current_fp.baseName = endsubdir+1;

(gdb) p endsubdir
$8 = 0x9b0fffe ""
(gdb) p endbasename
$9 = 0x9b0ffff ""

(gdb) p *endbasename
$3 = 0 '\0'
(gdb) p endbasename[1]
Cannot access memory at address 0x9b10000

(gdb) disas $rip $rip+10
Dump of assembler code from 0x7f6e6f9715d8 to 0x7f6e6f9715e2:
0x00007f6e6f9715d8 <fpLookupSubdir+600>:	movzbl 0x1(%rax),%edx
0x00007f6e6f9715dc <fpLookupSubdir+604>:	lea    0x1(%rax),%rcx
0x00007f6e6f9715e0 <fpLookupSubdir+608>:	cmp    $0x2f,%dl
End of assembler dump.

(gdb) p /x $rax
$7 = 0x9b0ffff

So I don't know what is this all about.
Smells like a miscompilation of a good code...
Are there any known issues with gcc-4.4.0?
Comment 1 Panu Matilainen 2009-06-15 06:18:05 EDT
The full reproducer seems to be: supertuxkart update from F10 -> F11 fails due to dir/symlink replace issue, and when moving out the offending directory it crashes:

[root@localhost rpm]# rpm -Uvh /tmp/supertuxkart-0.5-2.fc10.x86_64.rpm 
warning: /tmp/supertuxkart-0.5-2.fc10.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 4ebfc273: NOKEY
Preparing...                ########################################### [100%]
   1:supertuxkart           ########################################### [100%]
[root@localhost rpm]# rpm -Uvh /tmp/supertuxkart-0.6.1-2.fc11.x86_64.rpm 
Preparing...                ########################################### [100%]
   1:supertuxkart           ########################################### [100%]
error: unpacking of archive failed on file /usr/share/supertuxkart/data/po: cpio: rename failed - Is a directory
[root@localhost rpm]# mv /usr/share/supertuxkart/data/po /usr/share/supertuxkart/data/po.xxx
[root@localhost rpm]# rpm -Uvh /tmp/supertuxkart-0.6.1-2.fc11.x86_64.rpm Preparing...                Segmentation fault

Florian, please have a look.
Comment 2 Florian Festi 2009-06-16 11:51:23 EDT
Fixed upstream. Thanks to Jakub Jelinek for helping and pointing out that is is not a gcc bug.
Comment 3 Stas Sergeev 2009-06-16 15:32:10 EDT
Hi, could you please provide a link to
the aforementioned discussion? I'd like
to educate myself about what was going
on there, since I really tried to debug it
without any success.
Comment 4 Fedora Update System 2009-06-18 12:19:26 EDT
rpm-4.7.0-2.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/rpm-4.7.0-2.fc11
Comment 5 Panu Matilainen 2009-06-18 16:16:49 EDT
*** Bug 506801 has been marked as a duplicate of this bug. ***
Comment 6 Fedora Update System 2009-06-19 09:45:18 EDT
rpm-4.7.0-2.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update rpm'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-6772
Comment 7 Fedora Update System 2009-07-11 12:54:56 EDT
rpm-4.7.0-2.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.