Discussion:
[omniORB] static library
tristan
2008-03-05 03:38:36 UTC
Permalink
Hello,
I've built an application using omniORB and while I'm generating dynamic ELF
everything is working fine.
The problem is when I generate a static binary for i386 cpu : there is a
SIGSEGV in function ORB_init.

here is the output from valgrind :


==5489== Thread 16:
==5489== Conditional jump or move depends on uninitialised value(s)
==5489== at 0x84F988C: strlen (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x8310710: omniORB::logger::~logger() (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x836CCB6: omni::omniCodeSet::logCodeSets() (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x82F1D70: CORBA::ORB_init(int&, char**, char const*, char
const* (*) [2]) (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x812EB56: CEqpInterfaceImpl_v2::InitOrb()
(EqpInterface_v2.cpp:234)
==5489== by 0x812F04E: CEqpInterfaceImpl_v2::Start(char const*,
ISecurityModule*) (EqpInterface_v2.cpp:305)
==5489== by 0x810538D: CMsgCom::MsgComMain(CMsgCom*) (msgcom.cpp:581)
==5489== by 0x825B429: cbth_handler(void*) (linuxthread.cpp:27)
==5489== by 0x845C8D9: start_thread (pthread_create.c:296)
==5489== by 0x850E31D: clone (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
omniORB: Native char code sets:.
omniORB: Transmission char code sets:.
omniORB: Native wide char code sets:.
==5489==
==5489== Conditional jump or move depends on uninitialised value(s)
==5489== at 0x84F98D1: strlen (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x8310710: omniORB::logger::~logger() (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x836CEDC: omni::omniCodeSet::logCodeSets() (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x82F1D70: CORBA::ORB_init(int&, char**, char const*, char
const* (*) [2]) (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x812EB56: CEqpInterfaceImpl_v2::InitOrb()
(EqpInterface_v2.cpp:234)
==5489== by 0x812F04E: CEqpInterfaceImpl_v2::Start(char const*,
ISecurityModule*) (EqpInterface_v2.cpp:305)
==5489== by 0x810538D: CMsgCom::MsgComMain(CMsgCom*) (msgcom.cpp:581)
==5489== by 0x825B429: cbth_handler(void*) (linuxthread.cpp:27)
==5489== by 0x845C8D9: start_thread (pthread_create.c:296)
==5489== by 0x850E31D: clone (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
omniORB: Transmission wide char code sets:.
==5489==
==5489== Invalid read of size 4
==5489== at 0x83460B1: omni::omni_cdrStream_initialiser::attach() (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x82F1D7C: CORBA::ORB_init(int&, char**, char const*, char
const* (*) [2]) (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x812EB56: CEqpInterfaceImpl_v2::InitOrb()
(EqpInterface_v2.cpp:234)
==5489== by 0x812F04E: CEqpInterfaceImpl_v2::Start(char const*,
ISecurityModule*) (EqpInterface_v2.cpp:305)
==5489== by 0x810538D: CMsgCom::MsgComMain(CMsgCom*) (msgcom.cpp:581)
==5489== by 0x825B429: cbth_handler(void*) (linuxthread.cpp:27)
==5489== by 0x845C8D9: start_thread (pthread_create.c:296)
==5489== by 0x850E31D: clone (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== Address 0x4 is not stack'd, malloc'd or (recently) free'd
==5489==
==5489== Process terminating with default action of signal 11 (SIGSEGV)
==5489== Access not within mapped region at address 0x4
==5489== at 0x83460B1: omni::omni_cdrStream_initialiser::attach() (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x82F1D7C: CORBA::ORB_init(int&, char**, char const*, char
const* (*) [2]) (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489== by 0x812EB56: CEqpInterfaceImpl_v2::InitOrb()
(EqpInterface_v2.cpp:234)
==5489== by 0x812F04E: CEqpInterfaceImpl_v2::Start(char const*,
ISecurityModule*) (EqpInterface_v2.cpp:305)
==5489== by 0x810538D: CMsgCom::MsgComMain(CMsgCom*) (msgcom.cpp:581)
==5489== by 0x825B429: cbth_handler(void*) (linuxthread.cpp:27)
==5489== by 0x845C8D9: start_thread (pthread_create.c:296)
==5489== by 0x850E31D: clone (in
/home/blunderer/Work/thales/ittem/ittem/v_ittem/ITTEM/Gau/Delivery/Linux/bin/ITTEM_GAU)
==5489==
==5489== ERROR SUMMARY: 83698 errors from 294 contexts (suppressed: 0 from
0)
==5489== malloc/free: in use at exit: 0 bytes in 0 blocks.
==5489== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==5489== For counts of detected errors, rerun with: -v
==5489== All heap blocks were freed -- no leaks are possible.


Does anybody know something about that?

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080304/2ca368ae/attachment.htm
Wernke Zur Borg
2008-03-05 14:13:34 UTC
Permalink
Post by tristan
Hello,
I've built an application using omniORB and while I'm
generating dynamic ELF everything is working fine.
there is a SIGSEGV in function ORB_init.
[snip]


Please post the piece of code where you call ORB_init(), so that it can
be seen what arguments you are passing.

Wernke
tristan
2008-03-05 18:40:37 UTC
Permalink
Here is the call of oORB_init. arguments are :


std::string m_corbaVersion = "omniORB4";
argc = 14;
argv[0] = "-ORBscanGranularity";
argv[1] = "1";
argv[2] = "-ORBendPoint";
argv[3] = "giop:tcp:10.10.10.123:10002";
argv[4] = "-ORBclientCallTimeOutPeriod";
argv[5] = "15000";
argv[6] = "-ORBserverCallTimeOutPeriod";
argv[7] = "15000";
argv[8] = "-ORBtraceLevel";
argv[9] = "40";
argv[10] = "-ORBoutConScanPeriod";
argv[11] = "0";
argv[12] = "-ORBinConScanPeriod";
argv[13] = "0";

CORBA::ORB_init( argc, argv, m_corbaVersion.c_str() );

thanks again
Post by Wernke Zur Borg
Post by tristan
Hello,
I've built an application using omniORB and while I'm
generating dynamic ELF everything is working fine.
there is a SIGSEGV in function ORB_init.
[snip]
Please post the piece of code where you call ORB_init(), so that it can
be seen what arguments you are passing.
Wernke
Wernke Zur Borg
2008-03-05 19:04:34 UTC
Permalink
Hi,

you better use the 4th parameter of ORB_init() to pass ORB options.

Anyway, argv[0] is reserved for the program name, so if you really want
to program it like that, you have argc=15 and have your args at
argv[1]..argv[14]. You should also append an extra zero argument at
argv[argc].

Wernke
-----Original Message-----
Sent: 05 March 2008 13:41
To: Wernke Zur Borg
Subject: Re : [omniORB] static library
std::string m_corbaVersion = "omniORB4";
argc = 14;
argv[0] = "-ORBscanGranularity";
argv[1] = "1";
argv[2] = "-ORBendPoint";
argv[3] = "giop:tcp:10.10.10.123:10002";
argv[4] = "-ORBclientCallTimeOutPeriod";
argv[5] = "15000";
argv[6] = "-ORBserverCallTimeOutPeriod";
argv[7] = "15000";
argv[8] = "-ORBtraceLevel";
argv[9] = "40";
argv[10] = "-ORBoutConScanPeriod";
argv[11] = "0";
argv[12] = "-ORBinConScanPeriod";
argv[13] = "0";
CORBA::ORB_init( argc, argv, m_corbaVersion.c_str() );
thanks again
Post by Wernke Zur Borg
Post by tristan
Hello,
I've built an application using omniORB and while I'm
generating dynamic ELF everything is working fine.
there is a SIGSEGV in function ORB_init.
[snip]
Please post the piece of code where you call ORB_init(), so
that it can
Post by Wernke Zur Borg
be seen what arguments you are passing.
Wernke
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
tristan
2008-03-05 19:45:54 UTC
Permalink
Thank you for your answer.
I'll try to modify this and I'll tell you the result.
But Is there any reason for my application working fine when compiling as
dynamic ELF and not working when compiling as static ?
Post by Wernke Zur Borg
Hi,
you better use the 4th parameter of ORB_init() to pass ORB options.
Anyway, argv[0] is reserved for the program name, so if you really want
to program it like that, you have argc=15 and have your args at
argv[1]..argv[14]. You should also append an extra zero argument at
argv[argc].
Wernke
-----Original Message-----
Sent: 05 March 2008 13:41
To: Wernke Zur Borg
Subject: Re : [omniORB] static library
std::string m_corbaVersion = "omniORB4";
argc = 14;
argv[0] = "-ORBscanGranularity";
argv[1] = "1";
argv[2] = "-ORBendPoint";
argv[3] = "giop:tcp:10.10.10.123:10002";
argv[4] = "-ORBclientCallTimeOutPeriod";
argv[5] = "15000";
argv[6] = "-ORBserverCallTimeOutPeriod";
argv[7] = "15000";
argv[8] = "-ORBtraceLevel";
argv[9] = "40";
argv[10] = "-ORBoutConScanPeriod";
argv[11] = "0";
argv[12] = "-ORBinConScanPeriod";
argv[13] = "0";
CORBA::ORB_init( argc, argv, m_corbaVersion.c_str() );
thanks again
Post by Wernke Zur Borg
Post by tristan
Hello,
I've built an application using omniORB and while I'm
generating dynamic ELF everything is working fine.
there is a SIGSEGV in function ORB_init.
[snip]
Please post the piece of code where you call ORB_init(), so
that it can
Post by Wernke Zur Borg
be seen what arguments you are passing.
Wernke
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20080305/6f674df0/attachment.htm
Duncan Grisby
2008-03-07 16:12:14 UTC
Permalink
Post by tristan
I've built an application using omniORB and while I'm generating dynamic ELF
everything is working fine.
The problem is when I generate a static binary for i386 cpu : there is a
SIGSEGV in function ORB_init.
The problem is probably that the linker has removed some things that
have static initialisers. It thinks they are not used, when actually
they are. The strange thing is that there is already code that tries to
force linkage of the necessary things.

Try editing include/omniORB4/CORBA_sysdep.h to define
OMNI_NEED_STATIC_FUNC_TO_FORCE_LINK for your platform.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...