Bug 166600 - CRM619504: setrlimit RLIMIT_FSIZE limited to 32-bit values, even on 64-bit kernels
Summary: CRM619504: setrlimit RLIMIT_FSIZE limited to 32-bit values, even on 64-bit ke...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Staubach
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks: 168424
TreeView+ depends on / blocked
 
Reported: 2005-08-23 18:38 UTC by Issue Tracker
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version: RHSA-2006-0144
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-15 16:28:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed patch (900 bytes, patch)
2005-08-26 14:21 UTC, Peter Staubach
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2006:0144 0 qe-ready SHIPPED_LIVE Moderate: Updated kernel packages available for Red Hat Enterprise Linux 3 Update 7 2006-03-15 05:00:00 UTC

Description Issue Tracker 2005-08-23 18:38:31 UTC
Escalated to Bugzilla from IssueTracker

Comment 5 Issue Tracker 2005-08-23 18:38:40 UTC
From User-Agent: XML-RPC

Here's a summary of the issue based on my analysis. I did all this on an
x86_64 system running RHEL3-U5.





Creating a file > 4GB works when ulimt -f is unlimited:



[root@dl585 tmp]# ulimit -f

unlimited

[root@dl585 tmp]# dd if=/dev/zero of=testfile bs=1k count=$((5*1024*1024))
5242880+0 records in

5242880+0 records out

[root@dl585 tmp]# ls -lh testfile

-rw-r--r--    1 root     root         5.0G Sep  2 10:35 testfile





When the ulimit is not unlimitied but is greater than 4GB, creating a file
> 4GB (whether or not it is less than the ulimit) fails with "No space
left on device" (but there is space left on the device):



[root@dl585 tmp]# ulimit -f $((6*1024*1024))

[root@dl585 tmp]# ulimit -f

6291456

[root@dl585 tmp]# dd if=/dev/zero of=testfile bs=1k
count=$((4*1024*1024+1))

dd: writing `testfile': No space left on device

4194305+0 records in

4194304+0 records out

[root@dl585 tmp]# ls -lh testfile

-rw-r--r--    1 root     root         4.0G Sep  2 10:41 testfile





Creating a file larger than the ulimit when the ulimit is less than 4GB
fails with "File size limit exceeded" (this is the way it is supposed to
fail):



[root@dl585 tmp]# ulimit -f $((4*1024*1024-1))

[root@dl585 tmp]# ulimit -f

4194303

[root@dl585 tmp]# dd if=/dev/zero of=testfile bs=1k
count=$((4*1024*1024))

File size limit exceeded

[root@dl585 tmp]# ls -l testfile

-rw-r--r--    1 root     root     4294966272 Sep  2 10:44 testfile





 So I don't think the problem is with *setting* the limit (it appears at
least to report as correctly set). Something breaks in file I/O when the
limit is 4GB or greater, but not when it is unlimited.

It also doesn't appear to matter if you're running a 32bit or 64bit
application.

 I'm afraid I've reached the end of my ability to debug this. I have to
pass it up to Engineering, who might have a better idea where this is
failing.




This event sent from IssueTracker by streeter
 issue 78136

Comment 7 Peter Staubach 2005-08-26 14:21:01 UTC
Created attachment 118157 [details]
Proposed patch

Comment 8 Peter Staubach 2005-08-26 14:39:15 UTC
The problem was that the arithmetic used to calculate the offset and count
values was being artificially constrained to unsigned 32 bit values.  It
should have been using unsigned long values, which would then scale
appropriately on 64 bit architectures.

I also eliminated an unnecessary test.

Comment 14 Ernie Petrides 2005-09-30 06:42:18 UTC
A fix for this problem has just been committed to the RHEL3 U7
patch pool this evening (in kernel version 2.4.21-37.4.EL).


Comment 17 Red Hat Bugzilla 2006-03-15 16:28:39 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 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-2006-0144.html



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