This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: namespace trouble on solaris (8)


Alexandre Oliva wrote:

> On Oct 17, 2000, Martin Malm <martin.malm@fast.no> wrote:
>
> > Alexandre Oliva wrote:
>
> >> Try linking with -lstdc++, or using g++, that implicitly links it in.
>
> > I forgot to include the compilation options 8) I have tried both
>
> Then you need -fnew-abi and/or -fhonor-std, which is how libstdc++-v3
> is build.

Using only the -fhonor-std it now compiles 8)

But the program core dumps :(


If I try using the -fnew-abi option with or without -fhonor-std, I get
this:

ovemm@pacifico:~/sun/tmp>g++ -fhonor-std  -fnew-abi file.cpp -o file
Undefined                       first referenced
 symbol                             in file
std::basic_ostream<char, std::char_traits<char>
>::operator<<(std::basic_ostream<char, std::char_traits<char> >
&(*)(std::basic_ostream<char, std::char_traits<char> >
&))/var/tmp/ccTtrWh2.o
std & std::operator<<<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> > &, char const *)/var/tmp/ccTtrWh2.o
ld: fatal: Symbol referencing errors. No output written to file
collect2: ld returned 1 exit status

I don't know if the "--enable-new-gxx-abi" configure option is needed for
this? I did not
use that  option when configuring my build.


In gdb the core look like this:

#0  std::basic_ostream<char, std::char_traits<char> >::sentry::sentry (
    this=0xffbefbc0, __os=@0x293d0)
    at ../../../../gcc-2.95.2/libstdc++/bits/basic_ios.h:98
---Type <return> to continue, or q <return> to quit---
98            { return _M_streambuf_state; }
(gdb)


However we have purify installed on this system and using it I get this
output:

      Purify instrumented file (pid 9348 at Tue Oct 17 17:15:18 2000)
      UMR: Uninitialized memory read
      This is occurring while in:

_M_fill_insert__Q23stdt6vector2ZPQ33std6locale5facetZQ23stdt9allocator1ZPQ33std6locale5facetGQ23stdt17__normal_iterator2ZPPQ33std6locale5facetZQ23stdt6vector2ZPQ33std6locale5facetZQ23stdt9allocator1ZPQ33std6locale5facetUiRCPQ33std6locale5facet
[stl_vector.h:730]
                       __new_finish = uninitialized_copy(begin(),
__position, __new_start);
                       __new_finish = uninitialized_fill_n(__new_finish,
__n, __x);
                       __new_finish
            =>           = uninitialized_copy(__position, end(),
__new_finish);
                     }
                     __STL_UNWIND((destroy(__new_start,__new_finish),

_M_deallocate(__new_start.base(),__len)));
            std::locale::_Impl::_M_install_facet(const
std::locale::id*,std::locale::facet*) [stl_vector.h:403]
               #endif /* __STL_MEMBER_TEMPLATES */

                 void insert (iterator __pos, size_type __n, const _Tp&
__x)
            =>     { _M_fill_insert(__pos, __n, __x); }

                 void _M_fill_insert (iterator __pos, size_type __n, const
_Tp& __x);

            std::locale::classic() [localefwd.h:374]
                   template<typename _Facet>
                     inline void
                     _M_init_facet(_Facet* __facet)
            =>       { _M_install_facet(&_Facet::id, __facet);  }

                   void
                   _M_construct_collate(const char*);

std::basic_filebuf<char,std::char_traits<char>>::std::basic_filebuf<char,std::char_traits<char>>(int,const
char*,std::_Ios_Openmode) [localefwd.h:302]

                   static inline void
                   _S_initialize()
            =>     { if (!_S_classic) classic();  }

                   static int
                   _S_normalize_category(int);
            std::ios_base::Init::std::ios_base::Init() [ios.cc:88]
                 {
                   if (++_M_ios_base_init == 1)
                     {
            =>         _M_cout = new filebuf(1, "stdout", ios_base::out);
                       _M_cin = new filebuf(0, "stdin", ios_base::in);
                       _M_cerr = new filebuf(2, "stderr", ios_base::out);
                       cout.rdbuf(_M_cout);
            *unknown func* [pc=0x58a78]
      Reading 4 bytes from 0xffbef878 on the stack.
      Address 0xffbef878 is      236 bytes past start of local variable
"__x_copy" in function
_M_fill_insert__Q23stdt6vector2ZPQ33std6locale5facetZQ23stdt9allocator1ZPQ33std6locale5facetGQ23stdt17__normal_iterator2ZPPQ33std6locale5facetZQ23stdt6vector2ZPQ33std6locale5facetZQ23stdt9allocator1ZPQ33std6locale5facetUiRCPQ33std6locale5facet.



Best regards

Martin

--
Martin Malm                  MAIL: ovemm@fast.no    / AIM: ovemm
Fast Search & Transfer ASA   Phone: +47 73 20 12 24 / +47 92 08 22 73




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]