English Amiga Board

Go Back   English Amiga Board > Support > support.Other

Thread Tools
Old 06 July 2010, 19:23   #1
Local Moderator
john4p's Avatar
Join Date: Feb 2008
Location: Germany
Posts: 4,642
Question savestate.cpp => segmentation fault

Tried to create a savestate with UAE4All using your savestate.cpp-source, Toni.

But it always crashes in the function save_state(...) with a "segmentation fault".

The first call to save_chunk(...) from inside save_state(...) works:

save_chunk(f, header, dst-header, "ASF ");

doesn't crash.

But then, after "dst = save_cpu(&len);" the next call to save_chunk() crashes:

save_chunk(f, dst, len, "CPU ");

The segmentation fault exactly happens when save_chunk(...) now tries to write the "chunk data":

fwrite(chunk, 1, len, f); => CRASH

In the first call to save_chunk(..."ASF ") which works the values for chunk and len were:
chunk: 0
len: 28

In the call to save_chunk(..."CPU ") which crashes the values for chunk and len were:
chunk: 172
len: 239020

Do you have any idea what could be the reason for this segmentation fault?

Last edited by john4p; 06 July 2010 at 19:31.
john4p is offline  
Old 07 July 2010, 08:11   #2
Toni Wilen
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 46
Posts: 24,871
I don't know, I don't want to do that kind of debugging (without source level debugger)

But you can't simply use statestate.cpp and expect it to work without all other related routines.
Toni Wilen is offline  
Old 07 July 2010, 08:55   #3
Local Moderator
john4p's Avatar
Join Date: Feb 2008
Location: Germany
Posts: 4,642
Thanks for the reply.

Just took all the savestate-related stuff from the Nokia N900-port with Cyclone and put it into the Pandora-port of UAE4All. Everything built correct (after fiddling here and there) but resulted in the segmentation fault when trying to create a savestate.
Now I just built the N900-port itself on Pandora and tried to create a savestate => also segmentation fault.

Found out the "implementation" of save_cpu() for Cyclone doesn't seem to save all that much:
static __inline__ uae_u8 *save_cpu (int *len)
	return (uae_u8 *)len;
Now built the N900 port with "UAE M68k-core" (and without Cyclone) and savestates work.
So for Cyclone the possibility to save the CPU's state just hasn't been implemented.
john4p is offline  

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to start FS-UAE because of segmentation fault [Solved] v3gard support.FS-UAE 2 18 March 2013 18:32
Regarding savestate torbenb support.WinUAE 2 24 January 2012 19:33
chip label to add in rommgr.cpp pucci support.WinUAE 0 09 October 2011 11:56
some doubts on the rom (kickstart) management in rommgr.cpp pucci support.WinUAE 2 11 September 2011 14:42
Help Need a Coder for some CPP cosmicfrog support.Other 0 29 April 2010 07:08

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 19:02.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.06864 seconds with 13 queries