Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
* Program crashing while exiting. Need help!!
@ 2003-06-09 21:52 Ranga
  2003-06-10 13:48 ` Ranga
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ranga @ 2003-06-09 21:52 UTC (permalink / raw)


Hi,

I am having a crash while exiting the program on Tru64. I don't see
this problem on any other platform (Linux, Solaris, AIX, HP). Here is
the OS & CXX Version information. Also, I have included a session of
ladebug interaction.
OS: OSF1 V5.1 1885 alpha
Compiler: Compaq C++ V6.5-014 for Compaq Tru64 UNIX V5.1A.

I am wondering if I am missing any required patches or may be it's
something else.

LADEBUG Interaction.
Here is a clip from the ladebug. The process starts exiting and calls
some mutex lock and mutex unlock... Hangs there for some reason, and I
interrupted and got the call stack (If not in debugger it core dumps).
Would appreciate any help in figuring out this strange problem.

    115 int main(int argc, char** argv)
(ladebug) s
stopped at [<opaque> __start(...) 0x1200375dc]

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) print
NULL
(ladebug) s
stopped at [<opaque> exit(...) 0x3ff800de078]
(ladebug) s
stopped at [<opaque> __pthread_mutex_lock(...) 0x3ff8056873c]
(ladebug) s
stopped at [<opaque> __pthread_mutex_unlock(...) 0x3ff80568c88]
(ladebug) n

Interrupt (for process)

Stopping process localhost:60519 (testharness).
Thread received signal INT
The "next " command was not completed.
stopped at [<opaque> UnknownProcedure12FromFile22(...) 0x3ff801f9904]
(ladebug)
n

Interrupt (for process)

Stopping process localhost:60519 (testharness).
Thread received signal INT
The "next " command was not completed.
stopped at [<opaque> UnknownProcedure12FromFile22(...) 0x3ff801f9910]
(ladebug) where
>0  0x3ff801f9910 in UnknownProcedure12FromFile22(0x3ffc0086f90,
0x100000, 0x0, 0x40000000, 0xffffffffffefffff, 0x3ff801f98e4) in
/usr/shlib/libc.so
#1  0x3ff800d3690 in free(0x3ffc0086f90, 0x100000, 0x0, 0x40000000,
0xffffffffffefffff, 0x3ff801f98e4) in /usr/shlib/libc.so
#2  0x3ff800de0d0 in exit(0x3ffc0086f90, 0x100000, 0x0, 0x40000000,
0xffffffffffefffff, 0x3ff801f98e4) in /usr/shlib/libc.so
#3  0x1200375f8 in __start(0x3ffc0086f90, 0x100000, 0x0, 0x40000000,
0xffffffffffefffff, 0x3ff801f98e4) in testharness
(ladebug)

Regards,
Ranga.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Program crashing while exiting. Need help!!
  2003-06-09 21:52 Program crashing while exiting. Need help!! Ranga
@ 2003-06-10 13:48 ` Ranga
  2003-06-10 15:32   ` Joe Mario
  2003-06-10 15:33 ` Joe Mario
  2003-08-11  7:30 ` QinFeng
  2 siblings, 1 reply; 9+ messages in thread
From: Ranga @ 2003-06-10 13:48 UTC (permalink / raw)


On the compile line I put -pthread immediately after 
"/cxx -gall -pt -O0 -w0 -use_ld_input=.so_files"  instead of putting
it in the middle of the compile line. (Initially, it was after -Is,
-Ls and couple of -Ds.) Also, I removed -lpthread -lxti and -lrt
libraries that I was linking with.

Of course, why this solved my problem, I have no clues. [I found the
above one by shear brute force rather than by any logic.]

Any possible explanations from anyone?

Thanks,
Ranga.

pvangara@hotmail.com (Ranga) wrote in message news:<8d55bd93.0306091352.4e46ff5@posting.google.com>...
> Hi,
> 
> I am having a crash while exiting the program on Tru64. I don't see
> this problem on any other platform (Linux, Solaris, AIX, HP). Here is
> the OS & CXX Version information. Also, I have included a session of
> ladebug interaction.
> OS: OSF1 V5.1 1885 alpha
> Compiler: Compaq C++ V6.5-014 for Compaq Tru64 UNIX V5.1A.
> 
> I am wondering if I am missing any required patches or may be it's
> something else.
> 
> LADEBUG Interaction.
> Here is a clip from the ladebug. The process starts exiting and calls
> some mutex lock and mutex unlock... Hangs there for some reason, and I
> interrupted and got the call stack (If not in debugger it core dumps).
> Would appreciate any help in figuring out this strange problem.
> 
>     115 int main(int argc, char** argv)
> (ladebug) s
> stopped at [<opaque> __start(...) 0x1200375dc]
> 
> 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) print
> NULL
> (ladebug) s
> stopped at [<opaque> exit(...) 0x3ff800de078]
> (ladebug) s
> stopped at [<opaque> __pthread_mutex_lock(...) 0x3ff8056873c]
> (ladebug) s
> stopped at [<opaque> __pthread_mutex_unlock(...) 0x3ff80568c88]
> (ladebug) n
> 
> Interrupt (for process)
> 
> Stopping process localhost:60519 (testharness).
> Thread received signal INT
> The "next " command was not completed.
> stopped at [<opaque> UnknownProcedure12FromFile22(...) 0x3ff801f9904]
> (ladebug)
> n
> 
> Interrupt (for process)
> 
> Stopping process localhost:60519 (testharness).
> Thread received signal INT
> The "next " command was not completed.
> stopped at [<opaque> UnknownProcedure12FromFile22(...) 0x3ff801f9910]
> (ladebug) where
> >0  0x3ff801f9910 in UnknownProcedure12FromFile22(0x3ffc0086f90,
> 0x100000, 0x0, 0x40000000, 0xffffffffffefffff, 0x3ff801f98e4) in
> /usr/shlib/libc.so
> #1  0x3ff800d3690 in free(0x3ffc0086f90, 0x100000, 0x0, 0x40000000,
> 0xffffffffffefffff, 0x3ff801f98e4) in /usr/shlib/libc.so
> #2  0x3ff800de0d0 in exit(0x3ffc0086f90, 0x100000, 0x0, 0x40000000,
> 0xffffffffffefffff, 0x3ff801f98e4) in /usr/shlib/libc.so
> #3  0x1200375f8 in __start(0x3ffc0086f90, 0x100000, 0x0, 0x40000000,
> 0xffffffffffefffff, 0x3ff801f98e4) in testharness
> (ladebug)
> 
> Regards,
> Ranga.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Program crashing while exiting. Need help!!
  2003-06-10 13:48 ` Ranga
@ 2003-06-10 15:32   ` Joe Mario
  0 siblings, 0 replies; 9+ messages in thread
From: Joe Mario @ 2003-06-10 15:32 UTC (permalink / raw)


Ranga wrote:
>  I am having a crash while exiting the program on Tru64. ...

Several things come to mind for crashes during exit.

1: There is a patch available for a crash during exit().  It addresses
   the problem where a dlopen()'d library registers an atexit handler
   to be run when the program exits, but the library is dlclosed and
   unmapped before the program exits.  In this case, the exit() code
   in libc would try to run the registered exit handler and crash.
   The patch properly deregisters the exit handler when the library
   is dlclosed.

2: If your application doesn't link with threads but it does
   dlopen a library that depends on threads, then the application
   will likely crash, sometimes while exitting.  The solution here
   (really a requirement) is to link your main application with 
   threads if any of the libraries it dlopens depend on threads.

    
Joe Mario
HP Tru64 UNIX Development environment.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Program crashing while exiting. Need help!!
  2003-06-09 21:52 Program crashing while exiting. Need help!! Ranga
  2003-06-10 13:48 ` Ranga
@ 2003-06-10 15:33 ` Joe Mario
  2003-06-11 17:25   ` Ranga
  2003-08-11  7:30 ` QinFeng
  2 siblings, 1 reply; 9+ messages in thread
From: Joe Mario @ 2003-06-10 15:33 UTC (permalink / raw)


Ranga wrote:
>  I am having a crash while exiting the program on Tru64. ...

Several things come to mind for crashes during exit.

1: There is a patch available for a crash during exit().  It addresses
   the problem where a dlopen()'d library registers an atexit handler
   to be run when the program exits, but the library is dlclosed and
   unmapped before the program exits.  In this case, the exit() code
   in libc would try to run the registered exit handler and crash.
   The patch properly deregisters the exit handler when the library
   is dlclosed.

2: If your application doesn't link with threads but it does
   dlopen a library that depends on threads, then the application
   will likely crash, sometimes while exitting.  The solution here
   (really a requirement) is to link your main application with 
   threads if any of the libraries it dlopens depend on threads.

    
Joe Mario
HP Tru64 UNIX Development environment.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Program crashing while exiting. Need help!!
  2003-06-10 15:33 ` Joe Mario
@ 2003-06-11 17:25   ` Ranga
  2003-06-11 19:39     ` Joe Mario
  0 siblings, 1 reply; 9+ messages in thread
From: Ranga @ 2003-06-11 17:25 UTC (permalink / raw)


Joe Mario <joe.mario@_delete-this_hp.com> wrote in message news:<3EE5F5EF.FF98B13D@_delete-this_hp.com>...
> Ranga wrote:
> >  I am having a crash while exiting the program on Tru64. ...
> 
> Several things come to mind for crashes during exit.
> 
> 1: There is a patch available for a crash during exit().  It addresses
>    the problem where a dlopen()'d library registers an atexit handler
>    to be run when the program exits, but the library is dlclosed and
>    unmapped before the program exits.  In this case, the exit() code
>    in libc would try to run the registered exit handler and crash.
>    The patch properly deregisters the exit handler when the library
>    is dlclosed.

Our sysad installed all the patches from the hp site. Still I have the
same problem (if I don't do the weird solution that I have mentioned
previously.). Do you know the exact patch by any chance? [We do have
the dlopen, and dlclose. We use ACE to do all this.]


> 
> 2: If your application doesn't link with threads but it does
>    dlopen a library that depends on threads, then the application
>    will likely crash, sometimes while exitting.  The solution here
>    (really a requirement) is to link your main application with 
>    threads if any of the libraries it dlopens depend on threads.
> 

Our application and the DLLs are all multi-threaded in this case.
Thanks Joe for responding to the mail.
Regards,
Ranga.

>     
> Joe Mario
> HP Tru64 UNIX Development environment.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Program crashing while exiting. Need help!!
  2003-06-11 17:25   ` Ranga
@ 2003-06-11 19:39     ` Joe Mario
  2003-06-12 19:54       ` Ranga
  0 siblings, 1 reply; 9+ messages in thread
From: Joe Mario @ 2003-06-11 19:39 UTC (permalink / raw)


Ranga:
  I don't know the official patch names.  The dlopen/dlclose exit()
  patch I mentioned was added to the V5.1 BL3 patch kit, thought it
  probably has another official name.  That patch kit was released
  in September 2002.  To see if you have it, type the following:

     % nm /shlib/libc.so | grep __atdlclose

  If you see no output from the above "nm" command, they you do
  not have the patch.  If you see two __atdlclose* symbols, then
  you do have the patch.  If you have the symbols, then this is
  not your problem.

  Also, make sure that the output of "ldd" on your application
  shows that it links with libpthread.so.  If it doesn't, then
  link with it.

 Joe Mario


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Program crashing while exiting. Need help!!
  2003-06-11 19:39     ` Joe Mario
@ 2003-06-12 19:54       ` Ranga
  2003-06-14 14:39         ` Joe Mario
  0 siblings, 1 reply; 9+ messages in thread
From: Ranga @ 2003-06-12 19:54 UTC (permalink / raw)


Thanks for the solution.

I did the above check that you mentioned and we don't have the needed
patch. I searched and searched on the hp site without much help. I
find the hp site very unhelpful & difficult to browse. I couldn't find
the patch. Our sysad installed lots of patches 2 days back but that
didn't help (I couldn't find the symbol that U mentioned).

I guess for now, I will go the with the workaround of putting -pthread
option on the linker line and not linking in -lpthread, -lrt, -lxti.
That makes the exe not crash. Of course, I am wary of this problem.

Regards,
Ranga.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Program crashing while exiting. Need help!!
  2003-06-12 19:54       ` Ranga
@ 2003-06-14 14:39         ` Joe Mario
  0 siblings, 0 replies; 9+ messages in thread
From: Joe Mario @ 2003-06-14 14:39 UTC (permalink / raw)


Ranga:
  I'm not sure I understand your second paragraph.  The only supported
  way to link a program with threads is to use the driver and to
  specify -pthread.  It is not recommended that you call the linker
  directly to link threaded programs and it is not recommended that
  you link with libpthread.so directly.  Using the -pthread driver
  flag allows the driver to properly link with the threads library.

Joe

Ranga wrote:
> 
> Thanks for the solution.
> 
> I did the above check that you mentioned and we don't have the needed
> patch. I searched and searched on the hp site without much help. I
> find the hp site very unhelpful & difficult to browse. I couldn't find
> the patch. Our sysad installed lots of patches 2 days back but that
> didn't help (I couldn't find the symbol that U mentioned).
> 
> I guess for now, I will go the with the workaround of putting -pthread
> option on the linker line and not linking in -lpthread, -lrt, -lxti.
> That makes the exe not crash. Of course, I am wary of this problem.
> 
> Regards,
> Ranga.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Program crashing while exiting. Need help!!
  2003-06-09 21:52 Program crashing while exiting. Need help!! Ranga
  2003-06-10 13:48 ` Ranga
  2003-06-10 15:33 ` Joe Mario
@ 2003-08-11  7:30 ` QinFeng
  2 siblings, 0 replies; 9+ messages in thread
From: QinFeng @ 2003-08-11  7:30 UTC (permalink / raw)



Hi,
Thank you for your reply of such a question, now I met the problem as
the author, I used dlopen and dlclose to load a .so file contaning
Oracle PROC functions, and when the program is exiting, it crashes!
I have update all patches coverring /shlib/libc.so, but I still couldn't
find the __atdclose symbol in /shlib/libc.so file, can you help me?

My OS is OSF4.0f, and patched with following files:

duv40fb18-c0067403-14947-es-20020730.tar
duv40fb18-c0067405-15263-es-20020827.tar
duv40fb18as0007-20020102.tar

--
Posted via http://dbforums.com


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-08-11  7:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-09 21:52 Program crashing while exiting. Need help!! Ranga
2003-06-10 13:48 ` Ranga
2003-06-10 15:32   ` Joe Mario
2003-06-10 15:33 ` Joe Mario
2003-06-11 17:25   ` Ranga
2003-06-11 19:39     ` Joe Mario
2003-06-12 19:54       ` Ranga
2003-06-14 14:39         ` Joe Mario
2003-08-11  7:30 ` QinFeng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox