<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>3656</bug_id>
          
          <creation_ts>2012-12-28 09:12:02 +0000</creation_ts>
          <short_desc>rpm2cpio: Segmentation fault</short_desc>
          <delta_ts>2017-07-20 16:02:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>11</classification_id>
          <classification>Runtime</classification>
          <product>Package Management Issues</product>
          <component>RPM</component>
          <version>1.4</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Yi Zhao">yi.zhao</reporter>
          <assigned_to name="Mark Hatle">mark.hatle</assigned_to>
          <cc>bluelightning</cc>
    
    <cc>hongxu.jia</cc>
    
    <cc>jeff.polk</cc>
    
    <cc>kai.kang</cc>
    
    <cc>liang.li2</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>n3npq</cc>
    
    <cc>Qi.Chen</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>28481</commentid>
    <comment_count>0</comment_count>
    <who name="Yi Zhao">yi.zhao</who>
    <bug_when>2012-12-28 09:12:02 +0000</bug_when>
    <thetext>Image location: http://autobuilder.yoctoproject.org/pub/nightly/20121226-1/
Tree/Branch: poky/master
Git commit: 4a36a32567ecfbc7ce7b967803e6e23314953ef5

Download the rpm-common package from autobuilder: http://autobuilder.yoctoproject.org/pub/nightly/20121226-1/rpm/

Install this package to the target and run rpm2cpio to extract cpio archive from a rpm package:
###########
root@qemuarm:~# rpm -ivh rpm-common-5.4.9-r60.armv5te.rpm 
Preparing...                ########################################### [100%]
   1:rpm-common             ########################################### [100%]
root@qemuarm:~# 
root@qemuarm:~# rpm2cpio rpm-5.4.9-r60.armv5te.rpm 
Segmentation fault
##########

This command segfault on all target.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30220</commentid>
    <comment_count>1</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2013-02-28 07:34:53 +0000</bug_when>
    <thetext>rpm config files are not parsed, so no &quot;_db_path&quot; defined. When query &quot;_db_path&quot;, it returns nothing and causes segmentation fault.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32272</commentid>
    <comment_count>2</comment_count>
    <who name="Kai Kang">kai.kang</who>
    <bug_when>2013-04-17 09:17:52 +0000</bug_when>
    <thetext>Patch v2 has been sent to oe-core, and postpone it to 1.5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32602</commentid>
    <comment_count>3</comment_count>
    <who name="Jeff Johnson">n3npq</who>
    <bug_when>2013-04-24 16:51:13 +0000</bug_when>
    <thetext>The simplest fix of all is to use rpm2cpio.sh, an ~38 line
shell script.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44881</commentid>
    <comment_count>4</comment_count>
    <who name="Jeff Polk">jeff.polk</who>
    <bug_when>2014-07-31 15:05:36 +0000</bug_when>
    <thetext>Mark asked me to move this to future. The script works correctly but he&apos;d like to keep the reminder to check whether it&apos;s fixed in future versions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44900</commentid>
    <comment_count>5</comment_count>
    <who name="Jeff Johnson">n3npq</who>
    <bug_when>2014-07-31 18:11:15 +0000</bug_when>
    <thetext>Using rpm2cpio.sh is still the best fix for Yocto imho.

The segfault comes from attempting to locate
the pubkey needed to verify the header signature
in the rpmdb Pubkeys index. The path to the
rpmdb is stored in in the %_dbpath macro.

The rpmdb pubkey lookup is now (rpm-5.4.15) skipped if %_dbpath
isn&apos;t set (which fixes the segfault).

Implicitly disabling package signature verification
depending on macro (mis-)configuration may not be
supportable when rpmlib needs to always verify signatures.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49052</commentid>
    <comment_count>6</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-02-25 15:48:36 +0000</bug_when>
    <thetext>http://patchwork.openembedded.org/patch/59135/ is the patch that Kai sent, and Mark rejected it.  Mark/Kai - presumably this is still a problem - can someone revisit this and prepare a correct patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49053</commentid>
    <comment_count>7</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2015-02-25 15:58:10 +0000</bug_when>
    <thetext>This is still a bug, but we moved to using the script version of rpm2cpio on the rpm-native side.  Thus this is very low priority.

It might be fixed at some point in the future, but it&apos;s really an issue on how the recent binary versions of rpm2cpio inteface w/ the rpmlib and rpmlib interfaces with external files.  (None of that is actually needed for our usage case, thus the scripted version works fine.)

The bug was left open, because well.. it is a bug.  (very low priority) We&apos;re just going to continue to monitor the situation, and we&apos;ll fix it if/when the upstream design changes.

Again, this only affects rpm-native, not the target rpm.

--Mark</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49056</commentid>
    <comment_count>8</comment_count>
    <who name="Jeff Johnson">n3npq</who>
    <bug_when>2015-02-25 16:35:29 +0000</bug_when>
    <thetext>There&apos;s a modest improvement to rpm2cpio.sh for Cygwin
available here:

    http://stackoverflow.com/questions/18787375/how-do-i-extract-the-contents-of-an-rpm/25986787#25986787</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75201</commentid>
    <comment_count>9</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2017-07-20 16:02:23 +0000</bug_when>
    <thetext>rpm2cpio works fine with rpm v4 so closing this a resolved.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>