🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.gnu
Article #104

Problem mit RTTI und gcc/libg++ 2.7.0

#104
From: Bjoern Dosch
Date: Sun, 15 Oct 1995 15:58
53 lines
1926 bytes
Hallo!

Ich habe hier ein Problem mit RTTI unter dem gcc 2.7.0/libg++
2.7.0. Folgendes Programm stürzt kläglich ab, wenn es mit
-handle-exceptions und -frtti kompiliert wurde:

01: #include <std/typeinfo.h>
02:
03: #include <iostream.h>
04: #include <fstream.h>
05:
06: int main ()
07: {
08:   ifstream stream ("/etc/passwd");
09:
10:   if (! stream.ios::good ())
11:     {
12:       cerr << "Error\n";
13:       exit (1);
14:     }
15:   char str[128] = "";
16:   stream.getline (str, 128);  
17: }

Program received signal SIGSEGV (11), Segmentation fault
0x1f34c in istream::getline (this=0xeffff93c, buf=0xeffff868 "", len=128, 
    delim=10 '\n') at isgetline.cc:38

Ein Stack-Backtrace ergibt

(gdb) bt
#0  0x1f34c in istream::getline (this=0xeffff93c, buf=0xeffff868 "", len=128, 
    delim=10 '\n') at isgetline.cc:38
#1  0x183b4 in main () at test.cc:16

isgetline.cc:38 sieht so aus:
  if (ipfx1())

ipfx1() ist eine "normale" inline-Funktion (in der Klassendefinition
von istream ->libg++-2.7.0/libio/iostream.h).

Ohne -handle-exceptions und -frtti gibt es keine Probleme. 

Ist so ein Verhalten jemandem bekannt? Liegt das an dem alpha
RTTI-Code?  (Ich würde ihn ja nicht benutzen, aber ohne RTTI
funktioniert auch das Exception-Handling nicht vernünftig...)

Ciao

--
Björn Dosch
	Usenet:  bjd@charon.tauber.netz.sub.de
            -- PGP Public Key Available --
Technical Details
Message-ID: <45rb40$61l@neuromancer.charon.incubus.sub.org>
Path: arc1-ca.pugleaf.net!charon.incubus.sub.org!not-for-mail

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!charon.incubus.sub.org!not-for-mail
From: bjd@charon.incubus.sub.org (Bjoern Dosch)
Newsgroups: de.comp.gnu,de.comp.lang.c++
Subject: Problem mit RTTI und gcc/libg++ 2.7.0
Date: 15 Oct 1995 16:58:56 +0100
Organization: Charon Inc.
Message-ID: <45rb40$61l@neuromancer.charon.incubus.sub.org>
NNTP-Posting-Host: neuromancer.charon.incubus.sub.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Newsreader: TIN [version 1.2 PL2]