Date: Sun, 8 Dec 1996 20:01:50 +0200 (IST) From: Eli Zaretskii To: djgpp-workers AT delorie DOT com cc: Charles Sandmann , DJ Delorie Subject: Emacs crashes on WinNT in crt0 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII A user wrote to me that DJGPP Emacs crashes on NT 4.0 at startup. The following is a part of the run under a debugger that he sent me and the corresponding source fragment from src/libc/crt0/crt0.s. It seems that Emacs crashes at the instruction which puts DX into SS (marked with <<<<<<). Is there anything special about the NT DPMI host wrt setting SS? ------------------- debugger session ---------------------------------- 0000123d: a104081000 mov eax,[0x100804] 00001242: 648b0d14000000 mov ecx,fs:[0x14] 00001249: 39c8 cmp eax,ecx eax=0000a000 ecx=00040000 0000124b: 7d07 jge 0x1254 0000124d: 89c8 mov eax,ecx ecx=00040000 0000124f: a304081000 mov [0x100804],eax eax=00040000 00001254: 50 push eax eax=00040000 00001255: e80e010000 call 0x1368 0000125a: 83f8ff cmp eax,-1 eax=001a0054 0000125d: 741c jz 0x127b 0000125f: a300081000 mov [0x100800],eax eax=001a0054 00001264: 030504081000 add eax,[0x100804] eax=001a0054 0000126a: 668cda mov dx,ds 0000126d: 668ed2 mov ss,dx dx=0227 eax=00000257 ebx=001dff30 ecx=00000000 edx=00000257 esi=001d00d7 edi=001dff6c ebp=001d2048 RF UP IE PL ZR AC PE NC ds=00b7 es=00d7 fs=0217 gs=024f ss:esp=00b7:00002042 cs=00c7 exception 13 (0xd) occurred, error code=0 --------------------- crt0.s -------------------------------------------- movl __stklen, %eax /* get program-requested stack size */ .byte 0x64 /* fs: */ movl STUBINFO_MINSTACK, %ecx /* get stub-requested stack size */ cmpl %ecx, %eax jge use_stubinfo_stack_size /* use the larger of the two */ movl %ecx, %eax movl %eax, __stklen /* store the actual stack length */ use_stubinfo_stack_size: pushl %eax call ___sbrk /* allocate the memory */ cmpl $-1, %eax je no_memory movl %eax, ___djgpp_stack_limit /* Bottom of stack */ addl __stklen, %eax movw %ds, %dx /* set stack */ movw %dx, %ss ; <<<<<<<<< Emacs crashes here movl %eax, %esp