Bug 19692
Summary: | rpm2cpio 4.0 dumps core on Solaris 2.8 | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | luc.maisonobe |
Component: | rpm | Assignee: | Jeff Johnson <jbj> |
Status: | CLOSED WORKSFORME | QA Contact: | David Lawrence <dkl> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 6.2 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | sparc | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2000-11-10 08:56:16 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
luc.maisonobe
2000-10-24 15:44:39 UTC
2000-11-10 08:30:00 MET I have checked older versions of rpm. The problem seem to have been introduced between versions 3.0.3 and 3.0.4 of the distribution. Further investigation showed me that in the gzdFdopen function of rpmio.c, the statement fdSetFdno(fd, -1); stores -1 in the structure pointed to by the fdi variable of the main function, the file descriptor which was 4 before this is later pushed on the following element of the fps table. However, there is a test later on in main : if (gzdi == NULL || Ferror(gzdi)) { fprintf(stderr, _("cannot re-open payload: %s\n"), Fstrerror(gzdi)); exit(EXIT_FAILURE); } The Ferror (gzdi) tests both the element where fd = 4 and the previous ones where fd = -1. This triggers the error handling. The Fstrerror function then returns the errcookie pointer, which is NULL since its creation by XfdNew. This leads to a segmentation violation in the fprintf call. I think there are two separate problems: - an inconsistency between the resetting of the fd to -1 which seems to means this entry is not valid anymore and the the Ferror test which fails when it detects this -1 - an initialization problem of the errcookie pointer to NULL. hope this helps Luc I believe this is now fixed in rpm CVS. The "fix" I am remembering is in rpm2cpio.c to change the check for the return code to gzdi = Fdopen(fdi, rpmio_flags); /* XXX gzdi == fdi */ if (gzdi == NULL) { fprintf(stderr, _("cannot re-open payload: %s\n"), Fstrerror(gzdi)); exit(EXIT_FAILURE); } Please reopen if I'm misremembering. |