www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/17/09:43:22

Message-ID: <35AF5413.7F6EAD1F@CGSTE.MQ>
Date: Fri, 17 Jul 1998 09:39:31 -0400
From: HANRIGOU <HANRIGOU AT cgste DOT mq>
MIME-Version: 1.0
To: "djgpp AT delorie DOT com" <djgpp AT delorie DOT com>
Subject: libc bin/src distrib inconsistency?

Hi,

When I run a program (resit, a demo program from libsocket
distribution), my program crashes due to a SIGILL in the select 
function.
Here is  a traceback:

Exiting due to signal SIGILL
Invalid Opcode at eip=00010003
eax=00000000 ebx=00000009 ecx=00000000 edx=00000000 esi=00000000
edi=0000002c
ebp=00074428 esp=00074354
program=D:\ph\bin\bin\djgpp\contrib\lsck072\demo\resit

cs: sel=0147  base=83149000  limit=0009ffff
ds: sel=014f  base=83149000  limit=0009ffff
es: sel=014f  base=83149000  limit=0009ffff
fs: sel=0177  base=831e9000  limit=00001000
gs: sel=015f  base=00000000  limit=ffffffff
ss: sel=014f  base=83149000  limit=0009ffff

Call frame traceback EIPs:
  0x00010003   _select+1287
  0x000080fe   _res_send+1790, line 593 of r_send.c
  0x00004edb   _res_query+191, line 141 of r_qry.c
  0x00005352   _res_querydomain+246, line 375 of r_qry.c
  0x000050b8   _res_search+236, line 232 of r_qry.c
  0x00003422   _gethostbyname+342, line 978 of ghstnmad.c
  0x00001602   _main+66, line 33 of resit.c
  0x0000e0b6   ___crt1_startup+138
hanrigou#d:/ph/bin/bin/djgpp/contrib/lsck072/demo>symify resit.exe

I've decided to investigate this, and I've downloaded libc sources from
 simtel (djlsr201.zip). Next I've compiled (with debug information)
select.c from that distribution, and linked resulting select.o with my 
program.

But the "problem" is that, this way, my program works perfectly all
the time. It never gets a SIGILL. I thought it was due to compilation
options, but I've compiled select.c with exactly the same options as
those specified in libc sources makefiles, just removing the warning
ones (-Wall, -Wbad-function-cast, -Wcast-qual, -Werror,
-Wmissing-declarations, -Wmissing-prototypes, -Wpointer-arith, -Wshadow
-Wstrict-prototypes, -Wtraditional, -Wwrite-strings).
More precisely, I've compiled select.c with -MD -O3 and
-nostdinc options. But, even this way, my program never crashes.

I can't understand this behaviour. Am I missing something? Is there
an inconsistency between libc select code in the binary distribution and
the source one? I would really appreciate some advice about it...

Thanks in advance,
Regards,
Philippe.

Spelling corrections are appreciated.
_______________________________________________________________________
  
     Philippe HANRIGOU           Conseil Général de la Martinique
  Ingénieur informatique              D.D.S.T. - service I.T.S.
                                Immeuble Concorde, route de la Folie
   Tél: (0596) 59-84-63                  97200 Fort de France
  E-mail: HANRIGOU AT cgste DOT mq                      FRANCE
_______________________________________________________________________

- Raw text -


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