www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/12/10/17:45:07

Date: Sun, 8 Dec 1996 20:01:50 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
cc: Charles Sandmann <sandmann AT clio DOT rice DOT edu>, DJ Delorie <dj AT delorie DOT com>
Subject: Emacs crashes on WinNT in crt0
Message-ID: <Pine.SUN.3.91.961208195110.3884D-100000@is>
MIME-Version: 1.0

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019