This site is no longer active and is available for archival purposes only. Registration and login is disabled.

X Scale freezes


X Scale freezes

Postby masCh » Jan 30, 2003 @ 5:49am

Hola. My first topic here so forgive me if I sound enthusiatic =P

I've recently developed a couple of apps, one using the pocketfrog libraries by Thierry and one using EVC's own MFCs.

My problem is both games can run fine on my ipaq 3870 and someone's 36xx series but I've had a couple of reports that it causes Toshiba (X-scale) and the 3970 (also X-scale) to freeze on some occasions.

I have no idea how that could happen because the one using MFC does not use external classes at all and it can still freeze? Well yes it could be my coding that really sux0rz but I cannot find a clue as to why.

My only assumption is that my file reading/writing routine could cause their systems to freeze. I use a text file as storage (check high scores for the game and ctreectrl items for the app). I access the text file quite often, maybe once in every 2 secs. The way I do it right now is that I read the whole file, store it into an array, edit some entries and write a new file with the same name to save the array. I believe there's a better way to do this but I have no idea how.

Does anyone here think that could be the problem? If so then how come I can do so many things on my strongARM and not encounter the same problem?

If file access is the problem, then is there a better solution? I dont know, if there is, please teach me.

Thanks in advance.

masCh
masCh
pm Member
 
Posts: 38
Joined: Oct 14, 2002 @ 6:43pm


Postby refractor » Jan 30, 2003 @ 11:03am

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby masCh » Jan 30, 2003 @ 11:23am

masCh
pm Member
 
Posts: 38
Joined: Oct 14, 2002 @ 6:43pm


Postby refractor » Jan 30, 2003 @ 11:53am

User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby Sm!rk » Jan 30, 2003 @ 6:05pm

User avatar
Sm!rk
pm Member
 
Posts: 172
Joined: Dec 16, 2002 @ 4:40pm


Postby masCh » Feb 4, 2003 @ 8:13am

masCh
pm Member
 
Posts: 38
Joined: Oct 14, 2002 @ 6:43pm


Postby Dan East » Feb 4, 2003 @ 4:29pm

User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Sm!rk » Feb 4, 2003 @ 10:02pm

User avatar
Sm!rk
pm Member
 
Posts: 172
Joined: Dec 16, 2002 @ 4:40pm


Postby masCh » Feb 5, 2003 @ 2:41am

Hrmm, I've changed my code so that it doesnt save states every 2 secs. Now if the user presses something then I save to file.

The problem code I think is with my CTreeCtrl object. I cannot detect if the user hit the checkbox or no. I dont know how to use HitTest. So to save myself from headaches I'd just save the file every few secs. If I can detect if the user hits the checkbox then I can get rid of that part of the code. The checkbox was made using the dialog wizard with the checkbox option turned on.

The problem with my game is also during file access. Both in my game and this CTreeCtrl app I used arrays to store file data. So my X-Scale freezing problem could be either the array or the file opening/writing/reading.

My biggest question is probably why does it only happen with X-Scale devices? I dont have an X-Scale device and I could not test my codes extensively on it.
masCh
pm Member
 
Posts: 38
Joined: Oct 14, 2002 @ 6:43pm


Postby Dan East » Feb 5, 2003 @ 3:02am

More than likely you have a bug in your code that only manifests on that hardware. I've seen that type of thing happen many, many times. Typically it is from writing past the end of an array.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby Deje » Feb 5, 2003 @ 3:41am

Deje
pm Member
 
Posts: 37
Joined: Oct 15, 2002 @ 10:08pm
Location: Germany


Postby masCh » Feb 5, 2003 @ 5:20am

Hrmm I have no idea what Dan said =) If you write past an array wont that give you an error? Like out of bounds or something. I thought I've seen that happen. I'm assuming you mean int array[30] and I try to write array[30]=20; That would give it an error wont it?

Deje, how do you use assert and what does it do? Will it terminate the program if it finds a buggy array or something?

Answer to your question, yeah afraid of resets and crashes and all data will be lost. I only use one data file per app so far. But I dont think its because I access files often.. because in my other software (the game) I only check/write high scores and that causes problems in some 39xx series. I only do that once.

What is a memory mapped file? Dont need a major description, just a small one so I can decide if I want to really take a look at it and then I'll search for it on the web.

I'm starting to think that its because I save file states in the array and the problem could be somewhere there.

I dont have my code with me here at work or I could post what I'm doing.

By the way, thanks for all the help so far guys, I just realized there are so many things I've overlooked
masCh
pm Member
 
Posts: 38
Joined: Oct 14, 2002 @ 6:43pm


Postby fzammetti » Feb 5, 2003 @ 5:55am

No, you won't get an error if you write past the bounds of an array. Unfortunately in that respect, this isn't Java!

I know this from recent experience... My current project I had an array that gets cleared at the beginning of various screens in the game. Well, I was off by 1 when clearing the array, and what would happen is that if I compiled the program as a debug build, no problem manifested itself. However, when I switched to a release build, a completely unrelated screen was giving me problems.

I know that release builds by default turn off array bounds checking, and my assumption is that those checks, which would be present in a debug build usually, just stop the overwrite from happening, but still give no error. I could be wrong about that.

It was either that, or it must have been laying the allocated array memory out differently in release vs. debug and the off-by-one loop was only causing a problem when it was layed out a certain way, i.e., how it was in the release build (spent the better part of a day walking through code line-by-line banging my head against the desk before I figured that one out).

So, ignoring my pointless and somewhat off-topic babbling...

Could it be a debug vs. release build issue?

And in either case, you won't get any error if you overwrite bounds arrays. C just isn't that nice!

Also, your thought that if might not be the file access but the array maniulations should be easy to test: simply comment out the code that writes to a file, but leave all the array stuff intact. If it's the array code, you should still see your freezes.

A memory-mapped file by the way is basically just a file that you treat as a chunk of memory. Not sure that would really benefit you much here, but that's a very simplistic explanation anyway.
...and so I said to Mr. Gates: "$640 billion should be enough for anyone!"
User avatar
fzammetti
pm Insider
 
Posts: 1496
Joined: Jun 4, 2002 @ 6:21pm
Location: Omnytex Technologies


Postby refractor » Feb 5, 2003 @ 3:58pm

One thing to bear in mind is that you shouldn't let the software read+write to a flash-media frequently (because it'll destroy the media).
User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby masCh » Feb 10, 2003 @ 5:55am

masCh
pm Member
 
Posts: 38
Joined: Oct 14, 2002 @ 6:43pm


Next

Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum