| www.delorie.com/archives/browse.cgi | search | 
| X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f | 
| Date: | Wed, 06 Feb 2002 18:55:14 +0200 | 
| From: | "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il> | 
| Sender: | halo1 AT zahav DOT net DOT il | 
| To: | Paul Muehlbach <traexx AT gmx DOT de> | 
| Message-Id: | <2927-Wed06Feb2002185514+0200-eliz@is.elta.co.il> | 
| X-Mailer: | emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9 | 
| CC: | djgpp AT delorie DOT com | 
| In-reply-to: | <29223.1013001521@www3.gmx.net> (message from Paul Muehlbach on | 
| Wed, 6 Feb 2002 14:18:41 +0100 (MET)) | |
| Subject: | Re: multithreading | 
| References: | <29223 DOT 1013001521 AT www3 DOT gmx DOT net> | 
| Reply-To: | djgpp AT delorie DOT com | 
| Errors-To: | nobody AT delorie DOT com | 
| X-Mailing-List: | djgpp AT delorie DOT com | 
| X-Unsubscribes-To: | listserv AT delorie DOT com | 
> Date: Wed, 6 Feb 2002 14:18:41 +0100 (MET)
> From: Paul Muehlbach <traexx AT gmx DOT de>
> 
> LWP: Example1.
> This program spawns 4 threads that each print a message.
> Press any key to start....MAIN
> Exiting due to signal SIGSEGV
> General Protection Fault at eip=00003fc5
> eax=00000000 ebx=00000021 ecx=00000000 edx=0000fe20 esi=00000006 edi=00093b54
> ebp=00093b30 esp=00093b1c program=C:\THREAD\CONTRIB\LWP\EXAMPLE1.EXE
> cs: sel=00a7  base=82954000  limit=000affff
> ds: sel=00af  base=82954000  limit=000affff
> es: sel=00b7  base=82954000  limit=000affff
> fs: sel=0087  base=0000fe20  limit=0000ffff
> gs: sel=00bf  base=00000000  limit=0010ffff
> ss: sel=00af  base=82954000  limit=000affff
> App stack: [00095070..00015070]  Exceptn stack: [00014fd0..00013090]
> 
> Call frame traceback EIPs:
>   0x00003fc5 __lwpasmEnd+149
>   0x00008def __write+159
>   0x0000f44a __flsbuf+298
>   0x0000e2b2 _putc+178
>   0x0000ac7b __doprnt+147
>   0x00005e16 _printf+22
>   0x00001fd2 _main+322, line 54 of example1.c
>   0x00005a12 ___crt1_startup+178
Please show some code around 0x3fc5.  One way of doing that is to
load example1.exe into GDB, then type this command:
     list *0x3fc5
if this doesn't work, try this:
     disassemble 0x3fc5
Btw, I'm not sure it's a good idea to use printf from multithreaded
program: the DJGPP library is not reentrant, in general.  (Yes, I know
that this was an example program, but it might have bugs as well...)
Does the program crash if you remove printf from all but one thread?
| webmaster | delorie software privacy | 
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |