delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/07/16/18:21:13

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin AT cygwin DOT com
From: Sam Steingold <sds AT gnu DOT org>
Subject: Re: crash on the first statement in main()
Date: 16 Jul 2003 18:18:47 -0400
Organization: disorganization
Lines: 64
Message-ID: <uel0q15fc.fsf@gnu.org>
References: <ubrwtwvmi DOT fsf AT gnu DOT org> <uk7as63nh DOT fsf AT gnu DOT org>
Reply-To: sds AT gnu DOT org
Mime-Version: 1.0
X-Complaints-To: usenet AT main DOT gmane DOT org
X-Attribution: Sam
X-Disclaimer: You should not expect anyone to agree with me.
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> * In message <uk7as63nh DOT fsf AT gnu DOT org>
> * On the subject of "Re: crash on the first statement in main()"
> * Sent on 08 Jul 2003 18:43:14 -0400
> * I write:
> > * I write:
> >
> > I get a segfault on the first executable line in main() (confirmed in
> > the debugger), both when produced by cygwin:
> > 
> > gcc modules.o regexp.o regexi.o regex.o lisp.a
> >  -lintl libcharset.a libavcall.a libcallback.a -lreadline -lncurses
> >  -liconv -lm -o lisp.exe
> > ...
> > full/lisp.exe -B . -M base/lispinit.mem -norc -q -i regexp/regexp
> >  -x (saveinitmem "full/lispinit.mem") 
> > Signal 11
> > make: *** [full] Error 1
> > 
> > and mingw:
> > 
> > gcc -mno-cygwin modules.o regexp.o
> >  regexi.o regex.o lisp.a libcharset.a libavcall.a libcallback.a -luser32
> >  -lws2_32 -lole32 -luuid -o lisp.exe 
> > full/lisp.exe -B . -M base/lispinit.mem -norc -q -i regexp/regexp
> >  -x (saveinitmem "full/lispinit.mem")
> > <win32 crash dialog box>
> > 
> > the lines don't do anything special, in fact, "p <the offending line>"
> > executes just fine in gdb right after the crash.
> 
> I forgot a crucial piece of information:
> 
> the segfault happens only with "-g"!
> when I compile with "-O2", it works like a charm.

Another crucial piece of information, just discovered:

lisp.a is built like this:

ld -r -o lisp.o <a couple of dozens object files>
chmod a-x lisp.o
ar rcv lisp.a lisp.o
ranlib lisp.a

if I replace "lisp.a" with "lisp.o" in the GCC call that creates
lisp.exe, I get the same crash.
if I replace "lisp.a" with the full list of <a couple of dozens
object files>, everything works out just fine.

if I remove "lisp.o" altogether and create "lisp.a" with

ar rcv lisp.a <a couple of dozens object files>

everything works out just fine.

So, for now, I have a workaround.
However, this appears to be a bug in binutils.
Comments?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
My other CAR is a CDR.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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