Closed ncw closed 7 months ago
Note this does not replicate on linux/amd64.
I confirm. On linux/amd64 the value of O_LARGEFILE
is set to 0x0 so the code execution never reaches the panic since it is guarded by a
https://github.com/hanwen/go-fuse/blob/cbb13ba8d29c65dd5661be449c56563edcb7f5a1/fuse/print.go#L114
which ends up always evaluating to a 0
on 64 bit archs whenever we pass LARGEFILE
flag. However on 32-bit and particularly i386
, syscall.O_LARGEFILE
actually evaluates to 0x8000
hence choking the code. It works fine on other 32-bit architectures where O_LARGEFILE
value is different.
When I compile and build this library for
GOARCH=386
GOOS=linux
I get this panic on startupThe panic is issued here
https://github.com/hanwen/go-fuse/blob/cbb13ba8d29c65dd5661be449c56563edcb7f5a1/fuse/print.go#L116
And this comes from this bit of
init()
codehttps://github.com/hanwen/go-fuse/blob/cbb13ba8d29c65dd5661be449c56563edcb7f5a1/fuse/print_linux.go#L14
I think this is because the value is already set here
https://github.com/hanwen/go-fuse/blob/cbb13ba8d29c65dd5661be449c56563edcb7f5a1/fuse/print.go#L67
This is easy to replicate
with
And
Note this does not replicate on linux/amd64.
On
darwin/amd64
anddarwin/arm64
it gives