+Maytha who prepared the upload.
On Sun, Jan 28, 2024 at 05:05:55PM +0000, Julian Gilbey wrote:
Hi Nilesh,
You did the last upload of this package - do you have any idea about
this bug?
I've been trying to track it down for the past hour but I don't have a fix that I am confident about.
I initially thought it may have been due to some sort of overflow due to bitshift so I applied this patch
--- a/fuse/print.go
+++ b/fuse/print.go
@@ -119,7 +119,8 @@
func (names *flagNames) set(flag int64, name string) {
entry := flagNameEntry{bits: flag, name: name}
for i := 0; i < 64; i++ {
- if flag&(1<<i) != 0 {
+ bitshift := uint64(1) << i
+ if uint64(flag)&bitshift != 0 {
if ie := names[i]; ie.bits != 0 {
panic(fmt.Sprintf("%s (%x) overlaps with %s (%x)", name, flag, ie.name, ie.bits))
}
but it did not help.
On compiler level O_LARGEFILE is set to 0x0 on 64 bit systems while it is 0x8000 (equivalent to 32-bit integer) for i386.
In fuse/print.go, LARGEFILE is hard-coded to "0x8000" which ends up matching the value on 32-bit system
and it chokes with the panic.
Interestingly, for all other 32-bit archs that are tested on debci, it is set to a value higher than 0x8000 and so
they magically work. Given that the package is written with 64-bit systems in focus, this change can work:
- 0x8000: "LARGEFILE",
+ 0x0: "LARGEFILE",