RE: EXW Crashes!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hi there,

>> I keep getting errors with EXW trying to access 0xffffffff

Yes, as others had mentioned you are probably trying to poke a 
value into memory that your code hadnt yet allocated.
This is something you have to be very strict with.

You cant allocate 8 bytes and poke 9:
    atom addr
    addr=allocate(8)
    poke(addr,{1,2,3,4,5,6,7,8,9})--triggers error
    maybe_call_a_function()
    free(addr)

A simple way to troubleshoot this kind of problem is
to insert a few traces into the program such as:

1   with trace
2   atom addr
3   ?1
4   trace(1)
5   addr=allocate(8)
6   poke(addr,{1,2,3,4,5,6,7,8,9})
7   maybe_call_a_function()
8   free(addr)
9   ?2
10  trace(1)

Now when you run the program, it prints a '1' to the screen
and then starts tracing at the first trace command.
Now you hit 'Q' and the program crashes BEFORE printing the
'2', so you know the error occurred between the place where
the '1' is being printed (line #3) and where the '2'
is being printed (line #9).
Now you run the program again only
this time after the program prints the '1' and starts tracing,
instead of hitting 'Q' you hit ENTER and trace through
it line by line.  When you get to the line that causes the error
and you hit enter, the program crashes.  Now you know the line
that caused the error at least.  You then have to start
examining the code up to that point in the program to find
what may be responsible for the error.  In this example you would
have to recognize the fact that there are 9 items being 
poked into successive locations when only 8 have been allocated.

Sometimes thats the only way to locate an error.

Oh you could try WinDebug which is on the Euphoria site download
area, but the procedure is somewhat the same.

Good luck with it.
--Al

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu