Date: Sat, 7 May 2005 00:47:53 +0200 From: Martin Gumucio <martin.gumucio@gmail.com> To: ports@FreeBSD.org Subject: FreeBSD Port: zsnes-1.42 Message-ID: <6ed3737105050615476b567b14@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
Its broken, all you get is a crash =20 "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=3D2271&highlight=3Dzsnes+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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6ed3737105050615476b567b14>