www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/11/09/07:46:28

From: Martin Str|mberg <ams AT speedy DOT ludd DOT luth DOT se>
Subject: Re: i686-pc-msdosdjgpp-g++ problems (long)
Newsgroups: comp.os.msdos.djgpp
References: <lrplsuounbjm9n878rvu4e4sobqofcu437 AT 4ax DOT com> <aqfvt3$6t$1 AT antares DOT lu DOT erisoft DOT se> <taunsusrk60vfe987b0a0ncp0u2cqkh7of AT 4ax DOT com> <1036779663 DOT 158618 AT queeg DOT ludd DOT luth DOT se> <1h6osuka51oan46817ptm2o1loq3k6fqm7 AT 4ax DOT com> <200211082039 DOT gA8Kdck00835 AT envy DOT delorie DOT com> <c5aosuktk341qeu7fj7gj8954a32ktpk1a AT 4ax DOT com>
User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (NetBSD/1.5_BETA (alpha))
Message-ID: <1036845028.195290@queeg.ludd.luth.se>
Cache-Post-Path: queeg.ludd.luth.se!unknown AT speedy DOT ludd DOT luth DOT se
X-Cache: nntpcache 2.4.0b5 (see http://www.nntpcache.org/)
Date: 09 Nov 2002 12:30:28 GMT
Lines: 83
NNTP-Posting-Host: queeg.ludd.luth.se
X-Trace: 1036845028 news.luth.se 7333 130.240.16.109
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Charles Wilkins <chas AT pcscs DOT com> wrote:
: welcome2.out
: ============================================================

: 0x00040175 __djgpp_memory_handle_size+553, file libgcc2.c
:   0x000402d2 __djgpp_memory_handle_size+902, file libgcc2.c
:   0x000314e1 std::basic_fstream<char, std::char_traits<char>
:>::basic_fstream(char const*, std::_Ios_Openmode)+113, file
: fstream-inst.cc, line 510
:   0x00002f2e std::__throw_bad_alloc()+14, file functexcept.cc
:   0x0003f528 emergency_buffer+1384, file eh_alloc.cc
:   0x0001a11f std::ostream::sentry::sentry(std::ostream&)+15, file
: ostream-inst.cc, line 99
:   0x0001a36e std::basic_ostream<char, std::char_traits<char> >&
: std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
: std::char_traits<char> >&, char const*)+30, file ostream-inst.cc, line
: 624
:   0x0000167e main+36, file crt0.s
:   0x0000d1f8 __crt1_startup+176, file crt1.c
:   0x0001a11f std::ostream::sentry::sentry(std::ostream&)+15, file
: ostream-inst.cc, line 99
:   0x0001a36e std::basic_ostream<char, std::char_traits<char> >&
: std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
: std::char_traits<char> >&, char const*)+30, file ostream-inst.cc, line
: 624
:   0x0000167e main+36, file crt0.s
:   0x0000d1f8 __crt1_startup+176, file crt1.c
: ss: sel=01af  base=01dd0000  limit=0075ffff
: App stack: [000d6a6c..00056a6c]  Exceptn stack: [000569c0..00054a80]
:  
: Call frame traceback EIPs:
:   0x00040175 __djgpp_memory_handle_size+553, file libgcc2.c
:   0x000402d2 __djgpp_memory_handle_size+902, file libgcc2.c
:   0x000314e1 std::basic_fstream<char, std..+113, file
: fstream-..nst.cc, line 510
:   0x00002f2e std::__throw_bad_alloc()+14, file functexcept.cc
:   0x0003f528 emergency_buffer+1384, file eh_alloc.cc

What's this? Nevermind.

: C:\Archives\RIP2\DJGPP\bin>welcome
: Exiting due to signal SIGSEGV
: General Protection Fault at eip=0001a11f
: eax=00000000 ebx=0003eb58 ecx=0003eb58 edx=007cffa0 esi=00000054
: edi=00001630
: ebp=007cff68 esp=007cff64
: program=C:\ARCHIVES\RIP2\DJGPP\BIN\WELCOME.EXE
: cs: sel=01a7  base=01670000  limit=007dffff
: ds: sel=01af  base=01670000  limit=007dffff
: es: sel=01af  base=01670000  limit=007dffff
: fs: sel=017f  base=00005870  limit=0000ffff
: gs: sel=01bf  base=00000000  limit=0010ffff
: ss: sel=01af  base=01670000  limit=007dffff
: App stack: [007d0000..00750000]  Exceptn stack: [00042c88..00040d48]
:  
: Call frame traceback EIPs:
:   0x0001a11f std::ostream::sentry::sentry(..+15, file ostream-inst.cc,
: line 99
:   0x0001a36e std::basic_ostream<char, std:..+30, file
: ostream-..nst.cc, line 624
:   0x0000167e main+36, file crt0.s
:   0x0000d1f8 __crt1_startup+176, file crt1.c
:  

1. Note that the addresses are the same as in the symify case but now
they make much more sense. I. e. don't trust symify (right now at
least).

2. Ok. We get to main which calls some C++ output which crashes.

3. If you run out of ideas, make sure that your libstdcxx.a does
contain debug information and try to run this program in gdb to see
what's amiss. You'll probably need to copy libstdcxx.a's source files
to where your program run or add the corresponding .o or .c or .cpp
files to the link line. I don't do C++, but if it was libc's printf()
that was the problem I'd just link add printf.c to the compile line
before any libraries. Then that file might be calling other ones which
I'd need to add after the first etc.


Right,

						MartinS

- Raw text -


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