Re: Debugging "A machine-level exception"
- Posted by bernie Aug 22, 2008
- 1026 views
According to the documentation, OleCreateFontIndirect returns E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, E_NOINTERFACE and E_POINTER errors.
Eucom has routines to check for errors, they're just not used there, until now :)
On eucom.ew, quick_activate function add below the line:
ok = c_func( OleCreateFontIndirect, { pfont, riid, ppvIFont } )
This code:
if is_error(ok) then com_err_out(1) -- Print the error on console com_error(ok) -- Display the error on console while get_key() = -1 do -- Wait for key press end while ?1/0 -- Crash end if
Hi gbonvehi, bernie,
Thank you for your replies. I certainly am not ruling out the cause being a memory fault, but I'm not 100% sure how to judge. Still pursuing the 2nd crash if we look at the values we see
- pfont = 12771300
- mset = 8733316
- ppvIFont = 1623916
- riid = 9406540
None are a NULL value.
I like your suggestion to do proper error checking, however the crash was attributed to this line 1626:-
ok = c_func( OleCreateFontIndirect, { pfont, riid, ppvIFont } )
so we'd not get a chance to do any subsequent is_error(ok) checks since we've already crashed. Presumably we should be checking the return values from
ppvIFont = w32acquire_mem( mset, 4 ) riid = w32acquire_mem( mset, string_to_guid( IFont_ ) )
Would they be NULL if there was no memory available?
We crashed within OleCreateFontIndirect. I found the OleCreateFontIndirect documentation, thank you for suggesting that. So I'm guessing the most important thing would be to try and see what that call returned.
How can I go about achieving that?
Is it possible from the ex.err I already have?
Cheers,
Mark
Mark:
-- Isn't ppvIFont a pointer to a pointer ?? atom output_variable, ppvIFont output_variable = w32acquire_mem( mset, 4 ) ppvIFont = w32acquire_mem( mset, 4 ) poke4(ppvIFont,output_variable) -- ppvIFont now contains pointer to the output_variable pointer.