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

Re: [MiNT] Corruption of high TPA



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"

Attachment: tst.tos
Description: Binary data