Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sparcv8leon3-generic-qemu: stack overflow during register spilling causes Data Access Error in kernel #1222

Open
badochov opened this issue Oct 28, 2024 · 0 comments
Assignees
Labels
bug Something isn't working kernel

Comments

@badochov
Copy link
Contributor

The program below causes kernel to access location past mapped ustack during register spilling.

#include <stdio.h>


void a(int i) {
	if (i != 0) {
		b(i - 1); 
	}
	printf("A\n");
}

void b(int i) {
	if (i != 0) {
		a(i - 1); 
	}
	printf("B\n");
}


int main(void)
{
	a(34);

	return 0;
}

Error:

qemu: fatal: Trap 0x29 (Data Access Error) while interrupts disabled, Error state
pc: c0006f34  npc: c0006f38
%g0-7: 00000000 00004001 00000008 00000400 00000034 00000000 00000000 00001004
%o0-7: 00000001 00004000 00000002 c002a000 c015cc00 c002a000 7fffefa8 00012540 
%l0-7: f39000c5 c0014c60 c0014c64 c0006800 00002000 c001c7fc c001f040 c015fd40 
%i0-7: 00000001 00004000 00000002 7ffff058 00000001 c015cc00 7ffff008 00012588 
%f00:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f08:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f16:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
%f24:  0000000000000000 0000000000000000 0000000000000000 0000000000000000
psr: f3900085 (icc: N--C SPE: S--) wim: 00000008
fsr: 00000000 y: 00000000

pc points to sparcv8leon3/_traps.S:627

@badochov badochov added bug Something isn't working kernel labels Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kernel
Projects
None yet
Development

No branches or pull requests

2 participants