Summary: | sturmbahnfahrer: wrong path to share directory | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | mephinet <mephinet> |
Component: | [OLD] Games | Assignee: | Gentoo Games <games> |
Status: | VERIFIED FIXED | ||
Severity: | normal | ||
Priority: | High | ||
Version: | 2006.1 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
strace output
output of "emerge -evp games-sports/sturmbahnfahrer" |
Description
mephinet
2007-02-26 09:57:03 UTC
run strace -o out /usr/games/bin/sturmbahnfahrer and attach the out file as text/plain please. Created attachment 111406 [details]
strace output
strace output attached.
doesn't contain anything useful, imho, though.
open("/usr/games/share/games/sturmbahnfahrer/sounds/rpm_graph.txt", O_RDONLY) = -1 ENOENT (No such file or directory)
When I debug into the main function, what happens is this:
(gdb) p (char *) argv [0]
$15 = 0xbfb6a74a "/usr/games/bin/sturmbahnfahrer"
but after the line
char *bindirname = dirname(argv[0]);
(gdb) p (char *) argv [0]
$16 = 0xbfb6a74a "/usr/games/bin"
which means that argv has been modified, which is according to the man page of dirname:
> Both dirname() and basename() may modify the contents of path,
> so copies should be passed to these functions.
then, in the else clause of if (!strcmp(bindirname,".")),
dirname is called again,
dirprefix = dirname(bindirname) + ...
so bindirname is modified too, and the dirprefix is set to "/usr/games". then, "share/games/..." is appended to it, resulting in
(gdb) p dirprefix->_M_dataplus->_M_p
$21 = 0x83e30f4 "/usr/games/share/games/sturmbahnfahrer"
which is wrong...
How about the output from "emerge -evp games-sports/sturmbahnfahrer" See, it works fine here with all stable x86 packages so I'm trying to figure out what's different about your stuff. Created attachment 111598 [details]
output of "emerge -evp games-sports/sturmbahnfahrer"
output attached.
Reading the code, things would work if sys.argv [0] is a file in a 2nd level directory. So, if you create e.g a symlink in /usr/bin, then the code would strip
/usr/bin/sturmbahnfahrer down to /usr, and the generated string would be OK. But for a 3rd level directory like /usr/games/bin, the code won't work, imho.
what does "which sturmbahnfahrer" return on your box?
$ which sturmbahnfahrer /usr/games/bin/sturmbahnfahrer It's something on your system. The stock stuff in portage should work fine. Maybe try remerging ode and plib. Ah... so, don't specify the exact path. Try just running it as "sturmbahnfahrer". I bet that works. Ok... yeah, the whacking with argv is silly. I "fixed" it with a sed hammer. sleep 30m ; emerge --sync ; emerge -v sturmbahnfahrer to get the fix. works fine, thanks. |