iostream??

iostream??

Post by Al » Thu, 03 Jul 2003 03:17:54



Hi,

im using stl in a small testApp which linked against 2 libraries.

compiler: Compaq C++ V6.2-024 for Compaq Tru64 UNIX V5.1A (Rev. 1885)

flags: -g -gall -msg_quiet -using_std -D_ANSI_C_SOURCE....

ThHe problem is:
Whenever i use iostream in a cpp file in one of the librearies
i got this:

Thread received signal SEGV
stopped at [<opaque> __pthread_mutex_lock(...) 0x3ff805686b0]

Information:  An <opaque> type was presented during execution of the
previous command.  For complete type information on this symbol,
recompilation of the program will be necessary.  Consult the compiler
man pages for details on producing full symbol table information using
the '-g' (and '-gall' for cxx) flags.

(ladebug) up

Quote:>1  0x3ff8013ac30 in __tis_mutex_lock(...) in /shlib/libc.so (ladebug) up
>2  0x3ff8013b530 in __cma_tis_mutex_lock(...) in /shlib/libc.so
>3  0x3ff802e150c in __cxx_mutex_lock(...) in /shlib/libcxx.so
>4  0x12003e624 in UnknownProcedure34FromFile273(...) in TestApp (ladebug) up
>5  0x12003d930 in Init(...) in TestApp
>6  0x3ffbffe1858 in __init_sti__cxxl_std_init_cpp_65f45f2a(...) in myLib.so
>7  0x3ffbfffbbd8 in myLib.so
>8  0x3ff800068e0

Any Idea??????????????/

Ali

 
 
 

iostream??

Post by Nikola Milutinovi » Thu, 03 Jul 2003 14:52:48


Quote:> ThHe problem is:
> Whenever i use iostream in a cpp file in one of the librearies
> i got this:

> Thread received signal SEGV
> stopped at [<opaque> __pthread_mutex_lock(...) 0x3ff805686b0]

> Information:  An <opaque> type was presented during execution of the
> previous command.  For complete type information on this symbol,
> recompilation of the program will be necessary.  Consult the compiler
> man pages for details on producing full symbol table information using
> the '-g' (and '-gall' for cxx) flags.

> (ladebug) up
> >1  0x3ff8013ac30 in __tis_mutex_lock(...) in /shlib/libc.so (ladebug) up
> >2  0x3ff8013b530 in __cma_tis_mutex_lock(...) in /shlib/libc.so
> >3  0x3ff802e150c in __cxx_mutex_lock(...) in /shlib/libcxx.so
> >4  0x12003e624 in UnknownProcedure34FromFile273(...) in TestApp (ladebug)
up
> >5  0x12003d930 in Init(...) in TestApp
> >6  0x3ffbffe1858 in __init_sti__cxxl_std_init_cpp_65f45f2a(...) in
myLib.so
> >7  0x3ffbfffbbd8 in myLib.so
> >8  0x3ff800068e0

Are you doing multithreading? Are you linking against reeantrant libraries?
There were issues with "printf()" (I know, this "iostream") and locking
(done internally, by the "printf()") in a multi-threaded application.

Nix.

 
 
 

iostream??

Post by Al » Thu, 03 Jul 2003 22:01:17



> > ThHe problem is:
> > Whenever i use iostream in a cpp file in one of the librearies
> > i got this:

> > Thread received signal SEGV
> > stopped at [<opaque> __pthread_mutex_lock(...) 0x3ff805686b0]

> > Information:  An <opaque> type was presented during execution of the
> > previous command.  For complete type information on this symbol,
> > recompilation of the program will be necessary.  Consult the compiler
> > man pages for details on producing full symbol table information using
> > the '-g' (and '-gall' for cxx) flags.

> > (ladebug) up
> > >1  0x3ff8013ac30 in __tis_mutex_lock(...) in /shlib/libc.so (ladebug) up
> > >2  0x3ff8013b530 in __cma_tis_mutex_lock(...) in /shlib/libc.so
> > >3  0x3ff802e150c in __cxx_mutex_lock(...) in /shlib/libcxx.so
> > >4  0x12003e624 in UnknownProcedure34FromFile273(...) in TestApp (ladebug)
>  up
> > >5  0x12003d930 in Init(...) in TestApp
> > >6  0x3ffbffe1858 in __init_sti__cxxl_std_init_cpp_65f45f2a(...) in
>  myLib.so
> > >7  0x3ffbfffbbd8 in myLib.so
> > >8  0x3ff800068e0

> Are you doing multithreading? Are you linking against reeantrant libraries?
> There were issues with "printf()" (I know, this "iostream") and locking
> (done internally, by the "printf()") in a multi-threaded application.

> Nix.

Hi,
No multithreading, No reantrant.

This is an example:

library 1 consists of class A
class A
{
  ...
  static void printMsg( const string& msg ){ cout << msg ;}

Quote:}

 library 2 consists of class B
class_b.h
class B
{
  ...
  int set();

Quote:}

class_b.cpp
int B::set()
{
  A::printMsg( string("B::set()") ); //core dump
  return 0;

Quote:}

test.cpp
int main(...)
{
  A::printMsg( string("main...") );
  return 0;

- Show quoted text -

Quote:}

 
 
 

iostream??

Post by Al » Sun, 06 Jul 2003 20:06:49




> > > ThHe problem is:
> > > Whenever i use iostream in a cpp file in one of the librearies
> > > i got this:

> > > Thread received signal SEGV
> > > stopped at [<opaque> __pthread_mutex_lock(...) 0x3ff805686b0]

> > > Information:  An <opaque> type was presented during execution of the
> > > previous command.  For complete type information on this symbol,
> > > recompilation of the program will be necessary.  Consult the compiler
> > > man pages for details on producing full symbol table information using
> > > the '-g' (and '-gall' for cxx) flags.

> > > (ladebug) up
> > > >1  0x3ff8013ac30 in __tis_mutex_lock(...) in /shlib/libc.so (ladebug) up
> > > >2  0x3ff8013b530 in __cma_tis_mutex_lock(...) in /shlib/libc.so
> > > >3  0x3ff802e150c in __cxx_mutex_lock(...) in /shlib/libcxx.so
> > > >4  0x12003e624 in UnknownProcedure34FromFile273(...) in TestApp (ladebug)
>  up
> > > >5  0x12003d930 in Init(...) in TestApp
> > > >6  0x3ffbffe1858 in __init_sti__cxxl_std_init_cpp_65f45f2a(...) in
>  myLib.so
> > > >7  0x3ffbfffbbd8 in myLib.so
> > > >8  0x3ff800068e0

> > Are you doing multithreading? Are you linking against reeantrant libraries?
> > There were issues with "printf()" (I know, this "iostream") and locking
> > (done internally, by the "printf()") in a multi-threaded application.

> > Nix.

> Hi,
> No multithreading, No reantrant.

> This is an example:

> library 1 consists of class A
> class A
> {
>   ...
>   static void printMsg( const string& msg ){ cout << msg ;}
> }
>  library 2 consists of class B
> class_b.h
> class B
> {
>   ...
>   int set();
> }

> class_b.cpp
> int B::set()
> {
>   A::printMsg( string("B::set()") ); //core dump
>   return 0;
> }

> test.cpp
> int main(...)
> {
>   A::printMsg( string("main...") );
>   return 0;
> }

problem solved!
i have removed '__USE_STD_IOSTREAM',,.
 
 
 

1. C++ project compiles (compat=4), classic iostreams, and runs. There is a problem when compat=5, standard iostream.

There is a C++ project, posix threads, linked with -lposix4, using classic
iostreams, headers like <iostream.h>, which runs fine when compiled by SUN
Workshop 5.0 compiler with compatibility level 4 (compat=4).

To use STL I must compile & run this project with compat=5. The code
compiles & links okay (using standard iostream, headers like <iostream>),
except compiler complaining on ambiguous memcpy & memset functions: cannot
choose between std::memcpy() & memcpy
That is strange, but I explicitly prefixed them making std::memcpy().

The real problem is that I get stuck inside of the ostrstream objects. I may
declare a local variable as osrstream and use once, but I get deadlock or
something in the different function when declaring another local variable as
ostrstream.

Also if I compile the project under Purify, on the very first statement Purify
pops up a bunch of UMR error messages (!?), for ex., pointing to the
statement like:
ostrstream os;        <= Uninitialized memory read, This is occurring while
in: mutex_unlock [libthread.so.1]

Maybe there is bug in SUN Workshop 5.0 or I am not linking with the right
libraries or standard iostream requires a special handling.

Please help or advise.

Mike Fogelman

2. Corrupt Font in OS/5.0.4 with Cirrus 5446

3. Using SUN Workshop 5.0: C++ project compiles (compat=4), classic iostreams, and runs. Crashes when compat=5, standard iostream.

4. SuSE 8.1 Review (re-post as ISP had problems)

5. gcc can't find iostream.h

6. MetroX and Matrox Millenium card

7. gdb problem w/ iostream.cc

8. Compiling TCP/IP *without* ethernet

9. location of iostream header file

10. C++ iostreams + libthread problem

11. Can't compile - missing iostream.h

12. C++ iostream popen equivalent?

13. g++ iostream.h problem