FreeBSD Port: zsnes-1.42

Martin Gumucio martin.gumucio at gmail.com
Fri May 6 15:47:54 PDT 2005


Its broken, all you get is a crash  
"zsnes in free(): error: junk pointer, too high to make sense
Abort trap (core dumped)"

Below is quoted a helpful post from the zsnes forum, im gonna give it
a try, but i guess for now mark the port as broken?

Quoted text from
http://board.zsnes.com/phpBB2/viewtopic.php?t=2271&highlight=zsnes+free+error+junk+pointer+high+make+sense

--------
Well, this might prove helpful to you guys. I looked at what
differences in free() commands there are between 1.40 and 1.41, and I
found that you guys added in a free(homedir) command into the
obtaindir() function of linux/zfilew.c. I think the problem is that
getenv in FreeBSD doesn't allocate memory in the program, so when
homedir is successfully assigned the result of getenv("HOME") and it's
later tried to be freed, it fails because the memory being used is
outside the ZSNES program memory space. I tried to add a simple int
that is initialized to 0 before that getenv() call and if the getenv
call fails, it'll set that int to 1, and then before the free(homedir)
I put in an if to check if that int is a 1 or not, and if it was, then
do the free(), and that stopped ZSNES from crashing on loading under
my system. I hope this helps out.


More information about the freebsd-ports mailing list