2008-10-27 11:31:40     dynamic loaded library with static variables

Document created by Aaronwu Employee on Aug 8, 2013
Version 1Show Document
  • View in full screen mode

2008-10-27 11:31:40     dynamic loaded library with static variables

Stephen Sheldon (GERMANY)

Message: 64233   

 

Hi,

 

we have a problem with static variables when we use them in a dynamic loaded library. We load the library with dlopen("libLaneDetectWorker.so", RTLD_NOW );

 

We declare a static variable in a public static member function. The code compiles without any errors or warnings.

 

When we execute the application it stops at the declaration of the static variable. We don't get any error messages or the like.

 

There is also nothing to see when we debug it with gdbserver. When the debugger tries to executed this code line it never returns from it.

 

When we use the same code in a little test application without dynamic loaded library there is no problem with the static variable.

 

We use uClinux (Linux version 2.6.22.18-ADI-2008R1-svn) on ADI BF561 EZ-Kit Lite board.

U-Boot 1.1.6-svn1112

Blackfin toolchain 08r1-8

 

Does someone have got a similar problem?

 

 

Best regards

Stephen

 

 

TranslateQuoteReplyEditDelete

 

 

2008-10-27 11:42:15     Re: dynamic loaded library with static variables

Mike Frysinger (UNITED STATES)

Message: 64234   

 

try with 2008R1.5

QuoteReplyEditDelete

 

 

2008-10-27 12:31:21     Re: dynamic loaded library with static variables

Stephen Sheldon (GERMANY)

Message: 64236   

 

Is this a known bug which is fixed in the 2008R1.5 or should I just try if it works with the new release?

 

I ask because I have no time to update the uClinux now.  (deadline of my diploma thesis is in 2 weeks) I built a workaround with global variables. For now its ok, but for the future we would like to use static variables.

 

-

Steph

TranslateQuoteReplyEditDelete

 

 

2008-10-27 13:34:14     Re: dynamic loaded library with static variables

Mike Frysinger (UNITED STATES)

Message: 64239   

 

there were reports in the past and none were reproducible once they upgraded to 2008R1.5

Attachments

    Outcomes