Bug 114112
Summary: | shmat() returns EINVAL with redhat kernel but not with stock 2.4.21 kernel | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Nick Cabatoff <ncc> |
Component: | kernel | Assignee: | Arjan van de Ven <arjanv> |
Status: | CLOSED NOTABUG | QA Contact: | Brian Brock <bbrock> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.0 | CC: | mike, petrides, riel |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i686 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2004-01-22 18:46:50 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
Nick Cabatoff
2004-01-22 18:26:45 UTC
shmget(16957874, 259203072, IPC_CREAT|IPC_EXCL|0600) = 491520 shmat(491520, 0xb8000000, 0) = -1 EINVAL (Invalid argument) the application asks for 259203072 bytes at address 0xb8000000.. with the process address space ending at 0xc0000000 (and the stack being there) that doesn't look like it will it..... sounds like a bug in the program to me; it asks for something invalid and the kernel returns -EINVAL Huh! I'll be... that makes perfect sense. If I'd researched the format of /proc/$$/maps I might've worked that out for myself. Thanks very much for the incredibly quick reply. Hmmm... Not really sure if this should be classified as "NOTABUG" because sybase works properly under other non-RHEL3 versions, but OK. The buzz in the sybase community is that older versions of Sybase do not work, which will make folks avoid RHEL3 for sybase applications. Personally, I think the folks at RedHat tweeked the output of /proc/self/maps to the point that it breaks some applications. It would be nice if RedHat took this seriously to figure out why this is happening, or provide a workaround. When sybase boots, it will only allow a maximum of 128MB of shared memory. My guess is that whatever line it is reading in /proc/self/maps incorrectly reports the amount of free shared memory that is available. For the benefit of others, here is a workaround that makes older versions of sybase 11.x, work properly under RHEL3. To fix sybase 11.0.3.3, it is necessary to edit the sybase "dataserver" binary to fool sybase into thinking that "/proc/self/maps" is invalid. Older versions of Sybase consulted this file during initialization to figure out where to map the shared memory. If sybase doesn't find this file, it consults the kernel which aparently works. Do the following: vi -b dataserver search for the **FIRST** occurrence "/proc/self/maps": /proc/self/maps^@NULL^@key: 0x%lx id: %d file: ^@...^@^@0x%lx,0x%lx,0x%lx,0x%x^@os_create_keyfile Change "/proc" to something different... I used "/Proc". Change ONLY the above entry. Save the binary and sybase will now properly assign the shared memory, as defined in /proc/sys/kernel/shmmax. Mike |