From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13238 invoked by alias); 12 Oct 2005 05:59:05 -0000 Mailing-List: contact glibc-bugs-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sources.redhat.com Received: (qmail 13215 invoked by uid 48); 12 Oct 2005 05:59:02 -0000 Date: Wed, 12 Oct 2005 05:59:00 -0000 Message-ID: <20051012055902.13214.qmail@sourceware.org> From: "nmiell at comcast dot net" To: glibc-bugs@sources.redhat.com In-Reply-To: <20051012052102.1468.nmiell@comcast.net> References: <20051012052102.1468.nmiell@comcast.net> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/1468] AMD64 {get,set,swap,make}context use wrong offsets into ucontext_t X-Bugzilla-Reason: CC X-SW-Source: 2005-10/txt/msg00036.txt.bz2 List-Id: ------- Additional Comments From nmiell at comcast dot net 2005-10-12 05:59 ------- Even with this patch, the the context functions still use the wrong offsets. The problem is that FNSTENV and FLDENV operate on memory with the following layout: struct fpenv { uint16_t cwd; uint16_t __pad0; uint16_t swd; uint16_t __pad1; uint16_t ftw; uint16_t __pad2; uint32_t eip; uint16_t cs; uint16_t opcode; uint32_t edi; uint16_t ds; uint16_t __pad3 }; while struct _libc_fpstate uses the 64-bit FXSAVE/FXRSTOR format, which starts like this: struct _libc_fpstate { __uint16_t cwd; __uint16_t swd; __uint16_t ftw; __uint16_t fop; __uint64_t rip; __uint64_t rdp; __uint32_t mxcsr; /* ... */ } Which means that the existing code which does FNSTENV to uc.__fpregs_mem will store members in the wrong locations and will corrupt the saved %mxcsr (assuming the struct offsets in ucontext_i.h are corrected without any other updates to the context functions). -- http://sourceware.org/bugzilla/show_bug.cgi?id=1468 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.