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
Created attachment 295511 [details] The spec file used to create the rpm
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.
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.
Development Management has reviewed and declined this request. You may appeal this decision by reopening this request.
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?
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?
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.
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)
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
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?
One week with no response; I'm considering opening a new bug regarding the apparently incorrect behavior of the fix.
(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?