Bug 171111
Summary: | (libperl) could not run system-config-printer | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Jindrich Novy <jnovy> | ||||
Component: | perl | Assignee: | Jason Vas Dias <jvdias> | ||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | David Lawrence <dkl> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 4.0 | CC: | a.patacchiola, dr, jlieskov, jturner, laroche, perl-devel, pknirsch, poelstra, prockai, Stuart, twaugh, umar | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | athlon | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | RHSA-2005-880 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2006-03-12 18:18:59 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: | |||||||
Bug Depends On: | 144536 | ||||||
Bug Blocks: | 172317 | ||||||
Attachments: |
|
Comment 3
Jason Vas Dias
2005-10-24 20:49:59 UTC
OK, I've finally found and fixed the problem here, now that I've brought my USB printer in to work from home (unecessarily! :-) perl was looking for an IOCPARM_LEN(ioctl_number) macro to return the length bits from the ioctl function number. This works OK on BSD systems. But if IOCPARM_LEN was not defined, perl.h "guessed" and defined IOCPARM_LEN(ioctl_number) to be 256 . Linux has no IOCPARM_LEN(x) macro. So any printer that returned an ID string > 256 bytes would cause a SIGSEGV . Linux has the _IOC_SIZE(x) macro, so I changed perl.h to use _IOC_SIZE(x) if IOCPARM_LEN is not defined instead of constant 256. I have submitted this bug upstream with perlbug - waiting for a RT #. So this bug is now fixed in Rawhide (FC-5) with perl-5.8.7-0.6.fc5 . It will now have to be fixed in RHEL-3, RHEL-4, FC-4, FC-3 . From User-Agent: XML-RPC perl-5.8.5-18.FC3 has been pushed for FC3, which should resolve this issue. If these problems are still present in this version, then please make note of it in this bug report. 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 the 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/RHSA-2005-880.html This patch needed another core patch to work properly, I'm not sure why. See : https://rt.perl.org/rt3/Ticket/Display.html?id=38223 This bug is fixed: perl programs passing in the length bitfield parameter to ioctl will now get the correct length, instead of the default 256; as a result, system-config-printer works fine. The upstream refinement to this patch was to retain the previous 256 default as a minimum length; ie., if the ioctl did not pass in the length, and the argument is less than 256 bytes in length, then it is made to be 256 bytes. This does not affect system-config-printer, and is a new bug - I'm closing this bug and raising another to document it. Have run the test script from https://rt.perl.org/rt3/Ticket/Display.html?id=38223 (will attach this file) on 3 systems with 3 format of the "perl.h" file: 1, perl 5.8.8 ./test.perl (row,col) = (54,155) => PASS Form of the patch: #ifndef IOCPARM_LEN # ifdef IOCPARM_MASK /* on BSDish systems we're safe */ # define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) # else # if defined(_IOC_SIZE) && defined(__GLIBC__) /* on Linux systems we're safe; except when we're not [perl #38223] */ # define IOCPARM_LEN(x) (_IOC_SIZE(x) < 256 ? 256 : _IOC_SIZE(x)) # else /* otherwise guess at what's safe */ # define IOCPARM_LEN(x) 256 # endif # endif #endif 2, perl 5.8.6 ./test.perl (row,col) = (54,155) => PASS Form of the patch: #ifndef IOCPARM_LEN # ifdef IOCPARM_MASK /* on BSDish systes we're safe */ # define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) # else /* otherwise guess at what's safe */ # define IOCPARM_LEN(x) 256 # endif #endif => seems it's enough to hardly set the value of IOCPARM_LEN(x) to 256 and don't take into account the Linux system's branch, because: 3, perl 5.8.6 ./test.perl Possible memory corruption: ioctl overflowed 3rd argument at ./test.perl line 5. => FAIL Form of the patch: #ifndef IOCPARM_LEN # ifdef IOCPARM_MASK /* on BSDish systems we're safe */ # define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) # else # ifdef _IOC_SIZE /* on Linux systems we're safe */ # define IOCPARM_LEN(x) _IOC_SIZE(x) # else /* otherwise guess at what's safe (we're UNSAFE!) */ # warning "unsafe assumption of IOCPARM_LEN=256" # define IOCPARM_LEN(x) 256 # endif # endif #endif This patch doesn't work. So the solution is either to use patch without the linux branch, and hardly set value of IOCPARM_LEN(x) to 256 (patch 2,), or take into account _IOC_SIZE and use the newest patch ( patch 1,). Created attachment 126033 [details] test case from https://rt.perl.org/rt3/Ticket/Display.html?id=38223 I have raised bug 185240 to cover the issues raised in Comment #11, Comment #12, Comment #14, Comment #15 - (perlbug RT #38223) - it will be fixed in perl-5.8.5-24.RHEL4+. The specific problem with system-config-printer reported in this bug has definitely been fixed with the current perl-5.8.5-22.RHEL-4 release in RHEL-4-U3 . |