Opened 10 years ago

Last modified 10 years ago

#44353 new defect

rpm @ 4.4.9 segfault querying rpm files

Reported by: ric@… Owned by: afb@…
Priority: Normal Milestone:
Component: ports Version: 2.3.1
Keywords: Cc: n3npq@…, cooljeanius (Eric Gallager)
Port: rpm

Description (last modified by mf2k (Frank Schima))

I've tried this with several rpm files that seem fine on Linux, but cause the macports rpm to segfault: System info: macbook pro 15 inch not retina, mid 2012, MacOS 10.9.4, xcode 5.1.1 (5B1008)

Actual output from ports rpm

$ rpm -q -l -p opencl-1.2-devel-4.4.0.134-1.x86_64.rpm 
Segmentation fault: 11

Expected output (command run on an RHEL6 linux system for reference)

$ rpm -q -l -p opencl-1.2-devel-4.4.0.134-1.x86_64.rpm 
warning: opencl-1.2-devel-4.4.0.134-1.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID f789186f: NOKEY
/opt/intel
/opt/intel/opencl-1.2-sdk-4.4.0.134
/opt/intel/opencl-1.2-sdk-4.4.0.134/include
/opt/intel/opencl-1.2-sdk-4.4.0.134/include/CL
/opt/intel/opencl-1.2-sdk-4.4.0.134/include/CL/cl.h
/opt/intel/opencl-1.2-sdk-4.4.0.134/include/CL/cl.hpp
/opt/intel/opencl-1.2-sdk-4.4.0.134/include/CL/cl_ext.h
/opt/intel/opencl-1.2-sdk-4.4.0.134/include/CL/cl_gl.h
/opt/intel/opencl-1.2-sdk-4.4.0.134/include/CL/cl_gl_ext.h
/opt/intel/opencl-1.2-sdk-4.4.0.134/include/CL/cl_platform.h
/opt/intel/opencl-1.2-sdk-4.4.0.134/include/CL/opencl.h

Attachments (1)

tzdata-2014e-1.el5.x86_64.rpm (787.3 KB) - added by ric@… 10 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 10 years ago by mf2k (Frank Schima)

Cc: n3npq@… added
Description: modified (diff)
Owner: changed from macports-tickets@… to afb@…
Port: rpm added

In the future, please use WikiFormatting, fill in the Port field and Cc the port maintainers (port info --maintainers rpm).

comment:2 Changed 10 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:3 Changed 10 years ago by afb@…

In general the MacPorts version of rpm is only intended for Darwin packages, and is not guaranteed to be compatible with RHEL6 and RHEL7. You could try a newer version (5.x), but otherwise you need to provide the actual package for anyone to try to help you. Or just use rpm2cpio...

Changed 10 years ago by ric@…

comment:4 Changed 10 years ago by ric@…

I've attached the CentOS 5 tzdata rpm which is small and demonstrates the segv.

comment:5 Changed 10 years ago by ric@…

further note: md5sum tzdata-2014e-1.el5.x86_64.rpm on originating host: aeba628d7a7d9aeeb0bd8db41c08e3a5 rpm 4.4.2 on CentOS 5 has no problem listing the content of the above rpm.

comment:6 Changed 10 years ago by afb@…

Okay, the problem is when the old rpm is trying to open an old sqlite database that hasn't been initialized.

D: Expected size:       806196 = lead(96)+sigs(344)+pad(0)+data(805756)
D:   Actual size:       806196
D: opening  sql db         /opt/local/var/lib/rpm/Packages (Packages) mode=0x2
D:   stat on Packages nkeys 2
D: opening  sql db         /opt/local/var/lib/rpm/Pubkeys (Pubkeys) mode=0x2
D: Unable to open database: unable to open database file
D: closed   sql db         Pubkeys
Segmentation fault

If you create the database first, by importing the required key, there is no segfault with the signed package.

$ /opt/local/bin/gpg --recv-key a8a447dce8562897
gpg: requesting key E8562897 from hkp server keys.gnupg.net
gpg: key E8562897: public key "CentOS-5 Key (CentOS 5 Official Signing Key) <centos-5-key@centos.org>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
$ /opt/local/bin/gpg --export --armor e8562897 > e8562897.asc
$ sudo /opt/local/bin/rpm --import e8562897.asc

This is similar to the crash seen with the regular database*. I suppose one could backport the lazy db init ?

Newer versions (since 4.5) don't need to run --initdb any longer.

http://rpm5.org/community/rpm-devel/1443.html

comment:7 Changed 10 years ago by afb@…

MacPorts didn't/doesn't by default sign the rpm packages that it creates...

Also note that RHEL5 uses 4.4.2.3 and not 4.4.2 (yes, there is a difference)

Last edited 10 years ago by afb@… (previous) (diff)
Note: See TracTickets for help on using tickets.