[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] XaAES regression in launch()



Vincent Rivière, 20.11.2012 23:47:46:

On 20/11/2012 00:08, Vincent Rivière wrote:
- TeraDesk does Bus Error at startup

Don't ask me why, but today I have again the Bus Error at startup.

Is teradesk run by xaaes.cnf (shell=)?

While the TeraDesk process crashes, the offending code is actually in XaAES.
It seems to crash in scrlobj.c, function draw_nesticon(), line 668:

		if (this->prev || this->up)
		{
			pnt[0] = x + x_center;

When testing for this->up, the "this" pointer is trashed, and actually contains the 'XBRA' value. Very strange.

When adding a breakpoint there with CodeWarrior, I see the following.

1) The first 2 calls to that code works fine, while the Bus Error happens on the 3rd breakpoint hit.

2) On the 3rd call, I see that a0 is trashed ("this" pointer), but also sr which has the bogus value of 0x0000.

So I suspect that the bombing code is not called directly, but instead some RTE instruction was called on a corrupted stack and the PC went to that code by mistake.

Well... What to do, now?

First I would write a DBG at the beginning and return of draw_nesticon to verify it is really not called directly.

Do you say that the wrong RTE succeeds 2 times before it crashes?

It's not necessarily caused by teradesk, disable everything (enable memory-protection ;-))

What is around that XBRA-pointer?

Maybe it's a simple stack-overflow.

What about the kfree from your previous finding?

--
Helmut Karlowski