From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5089 invoked by alias); 9 Feb 2010 05:48:51 -0000 Received: (qmail 5053 invoked by uid 48); 9 Feb 2010 05:48:38 -0000 Date: Tue, 09 Feb 2010 05:48:00 -0000 Subject: [Bug libstdc++/43005] New: Segmentation fault(not always) while running binary which has gcc and g++ compiled shared object files X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "sarveshwarac at india dot tejasnetworks dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00779.txt.bz2 compiler version: gcc 4.0.0, g++ 4.0.0 Reading specs from /usr/bin/../lib/gcc/powerpc-linux/4.0.0/specs Target: powerpc-linux Configured with: /opt/eldk/build/ppc-2007-01-19/work/usr/src/denx/BUILD/crosstool-0.35/build/gcc-4.0.0-glibc-2.3.5-eldk/powerpc-linux/gcc-4.0.0/configure --target=powerpc-linux --host=i686-host_pc-linux-gnu --prefix=/var/tmp/eldk.HzYZNd/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/powerpc-linux --with-headers=/var/tmp/eldk.HzYZNd/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/powerpc-linux/powerpc-linux/include --with-local-prefix=/var/tmp/eldk.HzYZNd/usr/crosstool/gcc-4.0.0-glibc-2.3.5-eldk/powerpc-linux/powerpc-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long --enable-__cxa_atexit Linux version used on target is 2.6.26. I have two shared object files gcc compiled fpp.so and g++ compiled fcc.so. fcc.so is only one file with following code: fccMain.cpp: ----------- #include int main() { cout << "Starting fcc.d" <::ctype () from /usr/lib/libstdc++.so.6 #2 0x0df1006c in std::locale::_Impl::_Impl () from /usr/lib/libstdc++.so.6 #3 0x0df1097c in std::locale::_Impl::_Impl () from /usr/lib/libstdc++.so.6 #4 0x0df0a70c in std::ctype::ctype () from /usr/lib/libstdc++.so.6 #5 0x0e106370 in _IO_2_1_stdin_ () from /lib/libc.so.6 #6 0x0df0a70c in std::ctype::ctype () from /usr/lib/libstdc++.so.6 #7 0x0df10c5c in std::locale::locale () from /usr/lib/libstdc++.so.6 #8 0x0df0e104 in std::ios_base::Init::Init () from /usr/lib/libstdc++.so.6 #9 0x0ffabaa8 in __static_initialization_and_destruction_0 () from /etc/libfcc.so #10 0x0ffabaf8 in global constructors keyed to main () from /etc/libfcc.so #11 0x0ffabd34 in __do_global_ctors_aux () from /etc/libfcc.so #12 0x0df0a70c in std::ctype::ctype () from /usr/lib/libstdc++.so.6 #13 0xbfa15ddc in ?? () #14 0x0df0a70c in std::ctype::ctype () from /usr/lib/libstdc++.so.6 #15 0x4800beb4 in _dl_rtld_di_serinfo () from /lib/ld.so.1 #16 0x48010740 in realloc () from /lib/ld.so.1 Previous frame inner to this frame (corrupt stack?) If i remove the #include line(fccMain.cpp) and replace it with either and or with (printf in place of cout) it is always working without any issue. Global data initialization from libfpp.so is looks happening properly. But libfcc.so global data initialization is failing some times in iostream, while initializing static ios_base::Init __ioinit. I already tried by enabling -fpic, but still the problem is seen. Is it a bug in gcc/g++(4.0.0) ? -Sarveshwara Chary. -- Summary: Segmentation fault(not always) while running binary which has gcc and g++ compiled shared object files Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sarveshwarac at india dot tejasnetworks dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43005