|
From: John R.
|
Julian Seward wrote: >>I have an idea why this happened. How does the application set >>the LDT entry it wants to use (which is 0x7B >> 3 ?) > > > In fact it's a GDT entry, not an LDT entry, and Valgrind believes > the .limit field of the entry is zero, which is why it issues > a segfault. This probably means V thinks the GDT entry has never > been set. I have no idea how/where in Allegro the GDT entry is set. Valgrind should assume that each segment in the GDT starts with a .limit of 0xfffff, and it's in pages (not bytes) and is inclusive. This means that Valgrind might as well not check .limit of GDT segments. In a segment descriptor, a 0 in bit 0 (the low-order bit) signifies GDT. The operating system kernel sets the GDT all by itself, and provides no means for the user to read its contents. Linux uses only a couple fixed GDT entries per process (see USER_CS and USER_DS in linux/include/asm-i386/processor.h) but the constants can change from time to time [especially from distro to distro, Win4Lin, etc.] -- John Reiser, jreiser@BitWagon.com |