From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22024 invoked by alias); 19 Apr 2002 22:06:08 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21946 invoked by uid 71); 19 Apr 2002 22:06:05 -0000 Resent-Date: 19 Apr 2002 22:06:05 -0000 Resent-Message-ID: <20020419220605.21945.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, rsteinke@w-link.net Received:(qmail 15004 invoked from network); 19 Apr 2002 22:00:56 -0000 Received: from unknown (HELO ouroboros) (205.162.12.90) by sources.redhat.com with SMTP; 19 Apr 2002 22:00:56 -0000 Received: from rsteinke by ouroboros with local (Exim 3.35 #1 (Debian)) id 16ygR4-0001bF-00; Fri, 19 Apr 2002 15:00:54 -0700 Message-Id: Date: Fri, 19 Apr 2002 15:06:00 -0000 From: rsteinke@w-link.net To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org X-Send-Pr-Version:3.113 Subject: c++/6380: Internal compiler error involving fstream and xsub (perl c++ wrapper code) X-SW-Source: 2002-04/txt/msg01006.txt.bz2 List-Id: >Number: 6380 >Category: c++ >Synopsis: Internal compiler error involving fstream and xsub (perl c++ wrapper code) >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Fri Apr 19 15:06:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Ron Steinke >Release: 3.0.4 (Debian testing/unstable) >Organization: >Environment: System: Linux ouroboros 2.4.17 #10 Fri Mar 8 01:21:59 PST 2002 i686 unknown Architecture: i686, Debian woody, using perl 5.6.1 host: i386-pc-linux-gnu build: i386-pc-linux-gnu target: i386-pc-linux-gnu configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux >Description: Internal compiler error, happens in both g++-2.95.4 and g++-3.0.4. I was attempting to produce a test case for some lockups that were happening when I wrapped a c++ library which used iostreams in an xsub so it could be called from perl. The test case produced an internal error. >How-To-Repeat: I am including both the file Conflict.xs with the original code, and the generated Conflict.c file (really a c++ file) with the c++ code. The compilation command which originally produced the error was: g++ -c -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -DVERSION=\"0.01\" -DXS_VERSION=\"0.01\" -fPIC -I/usr/lib/perl/5.6.1/CORE Conflict.c I tried again with all the flags except for -I/usr/lib/perl/5.6.1/CORE removed, and the behavior was the same. --- begin Conflict.xs --- #include #include #include extern "C" { #include "EXTERN.h" #include "perl.h" #include "XSUB.h" } class Log { public: Log() { std::ostringstream ost; ost << "tmp/file" << filenum++; _log.open(ost.str().c_str(), std::ios::out | std::ios::app); _log << "testing\n"; } ~Log() {_log.close();} private: std::fstream _log; static int filenum; } Log::filenum = 0; MODULE = Conflict PACKAGE = Conflict Log* Log::new() void Log::DESTROY() --- end Conflict.xs, begin Conflict.c --- /* * This file was generated automatically by xsubpp version 1.9508 from the * contents of Conflict.xs. Do not edit this file, edit Conflict.xs instead. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "Conflict.xs" #include #include #include extern "C" { #include "EXTERN.h" #include "perl.h" #include "XSUB.h" } class Log { public: Log() { std::ostringstream ost; ost << "tmp/file" << filenum++; _log.open(ost.str().c_str(), std::ios::out | std::ios::app); _log << "testing\n"; } ~Log() {_log.close();} private: std::fstream _log; static int filenum; } Log::filenum = 0; #line 42 "Conflict.c" XS(XS_Conflict_new) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Conflict::new(CLASS)"); { char * CLASS = (char *)SvPV(ST(0),PL_na); Log * RETVAL; RETVAL = new Log(); ST(0) = sv_newmortal(); sv_setref_pv( ST(0), CLASS, (void*)RETVAL ); } XSRETURN(1); } XS(XS_Conflict_DESTROY) { dXSARGS; if (items != 1) Perl_croak(aTHX_ "Usage: Conflict::DESTROY(THIS)"); { Log * THIS; if( sv_isobject(ST(0)) && (SvTYPE(SvRV(ST(0))) == SVt_PVMG) ) THIS = (Log *)SvIV((SV*)SvRV( ST(0) )); else{ warn( "Conflict::DESTROY() -- THIS is not a blessed SV reference" ); XSRETURN_UNDEF; }; delete THIS; } XSRETURN_EMPTY; } #ifdef __cplusplus extern "C" #endif XS(boot_Conflict) { dXSARGS; char* file = __FILE__; XS_VERSION_BOOTCHECK ; newXS("Conflict::new", XS_Conflict_new, file); newXS("Conflict::DESTROY", XS_Conflict_DESTROY, file); XSRETURN_YES; } --- end Conflict.c --- >Fix: None known >Release-Note: >Audit-Trail: >Unformatted: