Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary platform specific workaround in iso9660util #3149

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arixmkii
Copy link

I've been experimenting using latest Lima with QEMU on Windows and during my initial tests writing .iso file would always result in app panicking inside the third party library (I don't have stack trace preserved unfortunately). By removing this transformation of path I did manage to get a running setup. Probably the native Windows path handling was added in upstream, but I didn't try to bisect there no evidence when it was last working.

cc: @afbjorklund tagging you, because you added this part some time ago f264c90

@afbjorklund
Copy link
Member

afbjorklund commented Jan 24, 2025

If it works now, it was probably fixed in either the go-diskfs or in go. Back then, it didn't like when mixing them.

@afbjorklund
Copy link
Member

afbjorklund commented Jan 24, 2025

But from what I can tell, it still seems to be using path.Join (not filepath.Join), so surprised that it works...

https://github.com/diskfs/go-diskfs/tree/master/filesystem/iso9660

                fullPath := path.Join(fsm.workspace, p)

@arixmkii
Copy link
Author

I'll rebuild from unaltered to double check and post stack trace here later.

@arixmkii
Copy link
Author

It is definitely using filepath to walk the tree https://github.com/diskfs/go-diskfs/blob/5fa33cdab5b6560db5cd07ad9a9177bd12e6abc6/filesystem/iso9660/finalize.go#L917C9-L917C17

Same in the master HEAD.

@arixmkii
Copy link
Author

And here is stack trace showing filepath being used, where it panics

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0xf8 pc=0x14e7e6b]

goroutine 1 [running]:
github.com/diskfs/go-diskfs/filesystem/iso9660.walkTree.func1({0xc00032b9c0, 0x3b}, {0x1dfd718, 0xc00031a1c0}, {0x0?, 0x0?})
	C:/Users/User/go/pkg/mod/github.com/diskfs/[email protected]/filesystem/iso9660/finalize.go:948 +0x40b
path/filepath.walkDir({0xc00032b9c0, 0x3b}, {0x1dfd718, 0xc00031a1c0}, 0xc00013ece8)
	C:/msys64/ucrt64/lib/go/src/path/filepath/path.go:310 +0x50
path/filepath.walkDir({0xc000398680, 0x36}, {0x1dfd750, 0xc000308020}, 0xc00013ece8)
	C:/msys64/ucrt64/lib/go/src/path/filepath/path.go:332 +0x285
path/filepath.WalkDir({0xc000398680, 0x36}, 0xc00013ece8)
	C:/msys64/ucrt64/lib/go/src/path/filepath/path.go:400 +0x75
github.com/diskfs/go-diskfs/filesystem/iso9660.walkTree({0xc000398680, 0x36})
	C:/Users/User/go/pkg/mod/github.com/diskfs/[email protected]/filesystem/iso9660/finalize.go:917 +0xc5
github.com/diskfs/go-diskfs/filesystem/iso9660.(*FileSystem).Finalize(0xc000678900, {0x0?, 0x89?, 0x0?, {0x1bbfae4?, 0x1ded320?}})
	C:/Users/User/go/pkg/mod/github.com/diskfs/[email protected]/filesystem/iso9660/finalize.go:480 +0x29d
github.com/lima-vm/lima/pkg/iso9660util.Write({0xc0003985c0, 0x27}, {0x1bbfae4, 0x6}, {0xc0003b8d88, 0x1f, 0x7?})
	C:/msys64/home/User/gitrepos/lima/pkg/iso9660util/iso9660util.go:53 +0x333
github.com/lima-vm/lima/pkg/cidata.GenerateISO9660({0xc000110060, 0x1c}, {0xc00000a1d0?, 0x0?}, 0xc00012e008, 0xf840, 0xc893, {0xc000074100, 0x7e}, 0x0, ...)
	C:/msys64/home/User/gitrepos/lima/pkg/cidata/cidata.go:432 +0xca8
github.com/lima-vm/lima/pkg/hostagent.New({0xc00000a1d0, 0x7}, {0x1ded3a0, 0xc000295760}, 0xc000518ee0, {0xc0002844f0, 0x1, 0x0?})
	C:/msys64/home/User/gitrepos/lima/pkg/hostagent/hostagent.go:141 +0x3a5
main.hostagentAction(0xc000540c08, {0xc000296d80, 0x1, 0x1bbbfee?})
	C:/msys64/home/User/gitrepos/lima/cmd/limactl/hostagent.go:85 +0x5b7
github.com/spf13/cobra.(*Command).execute(0xc000540c08, {0xc000296c80, 0x8, 0x8})
	C:/Users/User/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc0002e2908)
	C:/Users/User/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
	C:/Users/User/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
main.main()
	C:/msys64/home/User/gitrepos/lima/cmd/limactl/main.go:28 +0x18

Copy link
Member

@afbjorklund afbjorklund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reproduced the crash, cidata.iso creation now works without converting the path (so it is not needed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants