ZSnes V1.42 crashes immediately in FreeBSD

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

Post Reply
Sol
Rookie
Posts: 14
Joined: Sun Jan 09, 2005 7:36 am

ZSnes V1.42 crashes immediately in FreeBSD

Post by Sol »

Perhaps someone made a mistake putting ZSnes V1.42 in the ports tree of FreeBSD, however, here is the error in case it's a problem with ZSnes:
ZSNES v1.42 (c) 1997-2005, ZSNES Team

Be sure to check http://www.zsnes.com/ for the latest version.
Please report crashes to zsnes-devel@lists.sourceforge.net.

ZSNES is written by the ZSNES Team (See AUTHORS.TXT)
ZSNES comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions;
please read 'LICENSE' thoroughly before doing so.

Use ZSNES -? for command line definitions.

zsnes in free(): error: junk pointer, too high to make sense
Abort trap
Note that 1.40 compiles and runs great (same with 1.36).
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Compile ZSNES yourself.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Sol
Rookie
Posts: 14
Joined: Sun Jan 09, 2005 7:36 am

Post by Sol »

Sorry let me explain a little better.

The ports tree is the source tree to ports to FreeBSD.

In short, I did compile it myself.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Compile a debug build and get a back trace.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Sol
Rookie
Posts: 14
Joined: Sun Jan 09, 2005 7:36 am

Post by Sol »

Hrm, never done this before :)

I compiled ZSnes V1.42 with -g, then executed it with gdb.

The "bt' command says "No stack."

I'll let you know if I figure this out :)
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

You configure ZSNES with debug=yes, then make clean and make.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Sol
Rookie
Posts: 14
Joined: Sun Jan 09, 2005 7:36 am

Post by Sol »

Did that, got 'zsnesd'

Same crash, so it's not the optimizations causing it...however I'm still getting the "No stack." with gdb. I have a feeling my issues with gdb are my own though, not zsnes.
CyberBotX
Lurker
Posts: 109
Joined: Sun Jan 30, 2005 10:06 pm
Location: Wouldn't you like to know?
Contact:

Post by CyberBotX »

I'm not sure if this will help any, but I get the same free() error with both 1.41 and 1.42, the following is after compiling both 1.41 and 1.42 on my FreeBSD 5.3 system. Only changes I needed to make was to have the Makefile use some extra -I and flags when compiling because FreeBSD puts it's files for OpenGL into the /usr/X11R6 folder, not the /usr/local folder.

Code: Select all

[kirby /shared/zsnes_1_41/src]# ./zsnes

ZSNES v1.41 (c) 1997-2005, ZSNES Team

Be sure to check http://www.zsnes.com/ for the latest version.
Please report crashes to zsnes-devel@lists.sourceforge.net.

ZSNES is written by the ZSNES Team (See AUTHORS.TXT)
ZSNES comes with ABSOLUTELY NO WARRANTY.  This is free software,
and you are welcome to redistribute it under certain conditions;
please read 'LICENSE' thoroughly before doing so.

Use ZSNES -? for command line definitions.

zsnes in free(): error: junk pointer, too high to make sense
Abort (core dumped)
(Same exact thing with 1.42)

Now, I did try to compile it with debugging support, but for some reason, nasm cores during the compile of cpu/addrni.asm when debugging is turned on, but doesn't if I don't turn on debugging.

Now, oddly enough, 1.40 compiles and runs perfectly fine under FreeBSD. Puzzling, to say the least.
[url=http://www.cyberbotx.com/]SNES Sprite Animations[/url], made by an Insane Killer Robot.
I'm a computer programmer (in C++) and a future game designer.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Which version of NASM?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
CyberBotX
Lurker
Posts: 109
Joined: Sun Jan 30, 2005 10:06 pm
Location: Wouldn't you like to know?
Contact:

Post by CyberBotX »

[kirby /win2k/SNES Roms]# nasm -v
NASM version 0.98.39 compiled on Jan 25 2005
[url=http://www.cyberbotx.com/]SNES Sprite Animations[/url], made by an Insane Killer Robot.
I'm a computer programmer (in C++) and a future game designer.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Is CVS working any better for you?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
CyberBotX
Lurker
Posts: 109
Joined: Sun Jan 30, 2005 10:06 pm
Location: Wouldn't you like to know?
Contact:

Post by CyberBotX »

Well, if you mean the WIP, I tried the latest one (2/10) and it has the same crash error. As far as compiling the latest WIP with debug=yes sent to configure, same core with nasm.
[url=http://www.cyberbotx.com/]SNES Sprite Animations[/url], made by an Insane Killer Robot.
I'm a computer programmer (in C++) and a future game designer.
CyberBotX
Lurker
Posts: 109
Joined: Sun Jan 30, 2005 10:06 pm
Location: Wouldn't you like to know?
Contact:

Post by CyberBotX »

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.
[url=http://www.cyberbotx.com/]SNES Sprite Animations[/url], made by an Insane Killer Robot.
I'm a computer programmer (in C++) and a future game designer.
Post Reply