|
From: Julian S. <js...@ac...> - 2006-03-19 12:42:32
|
> * With valgrind SVN r1600, allegro demo no longer reports > unhandled instruction but segfaults. I've looked at this some more. It is to do with the use of %es: segment overrides in _linear_putpixel, and specifically this towards the end: 26 88 1c 08 mov %bl,%es:(%eax,%ecx,1) Valgrind simulates the LDT/GDT directly and so computes linear addresses from virtual addresses (I think I have the jargon correct here). Anyway, it looks in the process' LDT at the entry indicated by %es, to get the right offset. This mechanism is known to work OK since most threaded programs on Linux require segment overriding to work properly. Anyway: Valgrind computes the linear address, and decides it is invalid for some reason, so it whacks the program with a segmentation fault, which is what you saw. I have an idea why this happened. How does the application set the LDT entry it wants to use (which is 0x7B >> 3 ?) I don't know. It should do a modify_ldt syscall, but I don't see any of those. Valgrind builds its picture of the program's LDT by intercepting this syscall, but I don't see any such syscalls in the log (--trace-syscalls=yes). If you want to help track this down, go figure out how/where the LDT entry is set. Obviously something's not right with V since the program runs fine on my SuSE 10 box when not running on V. J |