Discussion:
[Mops] array bound violations
(too old to reply)
Mike Hore
2003-11-10 03:24:47 UTC
Permalink
Hi folks, I'm wondering if anybody knows if I can do anything
about this:

Back on old Mac OSs (like 7.x etc) with 68k Mops, I could
install a trap catching routine to catch the trap generated by the
CHK instruction if the check showed a bounds violation.

On the PowerPC, the equivalent instruction is tw/twi (trap word
/trap word immediate) which causes a trap if a specified condition
isn't met. The PowerMops array accessing sequence generates
this instruction if range_check? is true.

But on modern Mac OS's, especially OSX, how can
I install some code to catch this trap?

As it is at present, under OSX, if I deliberately do a bounds
violation, PowerMops unexpectedly quits.

If I do it under OS9, I get error 212 ("execute finds an odd
segment number") which is an internal checking error which
has no obvious connection with bounds violations -- my
current theory is that the system is just sending me to a
strange address that just happens to lead to a sequence of events
ending up with that error.

Now I can do an outrageous kludge under OS9 and just change
the error message to say "bounds violation", but that's hardly a
fix. Does anybody have any ideas on installing a handler for
the trap resulting from the tw/twi instruction?

Cheers, Mike.

-------------------------------------------------------------------
Mike Hore ***@OVE.invalid.icasolution.com.au
-------------------------------------------------------------------
Mike Hore
2003-11-12 05:43:19 UTC
Permalink
[catching the bounds check trap]

I might have the answer to my own question here:
http://developer.apple.com/documentation/Carbon/Reference/Debugger_Services/
index.html


I'll need to check this out and give it a try -- crashes coming up...

Cheers, Mike.

-------------------------------------------------------------------
Mike Hore ***@OVE.invalid.icasolution.com.au
------------------------------------------------------------------
ward mcfarland
2003-11-12 11:38:47 UTC
Permalink
Post by Mike Hore
http://developer.apple.com/documentation/Carbon/Reference/Debugger_Services/
index.html
It looks like the typical recent vintage Apple documentation. Lists the
calls and parms, no explanations, no discussion, no examples.
Mike Hore
2003-11-12 21:50:13 UTC
Permalink
Post by ward mcfarland
Post by Mike Hore
http://developer.apple.com/documentation/Carbon/Reference/Debugger_Services/
index.html
It looks like the typical recent vintage Apple documentation. Lists the
calls and parms, no explanations, no discussion, no examples.
Yep, precisely, that's why it's going to be crash and burn time.
I guess there's so much going on with the system that nobody's
had time to document things properly?

I can't possibly imagine how that could happen. Totally
unforgivable.


Cheers, Mike.



PS: Most Aussies make frequent use of heavy sarcasm, but I
wouldn't do that, would I?


----------------------------------------------------------------
Mike Hore ***@OVE.invalid.icasolution.com.a
(sorry about munged email address, but you should be able to
figure it out)
----------------------------------------------------------------
ward mcfarland
2003-11-13 11:53:34 UTC
Permalink
Post by Mike Hore
Yep, precisely, that's why it's going to be crash and burn time.
I guess there's so much going on with the system that nobody's
had time to document things properly?
I have most of the Carbon mailing list archived. I will give it a
look-see later in case anyone has shared any information there.

Worst case, you can use DebugStr to send a message to Console Log, but
that doesn't prevent the crash.
Mike Hore
2003-11-14 05:10:12 UTC
Permalink
Post by ward mcfarland
I have most of the Carbon mailing list archived. I will give it a
look-see later in case anyone has shared any information there.
OK, thanks. I was on that mailing list for a while but the
volume of messages was so huge I gave up.
Post by ward mcfarland
Worst case, you can use DebugStr to send a message to Console Log, but
that doesn't prevent the crash.
I usually do all my testing under OS9 where I have Jasik's
Debugger installed -- that's absolutely magnificent for
low-level debugging -- too bad he hasn't done anything for
OSX though I don't blame him. He probably wants to retire.

Anyway when I have everything working I check it out under
OSX and hope for the best. I haven't bothered to learn
gdb yet. Jasik's just about spoiled me for anything
else.

Well right now I'm just about to do a new Mops release
so I don't plan on doing anything adventurous until after
that -- I'll definitely slate this one for after the
new release.

Cheers, Mike.


----------------------------------------------------------------
Mike Hore ***@OVE.invalid.icasolution.com.au
(sorry about munged email address, but you should be able to
figure it out)
----------------------------------------------------------------

Loading...