file-length wraps around at 4 GB on linux-arm64

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

Bug Description

For a 5 GB file, file-length should return 5 GB, but returns 1 GB.

To test, create (sparse) 5 GB file:
dd if=/dev/null bs=1 seek=5G count=1 of=5gbfile

stat -c %s 5gbfile
5368709120

./run-sbcl.sh --no-userinit --eval '(print (with-open-file (f "5gbfile") (file-length f)))' --quit
1073741824

---
Tested with
sbcl-2.2.9 - 11
sbcl-2.3.0 - 2
sbcl-2.3.2-48-gbc7150b89

Raspberry PI 4
Linux 4.19.108-v8+ #1298 SMP PREEMPT Fri Mar 6 18:15:51 GMT 2020 aarch64 GNU/Linux

Android
Linux localhost 4.4.148-perf+ #1 SMP PREEMPT Tue Sep 3 19:28:08 2019 aarch64 Android

---
Note: It works fine on x86-64

Stas Boukarev (stassats)
summary: - file-length wraps around at 4 GB on arm64
+ file-length wraps around at 4 GB on linux-arm64
Changed in sbcl:
status: New → Fix Committed
Revision history for this message
Yan (metayan) wrote :

Thanks for the quick fix.

Revision history for this message
Yan (metayan) wrote :

How complicated would it be to tweak a running instance?

Revision history for this message
Stas Boukarev (stassats) wrote :

Impossible.

Revision history for this message
Yan (metayan) wrote :

Yeah, I started looking into it, and that's also what I came up with, but thought I'd better ask if there was something I was missing.
Thanks again.

Revision history for this message
Yan (metayan) wrote :

Would you consider it safe to cherry-pick a8266873759aabfb195d542428dde8d0f53a25e6 into sbcl-2.3.2 as a solution until 2.3.3 is released?

Revision history for this message
Stas Boukarev (stassats) wrote :

Yes.

Revision history for this message
Yan (metayan) wrote :

Works great. Thanks.

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.