This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: porting to libstdc++-v3 (<iostream.h> etc.)
- To: Felix Natter <fnatter at gmx dot net>
- Subject: Re: porting to libstdc++-v3 (<iostream.h> etc.)
- From: <llewelly at dbritsch dot dsl dot xmission dot com>
- Date: Mon, 17 Apr 2000 15:31:21 -0600 (MDT)
- Cc: libstdc++ at sourceware dot cygnus dot com, libsigc at ece dot ucdavis dot edu
On 17 Apr 2000, Felix Natter wrote:
> Benjamin Kosnik <bkoz@cygnus.com> writes:
> > > I am already working on converting ncurses++ (5.0) and Gtk-- (1.0.3).
> > > Maybe someone on this list could look into the unstable Gtk-- ?
> > > (I would have done it, but have not been able to find "libsigc++"..)
>
> Could someone explain what is going to be done about the *.h-headers .. ?
>
> > I've talked to Havoc a bit about some of the issues.
>
> You would be more helpful if you could be a bit more "explicit":
> which issues ?
> Are you talking about the segmentation-faults in the libsigc++-testsuite ?
Okay, I just built libsigc++-1.0.0 against an april 15 cvs checkout of
libstdc++-v3 .
libsigc++-1.0.0/tests/signals/disconnect.cc has:
using namespace std;
//...
int count=0;
So I had to wrap the global count in a namespace.
(This info is for Karl. I assume Felix has already dealt with this issue.)
>
> sorry if this is redundant! here are backtraces from the libsigc++/test-
> programs. It compiles with only a little namespace-fix, but then almost every
> program exits with a segm.-fault and one program "hangs" (test_array)
>
> this does not seem to happen with Gtk---1.0.3 - I have successfully run
> testgtk-- (most of the other example programs have compilation-problems
> with pointers of non-static methods ??).
Gtk-- 1.0.3 does not use libsigc++ .
>
> all these were compiled with -fhonor-std only:
> --------------------------------------------------------------------------
> Starting program: /home/felix/src/dev/libsigc++-1.0.0/tests/signals/.libs/basic
> >> Sizes
> sizeof (Signal1<int,int>) = 4
> >> Connect to signals
> >> Emit signals
> sig2::f(1);
> A::f(1);
> f(1);
> sig2::fv(2);
> A::fv(2);
> fv(2);
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x4018e3cf in chunk_free (ar_ptr=0x401e81a0, p=0x804e838) at malloc.c:2959
> malloc.c:2959: No such file or directory.
> Current language: auto; currently c
> (gdb) bt
> #0 0x4018e3cf in chunk_free (ar_ptr=0x401e81a0, p=0x804e838) at malloc.c:2959
> #1 0x4018e241 in __libc_free (mem=0x804e840) at malloc.c:2872
> #2 0x400e5377 in __builtin_vec_delete (ptr=0x804e840)
> at ../../gcc-2.95.2/gcc/cp/new2.cc:62
> #3 0x400be734 in std::basic_filebuf<char, std::char_traits<char> >::close (
> this=0x804e788) at ../../../../gcc-2.95.2/libstdc++/bits/fstream.tcc:149
> #4 0x400be7ae in std::basic_filebuf<char, std::char_traits<char> >::~1Zc (
> this=0x804e788, __in_chrg=3)
> at ../../../../gcc-2.95.2/libstdc++/bits/std_fstream.h:87
> #5 0x400a24cd in std::ios_base::Init::~Init (this=0x401312f8, __in_chrg=2)
> at ../../../../gcc-2.95.2/libstdc++/src/ios.cc:118
> #6 0x400a33f3 in __static_initialization_and_destruction_0 (__initialize_p=0,
> __priority=65535)
> at ../../../../gcc-2.95.2/libstdc++/bits/std_iostream.h:55
> #7 0x400a3455 in global destructors keyed to std::ios_base::boolalpha ()
> at ../../../../gcc-2.95.2/libstdc++/src/ios.cc:278
> #8 0x4009f0c4 in __do_global_dtors_aux ()
> #9 0x400fe645 in _fini ()
> #10 0x4000695a in _dl_fini () at dl-fini.c:32
> #11 0x4016b105 in exit (status=0) at exit.c:55
> ------------------------------------------------------------------------------
> Starting program: /home/felix/src/dev/libsigc++-1.0.0/tests/signals/.libs/array_test
> >>
>
> Program received signal SIGINT, Interrupt.
> 0x401bced4 in __read () at soinit.c:27
> soinit.c:27: No such file or directory.
> Current language: auto; currently c
> (gdb) bt
> #0 0x401bced4 in __read () at soinit.c:27
> #1 0x400399f8 in __DTOR_END__ ()
> #2 0x4018b534 in _IO_file_read (fp=0x8051dd0, buf=0x4001e000, size=4096)
> at fileops.c:563
> #3 0x4009f84f in std::__basic_file::sys_read (this=0x8051dd0,
> __s=0x4001e000 "\n", __n=4096) at c++io.cc:233
> #4 0x4018b095 in _IO_file_underflow (fp=0x8051dd0) at fileops.c:303
> #5 0x4009f5ef in std::__basic_file::underflow (this=0x8051dd0) at c++io.cc:188
> #6 0x4018bbf8 in __underflow (fp=0x8051dd0) at genops.c:249
> #7 0x4018bf6f in _IO_default_xsgetn (fp=0x8051dd0, data=0xbffff450, n=1)
> at genops.c:396
> #8 0x4009f6e3 in std::__basic_file::xsgetn (this=0x8051dd0,
> __s=0xbffff450 "Ð\035\005\b\001", __n=1) at c++io.cc:205
> #9 0x400beebc in std::basic_filebuf<char, std::char_traits<char> >::underflow
> (this=0x8051d70) at ../../../../gcc-2.95.2/libstdc++/bits/fstream.tcc:210
> #10 0x400ba9af in std::basic_streambuf<char, std::char_traits<char> >::uflow (
> this=0x8051d70)
> at ../../../../gcc-2.95.2/libstdc++/bits/std_streambuf.h:390
> #11 0x400baaae in std::basic_streambuf<char, std::char_traits<char> >::sbumpc (
> this=0x8051d70) at ../../../../gcc-2.95.2/libstdc++/bits/streambuf.tcc:54
> #12 0x400c28ce in std::basic_istream<char, std::char_traits<char> >::sentry::sentry (this=0xbffff5c3, __in=@0x804f4c0, __noskipws=false)
> at ../../../../gcc-2.95.2/libstdc++/bits/istream.tcc:55
> ---Type <return> to continue, or q <return> to quit---
> #13 0x400d1e75 in std::basic_istream<char, std::char_traits<char> > & std::operator>><char, std::char_traits<char>, std::allocator<char> > (__in=@0x804f4c0,
> __str=@0xbffff5ec)
> at ../../../../gcc-2.95.2/libstdc++/bits/istream.tcc:1112
> #14 0x804af66 in main (argc=1, argv=0xbffff614) at array_test.cc:56
> -------------------------------------------------------------------------------
> Starting program: /home/felix/src/dev/libsigc++-1.0.0/tests/signals/.libs/disconnect
> >> Emit signal
> f2(1);
> f(1);
> >> Emit signal again
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x4018e3cf in chunk_free (ar_ptr=0x401e81a0, p=0x804ce50) at malloc.c:2959
> malloc.c:2959: No such file or directory.
> Current language: auto; currently c
> (gdb) bt
> #0 0x4018e3cf in chunk_free (ar_ptr=0x401e81a0, p=0x804ce50) at malloc.c:2959
> #1 0x4018e241 in __libc_free (mem=0x804ce58) at malloc.c:2872
> #2 0x400e5377 in __builtin_vec_delete (ptr=0x804ce58)
> at ../../gcc-2.95.2/gcc/cp/new2.cc:62
> #3 0x400be734 in std::basic_filebuf<char, std::char_traits<char> >::close (
> this=0x804cda0) at ../../../../gcc-2.95.2/libstdc++/bits/fstream.tcc:149
> #4 0x400be7ae in std::basic_filebuf<char, std::char_traits<char> >::~1Zc (
> this=0x804cda0, __in_chrg=3)
> at ../../../../gcc-2.95.2/libstdc++/bits/std_fstream.h:87
> #5 0x400a24cd in std::ios_base::Init::~Init (this=0x401312f8, __in_chrg=2)
> at ../../../../gcc-2.95.2/libstdc++/src/ios.cc:118
> #6 0x400a33f3 in __static_initialization_and_destruction_0 (__initialize_p=0,
> __priority=65535)
> at ../../../../gcc-2.95.2/libstdc++/bits/std_iostream.h:55
> #7 0x400a3455 in global destructors keyed to std::ios_base::boolalpha ()
> at ../../../../gcc-2.95.2/libstdc++/src/ios.cc:278
> #8 0x4009f0c4 in __do_global_dtors_aux ()
> #9 0x400fe645 in _fini ()
> #10 0x4000695a in _dl_fini () at dl-fini.c:32
> #11 0x4016b105 in exit (status=0) at exit.c:55
> -----------------------------------------------------------------------------
>
I am not seeing these segfaults; the tests run correctly for me.
I have:
i686-pc-linux-gnu
kernel 2.2.14
glibc 2.1.2
gcc 2.95.2 (configured with --enable-shared and --enable-threads)
libstdc++-v3, april 15 cvs checkout. (configured with --enable-long_long
--enable-threads=posix --with-gnu-ld)
libsigc++-1.0.0 (configured with --enable-shared --with-gnu-ld)
What version of libstdc++-v3 are you using?