Grigory Batalov wrote:
FYI, LD_ASSUME_KERNEL=2.2.5 doesn't work for me.
LD_ASSUME_KERNEL is a temporary solution that was intended to be removed as soon as the proper fix is found. Unfortunately the side-effect is that people are no longer interested in testing the potential fixes - they are quite fine with LD_ASSUME_KERNEL and I don't see how this can be resolved without backing out the LD_ASSUME_KERNEL thing but this is also not good before there is a tested fix:(
Without LD_ASSUME_KERNEL it works. I use kernel 2.4.20 and glibc-2.2.6 from ALTLinux distribution (www.altlinux.com).
Is there any chance for ALTLinux to get upgraded to NPTL so that you can test the patches?
The potential fix I am talking about is attached. If anyone have a broken DPMI due to NPTL without an LD_ASSUME_KERNEL thing, please test.
--- src/arch/linux/async/sigsegv.c Sat Jun 7 12:10:16 2003
+++ src/arch/linux/async/sigsegv.c Thu Jul 17 20:52:08 2003
@@ -324,16 +324,21 @@
{
/*
* FIRST thing to do - to avoid being trapped into int0x11
- * forever, we must clear AC before doing anything else!
- * Clear also ID for some reasons?
+ * forever, we must restore the eflags.
+ * Also restore the %fs and %gs for compatibility with NPTL.
*/
- __asm__ __volatile__ (" \
- pushfl\n \
- popl %%eax\n \
- andl %0,%%eax\n \
- pushl %%eax\n \
- popfl" \
- : : "i"(~(AC|ID)) : "%eax");
+ if (in_dpmi && !in_vm86 && context.cs != UCODESEL) {
+ __asm__ __volatile__ (" \
+ pushl %0\n \
+ popfl\n \
+ movw %1, %%fs\n \
+ movw %2, %%gs\n \
+ " \
+ : :
+ "m"(emu_stack_frame->eflags),
+ "m"(emu_stack_frame->fs),
+ "m"(emu_stack_frame->gs));
+ }
fault_cnt++;
--- src/dosext/dpmi/dpmi.c Wed Jul 16 21:54:22 2003
+++ src/dosext/dpmi/dpmi.c Thu Jul 17 20:15:45 2003
@@ -142,8 +142,8 @@
unsigned short DPMI_SEL = 0;
struct sigcontext_struct dpmi_stack_frame[DPMI_MAX_CLIENTS]; /* used to store the
dpmi client registers */
-static struct sigcontext_struct _emu_stack_frame; /* used to store emulator
registers */
-static struct sigcontext_struct *emu_stack_frame = &_emu_stack_frame;
+struct sigcontext_struct _emu_stack_frame; /* used to store emulator registers */
+struct sigcontext_struct *emu_stack_frame = &_emu_stack_frame;
#define CHECK_SELECTOR(x) \
{ if (!ValidAndUsedSelector(x) || SystemSelector(x)) { \
--- src/dosext/dpmi/dpmi.h Wed Jul 16 21:54:20 2003
+++ src/dosext/dpmi/dpmi.h Thu Jul 17 20:16:34 2003
@@ -142,6 +142,7 @@
extern INTDESC Interrupt_Table[0x100];
extern SEGDESC Segments[];
extern struct sigcontext_struct dpmi_stack_frame[DPMI_MAX_CLIENTS];
+extern struct sigcontext_struct *emu_stack_frame;
/* used to store the dpmi client registers */
extern RealModeCallBack mouseCallBack; /* user\'s mouse routine */
extern char *ldt_buffer;
