ChrisRx / dungeonfs

A FUSE filesystem and dungeon crawling adventure game engine
BSD 2-Clause "Simplified" License
1.03k stars 29 forks source link

SIGSEGV on execute #6

Closed mrdrogdrog closed 7 years ago

mrdrogdrog commented 7 years ago

I can't execute dungeonfs. Compiling (go get -u -v "git://github.com/ChrisRx/dungeonfs.git/...") went well. But as soon as I execute dungeonfs mount -d /tmp/dungeon/ I get

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7d5833]

goroutine 1 [running]:
github.com/ChrisRx/dungeonfs/cmd/dungeonfs/command.runMountCommand(0xc420098b40, 0xc4200cee80, 0x1, 0x2)
    /tmp/yaourt-tmp-tilman/aur-dungeonfs/src/go/src/github.com/ChrisRx/dungeonfs/cmd/dungeonfs/command/mount.go:53 +0x713
github.com/spf13/cobra.(*Command).execute(0xc420098b40, 0xc4200cece0, 0x2, 0x2, 0xc420098b40, 0xc4200cece0)
    /tmp/yaourt-tmp-tilman/aur-dungeonfs/src/go/src/github.com/spf13/cobra/command.go:647 +0x234
github.com/spf13/cobra.(*Command).ExecuteC(0xaf98e0, 0xc4200edf78, 0x0, 0xc420098d80)
    /tmp/yaourt-tmp-tilman/aur-dungeonfs/src/go/src/github.com/spf13/cobra/command.go:733 +0x339
github.com/spf13/cobra.(*Command).Execute(0xaf98e0, 0xc4200edf68, 0x2)
    /tmp/yaourt-tmp-tilman/aur-dungeonfs/src/go/src/github.com/spf13/cobra/command.go:692 +0x2b
main.main()
    /tmp/yaourt-tmp-tilman/aur-dungeonfs/src/go/src/github.com/ChrisRx/dungeonfs/cmd/dungeonfs/main.go:21 +0x95

OS: Arch Linux x64 Go: go1.8.1

Xiretza commented 7 years ago

Have you tried giving it the location of the level directly? It'd be dungeonfs mount -a /usr/share/dungeonfs/examples/simplelevel/ ... in the case of my AUR package.

mrdrogdrog commented 7 years ago

Okay, that worked. But SIGSEGV occurs if:

Xiretza commented 7 years ago

The second one is logical, because it has no way of knowing where I'm installing the level to (and according to the README there are plans to include the example level in the binary, which would solve this issue).

The first one seems like a different bug related to getting the PID of the daemon process.

Edit: yeah, the first one makes sense now, mount.go:50 obviously won't refer to the actual executable once installed unless you're in /usr (and even then, it just exits instantly and doesn't leave a daemon behind).

mrdrogdrog commented 7 years ago

That makes sense. But it would be less confusing if the code would show an errormsg instead of a SIGSEGV. For both issues. Like "No level specified" or "dungeonfs binary not found"