large file support broken in sbcl-1.0.30 on x86-64/linux

Bug #453080 reported by Daniel Janus
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

Hello,

I've just built a fresh SBCL 1.0.30 from source and here's what I'm
getting on a file that's 6GB in size:

nathell@chamsin:~/programs/sbcl-new/sbcl-1.0.30$ uname -a
Linux chamsin 2.6.31-10-generic #35-Ubuntu SMP Tue Sep 22 17:33:14 UTC 2009 x86_64 GNU/Linux
nathell@chamsin:~/programs/sbcl-new/sbcl-1.0.30$ sh run-sbcl.sh
(running SBCL from: .)
This is SBCL 1.0.30, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (defparameter a (open "/my/large/file"))

A
* (file-length a)

1787358656
* *features*

(:ANSI-CL :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS
 :SB-UNICODE :SB-EVAL :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :X86-64 :UNIX
 :ELF :LINUX :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD :C-STACK-IS-CONTROL-STACK
 :LINKAGE-TABLE :COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP
 :RAW-INSTANCE-INIT-VOPS :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
 :CYCLE-COUNTER :COMPLEX-FLOAT-VOPS :FLOAT-EQL-VOPS :INLINE-CONSTANTS
 :OS-PROVIDES-DLOPEN :OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T)
* (quit)
nathell@chamsin:~/programs/sbcl-new/sbcl-1.0.30$ ls -l /my/large/file
-rw-r--r-- 1 nathell nathell 6082325952 2009-07-11 09:33 /my/large/file

I've also tried to explicitly enable :largefile in
base-target-features.lisp-expr, but building SBCL then fails with the
following message:

make: Entering directory
`/home/nathell/programs/sbcl-new/sbcl-1.0.30/tools-for-build'
cc -fno-omit-frame-pointer -I../src/runtime -ldl grovel-headers.c -o
grovel-headers
grovel-headers.c: In function 'main':
grovel-headers.c:256: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:257: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:258: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:259: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:260: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:261: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:262: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:263: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:264: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:269: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:271: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:274: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:275: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:276: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:277: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:278: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:279: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:280: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
grovel-headers.c:301: error: 'O_LARGEFILE' undeclared (first use in this
function)
grovel-headers.c:301: error: (Each undeclared identifier is reported
only once
grovel-headers.c:301: error: for each function it appears in.)
make: *** [grovel-headers] Error 1
make: Leaving directory
`/home/nathell/programs/sbcl-new/sbcl-1.0.30/tools-for-build'

I'm on the 64-bit edition of Ubuntu Karmic. I'll be grateful for any
hints.

Best regards,
Daniel Janus

Tags: patch
Revision history for this message
Christophe Rhodes (csr21-cantab) wrote : large file support on x86-64/linux

Hi,

 status confirmed
 done

Can you try editing src/runtime/Config.x86_64-linux so that it includes
the feature test macros related to largefile, similar to
.../Config.x86-linux? Then alter the "linux)" branch of the case
statement dispatching on "$sbcl_os" in make-config.sh to add x86_64 to
the list adding :largefile to late-target-features, and recompile.

Best,

Christophe

PS: this message also serves as a test to see whether I have done all
the relevant voodoo to get me working with launchpad.

Changed in sbcl:
status: New → Confirmed
Revision history for this message
Daniel Janus (nathell) wrote :

That worked (against the just-released sbcl-1.0.32), thank you! I attach a resulting patch.

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote : Re: [Bug 453080] Re: large file support broken in sbcl-1.0.30 on x86-64/linux

Hi,

 tag patch
 status inprogress
 done

Daniel Janus <email address hidden> writes:

> That worked (against the just-released sbcl-1.0.32), thank you! I
> attach a resulting patch.

Good to know. I'll try to get this merged before the next release.

Best,

Christophe

Changed in sbcl:
status: Confirmed → In Progress
Revision history for this message
Christophe Rhodes (csr21-cantab) wrote :

 status fixcommitted
 done

Daniel Janus <email address hidden> writes:

> That worked (against the just-released sbcl-1.0.32), thank you! I
> attach a resulting patch.
>
>
> ** Attachment added: "sbcl.diff"
> http://launchpadlibrarian.net/34413011/sbcl.diff

Thanks, I merged this as sbcl-1.0.32.3.

Best,

Christophe

Changed in sbcl:
status: In Progress → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.