Bug 433795 - When building rpm bigger than 2G, rpmbuild fails with segmentation fault
Summary: When building rpm bigger than 2G, rpmbuild fails with segmentation fault
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: rpm
Version: 4.6
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Panu Matilainen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-02-21 14:41 UTC by Jan Pazdziora (Red Hat)
Modified: 2010-08-10 14:59 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-05-18 20:05:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
The spec file used to create the rpm (707 bytes, text/plain)
2008-02-21 14:42 UTC, Jan Pazdziora (Red Hat)
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0951 0 normal SHIPPED_LIVE rpm bug fix update 2009-05-18 13:23:21 UTC

Description Jan Pazdziora (Red Hat) 2008-02-21 14:41:58 UTC
Description of problem:

To test behaviour of RHN toolchain with big rpms, I needed to create an rpm
which will be bigger than 2G. The rpmbuild -bb failed with segmentation fault.

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

# rpm -q rpm-build
rpm-build-4.3.3-23_nonptl

How reproducible:

Deterministic.

Steps to Reproduce:
1. Use the attached .spec file.
2. Run rpmbuild -bb.
  
Actual results:

Segmentation fault and no rpm created.

Expected results:

No error and rpm created.

Additional info:

The strace and lsof show that rpmbuild has finished writing huge file
/var/tmp/rpm-tmp.22631, then nothing happens for about a minute, and then the
process gets killed with segfault.

# tail -f /tmp/rpmbuild.strace
4064  write(4, "y\304\300e\232\23\10&:\304\225
4\21\367\373\235\316\276\240L\v\304\210%\342\260s\257(\351\353"..., 4096) = 4096
4064  write(4,
"u\204C\3\367\271\257g\3200\224\265\213\30\377\177\270^\273C\232\302\f@\264\3107\224\377\260\376\233"...,
12288) = 12288
4064  write(4,
"\351\220\4l\222\333>\216%\237gga\326\270S\357\345h\33d\223\360\261\327H\202\326\1\177\225\335"...,
4096) = 4096
4064  write(4,
"`3\377f\330\f\341=$\342[\255v\274\243\270qgzM\213\33\313;\242\233\373b8\345\3229"...,
12288) = 12288
4064  write(4,
"\250?5!\206\'\216\251\24\24BTwA\nE8\"`7\362#J\206\322\330F\224\361\331\341\211"...,
4096) = 4096
4064  write(4,
"\35\22;\242>\356J4\232:\214\326W\250\242\234\34}\204\363\371E8\221\346\205\250X\256\275m\365"...,
12288) = 12288
4064  write(4,
"\221\177\30g\3552X\321\301\25\275=\266\314\333\205\331\322<P\177&M~\251\6V\341\205\250\276\274"...,
4096) = 4096
4064  write(4,
"\221@\320\10\16\311p\7\374\250\202\265\304\363\353\241\314[\343y\231f\221\354IaX\311\"\324\\i"...,
12288) = 12288
4064  write(4,
"^!\211(\22c\326\30\352\335fD\344\277;\343\205\22E\324*c\22\272\242\322\247\'\245jv\350"...,
4096) = 4096
4064  write(4,
"@3\347\202W\375y9J\251\r\310\204\316\272N.\345\'\266{O\352q\331\233\33\330\212&\6?"...,
12288) = 12288
4064  --- SIGSEGV (Segmentation fault) @ 0 (0) ---

# lsof -p 4064
COMMAND   PID USER   FD   TYPE DEVICE       SIZE    NODE NAME
rpmbuild 4064 root  cwd    DIR  202,1       4096   16092 /root
rpmbuild 4064 root  rtd    DIR  202,1       4096       2 /
rpmbuild 4064 root  txt    REG  202,1      31928    3264 /usr/lib/rpm/rpmb
rpmbuild 4064 root  mem    REG  202,1   48525056   75564
/usr/lib/locale/locale-archive
rpmbuild 4064 root  mem    REG  202,1      58872   59880
/lib64/libnss_files-2.3.4.so
rpmbuild 4064 root  mem    REG  202,1     600192    3289 /usr/lib/rpm/magic.mgc
rpmbuild 4064 root  mem    REG  202,1      24632   59878 /lib64/libnss_dns-2.3.4.so
rpmbuild 4064 root  mem    REG  202,1      93544   59915 /lib64/libresolv-2.3.4.so
rpmbuild 4064 root  mem    REG  202,1 2621440000 2570453
/var/tmp/huge-rpm-1.0-20080221.135953-root/usr/share/doc/huge-rpm-1.0/file
rpmbuild 4064 root  mem    REG  202,1     115128   59920 /lib64/ld-2.3.4.so
rpmbuild 4064 root  mem    REG  202,1    1622288   59902 /lib64/tls/libc-2.3.4.so
rpmbuild 4064 root  mem    REG  202,1      62536   59780 /lib64/libselinux.so.1
rpmbuild 4064 root  mem    REG  202,1      19800   59910 /lib64/libdl-2.3.4.so
rpmbuild 4064 root  mem    REG  202,1     643240   59899 /lib64/tls/libm-2.3.4.so
rpmbuild 4064 root  mem    REG  202,1      79336   33836 /usr/lib64/libz.so.1.2.1.2
rpmbuild 4064 root  mem    REG  202,1      69752   33945 /usr/lib64/libelf-0.97.1.so
rpmbuild 4064 root  mem    REG  202,1     129952   59907
/lib64/tls/libpthread-2.3.4.so
rpmbuild 4064 root  mem    REG  202,1      34144   33956 /usr/lib64/libpopt.so.0.0.0
rpmbuild 4064 root  mem    REG  202,1      61296   59900 /lib64/tls/librt-2.3.4.so
rpmbuild 4064 root  mem    REG  202,1     133424   33910
/usr/lib64/libbeecrypt.so.6.2.0
rpmbuild 4064 root  mem    REG  202,1      64320   33738 /usr/lib64/libbz2.so.1.0.2
rpmbuild 4064 root  mem    REG  202,1     386952   33863 /usr/lib64/librpmio-4.3.so
rpmbuild 4064 root  mem    REG  202,1    1029960   33711 /usr/lib64/librpmdb-4.3.so
rpmbuild 4064 root  mem    REG  202,1     350768   33909 /usr/lib64/librpm-4.3.so
rpmbuild 4064 root  mem    REG  202,1     149416   33794
/usr/lib64/librpmbuild-4.3.so
rpmbuild 4064 root    0u   CHR  136,0                  2 /dev/pts/0
rpmbuild 4064 root    1u   CHR  136,0                  2 /dev/pts/0
rpmbuild 4064 root    2u   CHR  136,0                  2 /dev/pts/0
rpmbuild 4064 root    3u   REG  202,1 2622179056   16233 /var/tmp/rpm-tmp.22631
rpmbuild 4064 root    4u   REG  202,1 2622179056   16233 /var/tmp/rpm-tmp.22631
rpmbuild 4064 root    5r   REG  202,1 2621440000 2570453
/var/tmp/huge-rpm-1.0-20080221.135953-root/usr/share/doc/huge-rpm-1.0/file

Comment 1 Jan Pazdziora (Red Hat) 2008-02-21 14:42:51 UTC
Created attachment 295511 [details]
The spec file used to create the rpm

Comment 2 RHEL Program Management 2008-02-21 14:48:03 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 3 Panu Matilainen 2008-02-22 07:48:56 UTC
NAK. Segfaults can be fixed, but large file support you wont get in RHEL 4 (or 5
for that matter). Rpm is hardwired deep down to (signed) 32 bit integers for
file sizes and doesn't support 64bit entities in headers at all, changing those
would be a significant ABI+API breakage, no way suitable for an update release.
Not to mention large file support is not even upstream yet although it's being
planned there for the next major version.

Comment 4 RHEL Program Management 2008-02-22 07:55:50 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request. 

Comment 5 Jan Pazdziora (Red Hat) 2008-02-22 12:06:21 UTC
If large files are not supported at all, shouldn't rpm refuse to create that big
rpm or otherwise handle the situation gracefully with some error message,
instead of segfaulting?

By the way, rpm-build-4.4.2-47.el5.x86_64 on RHEL 5 segfaults as well, while
rpm-build-4.4.2.2-7.fc8.x86_64 on F8 does not segfault. Does is mean F8 already
has different code base?


Comment 6 Jan Pazdziora (Red Hat) 2008-05-05 21:26:40 UTC
Denise, why did you remove the rhel-4.7? flag? Are segfaults acceptable in our
product now? Could you comment on the possibility of rpm gracefully refusing to
create the big file instead of segfaulting, as proposed in my comment #5?

Comment 7 Denise Dumas 2008-06-09 18:08:06 UTC
OK, we're going to address the segfault in 4.8. But we can't do the large file
support until the ABI/API changes (among other things) go in, and that can't
happen until RHEL6. 




Comment 8 RHEL Program Management 2008-09-05 17:05:14 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 9 Panu Matilainen 2008-09-24 09:17:30 UTC
Devel ack...

QA: This can be verified with the same test as is used for bug 448488 (ie rpm should simply refuse to build a package larger than it can handle)

Comment 15 errata-xmlrpc 2009-05-18 20:05:20 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0951.html

Comment 16 Paul Waterman 2009-06-15 23:56:11 UTC
I realize that this bug is already closed, but I'm adding this comment as the "fix" included in rpm-4.3.3-32_nonptl seems incorrect to me -- it goes far beyond fixing the segfault behavior described in the original bug and instead significantly changes the behavior of rpmbuild.

Here are examples of specific test cases:

1) Create an .rpm where one file being packaged into the .rpm is larger than 2GB. This is the test case described in this bug.

Old behavior: rpmbuild will segfault
New behavior: rpmbuild will error exit

2) Create an .rpm where the total size of the files being packaged into the .rpm is larger than 2GB but no single file exceeds 2GB, and where those files are compressible such that the resulting .rpm will be less than 2GB.

Old behavior: rpmbuild succeeds, creating an .rpm < 2GB
New behavior: rpmbuild will error exit

3) Create an .rpm where the total size of the files being packaged into the .rpm is larger than 2GB but no single file exceeds 2GB, and where those files are not compressible.

Old behavior: rpmbuild succeeds, creating an .rpm > 2GB
New behavior: rpmbuild will error exit

In case #2 and #3, above, is the new behavior correct? If so, what problems are caused by having .rpms as described?

Comment 17 Paul Waterman 2009-06-22 21:00:32 UTC
One week with no response; I'm considering opening a new bug regarding the apparently incorrect behavior of the fix.

Comment 18 Martin Budsjö 2010-02-09 10:40:18 UTC
(In reply to comment #17)
> One week with no response; I'm considering opening a new bug regarding the
> apparently incorrect behavior of the fix.    

Did you open a new bug for this?


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