From: muller AT cerbere DOT u-strasbg DOT fr Message-Id: <3.0.6.32.20000218215350.009cf860@ics.u-strasbg.fr> X-Sender: muller AT ics DOT u-strasbg DOT fr X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32) Date: Fri, 18 Feb 2000 21:53:50 +0100 To: djgpp-workers AT delorie DOT com Subject: Re: Bug in crt0.S Cc: sandmann AT clio DOT rice DOT edu (Charles Sandmann) In-Reply-To: <38AD8997.295D9B17@inti.gov.ar> References: <200002171707 DOT SAA16280 AT cerbere DOT u-strasbg DOT fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Reply-To: djgpp-workers AT delorie DOT com Errors-To: dj-admin AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk At 15:04 18/02/00 -0300, you wrote: >Pierre Muller wrote: > >> Hello, >> >> I wrote the Run Time Library of the Free Pascal port to DJGPP system. >> As such, I changed crt0.S to allow starting a program without any use of the >> C library. >> >> Due to internal problems, I disabled the multiblock feature in the >> startup code. >> Thus our RTL uses Unixy sbrk with selector base changes. > >How it affects? is this problem found only when using Unixy sbrk? I don't know, it really seems that its only when the base is changed! >> Recently, we got more and more problems with our IDE >> (a freeware equivalent of the Borland editor BP) under Windows. >> These crashes allways appeared in the VMOUSE VXD and completely crashed the >> computer! > >I have a TV application + Win95 system that have this problem (ramdonly). But is on >exit. But is the mouse already disabled ? Any other code using the alias could have the same bug... doesn't exceptn.S also use djgpp_ds_alias for the keyboard real mode stuff (the one that catches Crtl-C) ?? I first sent this message to Eli, but he told me to send it to the list and to Charles Sandmann But I forgot this, I did it right now! >> These errors were even more frequent on Win98 and Win 2000 !! >> After quite long and hard debugging, I finally realized that >> there is a major bug in the startup code: >> >> when the function 0x503 of DPMI is called, >> only the cs and ds selector are updated in the 16 byte sbrk16.asm code. >> The djgpp_ds_alias selector (that is used for the RMCB >> to avoid problems with fake exceptions like Crtl-C) is updated >> later in the 32 bit code... but its updated after the >> interrupts are reenabled !!! > >Ugh! > >> If the mouse callback is called in the interval between the 0x503 >> function call and the update >> of the alias selector base address => you get the crash!! >> >> I include here a diff to version 2.03 of crt0.S file that also fixes the >> problem for the C library! >> Could someone please test this with RHIDE >> because the recent problem about linking could be due to that fact >> if (and I don't know if this is true) the linker is called internally ! > >You mean it could be because the RHIDE's RMCB is called during ld startup? Its a possibility but I have never really understood how other DJGPP exes are run from a DJGPP exe !