Advice about "Internal error, no stack for trap handler"
Gavin Cawley (8462) 70 posts |
Problem solved (see below) Many thanks to anyone that looked in to help! Hi, I am having a bit of trouble dealing with a bug in my program “!tabby” (see thread in “Announcements”) – when loading a !WinEd window (a saved one, rather than a new blank one), I get the error message:Internal error, no stack for trap handler: Is the address part of the task’s address space, it seems rather high? I am pretty sure the task’s stack has been corrupted as the error is generated as the flow of control leaves this function
and where it is called looks like this:
The end of the log contains the “Leaving ‘tabPane_addTab’” message, but not the “back from tabPane_addTab” message. LOG works by sending user messages to another task, so buffering shouldn’t be a problem. I’ve gone through all the code and I can’t see anything that is likely to corrupt the stack (and tested buffer over-runs etc). If I change buffer to contain 8192 bytes or more, the error goes away, even if I don’t call the code that uses it. It is odd that !tabby only does this with !WinEd as far as I can tell, and it is odd that there is no problem if it is a blank (unsaved) template file. Debugging WIMP programs is a lot harder than MATLAB! I’d be very grateful for any suggestions! The GITHub repository is here (beware it isn’t fully working version as I have commented some parts out to try an pin down the problem): |
Gavin Cawley (8462) 70 posts |
Problem solved, I was using wimp_get_wind_info incorrectly – it was reading in all the icon info into the buffer, which is why it was O.K. when it was a blank template file. |
David J. Ruck (33) 1635 posts |
There’s almost no problem that the solution doesn’t become obvious to you, within a few seconds of writing down a full description posting to a forum! :) |
Gavin Cawley (8462) 70 posts |
Indeed, on the bright side, at least it is guaranteed to work! ;o) |
Paul Sprangers (346) 524 posts |
Ha-ha, that’s something that even I recognise (sometimes). |
George T. Greenfield (154) 748 posts |
This is so true that I sometimes wonder whether posts shouldn’t automatically go into a ‘pending’ section of the site, while generating a ‘do you want to think about that for a moment?’ message. This would certainly have saved me from embarassment in the past! |
Steve Pampling (1551) 8170 posts |
The world doesn’t work like that – it isn’t until you’ve (potentially) embarrassed yourself that the realisation kicks in. |
Andy S (2979) 504 posts |
The world doesn’t work like that – it isn’t until you’ve (potentially) embarrassed yourself that the realisation kicks in. Absolutely. |