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

Re: [MiNT] Corruption of high TPA



I tried tst.tos on my STe (4MB, MiNT 1.15) and my TT (4+64MB, MiNT 1.16.3a).

It works on the STe (with memory protection, at least I think it's switched on, MiNT is NOT named mintnp.prg) :) Indeed, no fastram.

On the TT it only works without memory protection; with memory protection it gives the following memory violation:

Type: Free
Addr: 01B9201A
PC: 012BA37E
BP: 01A90000
OS: FF82A27E

I should add that I normally run my TT with memory protection off, and that now I swithched it on, the Thing desktop had crashed first after which I launched Toswin straight from the XaAES menu. Dunno if this is the most reliable setup. ;)

Maurits.

On Jun 11, 2009, at 4:22 PM, Vincent Rivière wrote:

Alan Hourihane wrote:
I get a little uneasy about adding patches to mintlib when we can't
reproduce the bug on more than one system.

You're right.

Has anyone else reproduced
this without Aranym/EmuTOS ?

First, the test must be made with a problematic executable. Any program compiled with the current CVS MiNTLib is affected. The tiny program tst.tos attached to this email does not use the MiNTLib but is affected in the very same way.

The crash occurs only when the OS loads the program at some memory location where there is an invalid read address just after. For example, at the end of the FastRam (like EmuTOS). I guess that with the right memory protection parameters, the space just after the TPA is marked as unreadable, it is probably what happens on my setup.

Did you enable the NEW_SYSCALL stuff in the kernel and the bug
disappeared ??

No, I'm not familiar with the kernel, I didn't try to recompile it.
NEW_SYSCALL looks better, but I don't know if it works.

--
Vincent Rivière
	move.l	4(sp),a0	| get basepage
	move.l	4(a0),d0	| get _base->p_hitpa
	and.l	#0xfffffffc,d0	| align on lower 4 bytes

|	sub.l	#0,d0		| Bus Error before Hello
|	sub.l	#28,d0		| Bus Error before Hello
|	sub.l	#32,d0		| Bus Error after Hello
|	sub.l	#36,d0		| No Bus Error
	
	move.l	d0,sp		| this is the new stack

	pea	msg
	move.w	#9,-(sp)	| Cconws()
	trap	#1
	addq.l	#6,sp
	
	move.w	#8,-(sp)	| Cnecin()
	trap	#1
	addq.l	#2,sp

	clr.w	-(sp)		| Pterm0()
	trap	#1

msg:	.asciz	"Hello!\r\n"<tst.tos>