From 0ab2bbbd1b62544a868d3a2207aa51d2f93db8e7 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Mon, 2 Jul 2012 15:58:52 +0200 Subject: [PATCH] Finally fixed the loaderbug! Programs were crashing randomly at startup on the kthread branch. After some investigation, it turned out that the programs weren't correctly loaded by the program loader in rare cases. Although, all investigation showed that the program loader was correct and so was the interrupt routines (well, almost, but nothing that could really trigger this). Yada yada, a few months later I discovered that memcpy(3) was being corrupted by an interrupt handler (which was correct). Turns out memcpy used stack space it hadn't allocated. This is a Linux optimization that I had forgotten to disable with -mno-red-zone in libmaxsi and thus interrupts just overwrote the stack of optimized functions. Eek! --- libmaxsi/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmaxsi/Makefile b/libmaxsi/Makefile index ced95129..86835980 100644 --- a/libmaxsi/Makefile +++ b/libmaxsi/Makefile @@ -14,7 +14,7 @@ endif ifeq ($(CPU),x64) CPU=x64 CPUDEFINES=-DPLATFORM_X64 - CPUFLAGS=-fPIC -m64 + CPUFLAGS=-fPIC -m64 -mno-red-zone CPULDFLAGS=-melf_x86_64 CPUASFLAGS=-64 endif