Discussion:
[omniORB] omninames 4.1.0 for VC8 crashes when -errlog is specified
John Stevenson-Hoare
2007-05-23 15:19:52 UTC
Permalink
We are trying to use the 4.1.0 version built for VC8 of the omninames
executable.



If the -errlog parameter is supplied the program simply crashes out.
After examining the code it appears that the following line in
omniNames.cc is to blame:



Line 159: setvbuf(stderr, 0, _IOLBF, 0);



The Visual Studio 2005 documentation states that the 4th argument to
this function, ie size, must be in the range 2 <= size <= INT_MAX
(2147483647). Clearly 0 is not in this range!



Having set the value to 2 and re-compiled, the program runs without
error.



Regards

John Stevenson-Hoare

Consultant Engineer

FFEI Ltd.




______________________________________________________________________

CONFIDENTIALITY AND DISCLAIMER NOTICE

This message and any attachment is confidential and is protected by copyright. If you are not the intended recipient, please email the sender or telephone +44 (0)1442 213440 and delete this message and any attachment from your system. Dissemination and or copying of this email is prohibited if you are not the intended recipient.

We believe, but do not warrant, that this email and any attachments are virus free. You should take full responsibility for virus checking.

No responsibility is accepted by FFEI Ltd for personal emails or emails unconnected with FFEI Limited's business.
______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070523/a3292d3c/attachment.htm
Duncan Grisby
2007-06-19 22:27:02 UTC
Permalink
Post by John Stevenson-Hoare
If the -errlog parameter is supplied the program simply crashes out.
After examining the code it appears that the following line in
Line 159: setvbuf(stderr, 0, _IOLBF, 0);
The Visual Studio 2005 documentation states that the 4th argument to
this function, ie size, must be in the range 2 <= size <= INT_MAX
(2147483647). Clearly 0 is not in this range!
Sorry for the delay in replying to this. The problem is down to a
difference between Windows and Unix platforms. On Unix platforms, the
size parameter is the size of the buffer if one is provided, which in
this case there isn't. Windows takes it to be the size of the buffer it
should allocate.

Windows doesn't support line buffering at all, so the code is pointless
there anyway. I've fixed it by #ifdefing it away on Windows.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Tahar Ouhrouche
2007-06-19 22:46:32 UTC
Permalink
Hi Guys,
I'm facing a kinda similar problem when compiling my application with Visual
Studio 2005 using omniORB4.0.7
As soon as the omniORB::Init() function is called, the program crashed,
windows returns an Acces violation error.
Did you ever faced this kind of problem?

Thanks,

Cheers,

Tahar
Post by Duncan Grisby
Post by John Stevenson-Hoare
If the -errlog parameter is supplied the program simply crashes out.
After examining the code it appears that the following line in
Line 159: setvbuf(stderr, 0, _IOLBF, 0);
The Visual Studio 2005 documentation states that the 4th argument to
this function, ie size, must be in the range 2 <= size <= INT_MAX
(2147483647). Clearly 0 is not in this range!
Sorry for the delay in replying to this. The problem is down to a
difference between Windows and Unix platforms. On Unix platforms, the
size parameter is the size of the buffer if one is provided, which in
this case there isn't. Windows takes it to be the size of the buffer it
should allocate.
Windows doesn't support line buffering at all, so the code is pointless
there anyway. I've fixed it by #ifdefing it away on Windows.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- http://www.grisby.org --
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070619/ceec8846/attachment.htm
John Stevenson-Hoare
2007-06-20 12:55:27 UTC
Permalink
Hi Tahar,



Didn't experience this problem with 4.0.7 myself as we used the
pre-built version. Sounds a bit obvious but did you try debugging in to
the affected function to see why it crashes?



Cheers

John



________________________________

From: Tahar Ouhrouche [mailto:***@gmail.com]
Sent: 19 June 2007 17:47
To: Duncan Grisby
Cc: John Stevenson-Hoare; omniorb-***@omniorb-support.com
Subject: Re: [omniORB] omninames 4.1.0 for VC8 crashes when -errlog is
specified



Hi Guys,
I'm facing a kinda similar problem when compiling my application with
Visual Studio 2005 using omniORB4.0.7
As soon as the omniORB::Init() function is called, the program crashed,
windows returns an Acces violation error.
Did you ever faced this kind of problem?

Thanks,

Cheers,

Tahar
Post by John Stevenson-Hoare
If the -errlog parameter is supplied the program simply
crashes out.
Post by John Stevenson-Hoare
After examining the code it appears that the following line in
Line 159: setvbuf(stderr, 0, _IOLBF, 0);
The Visual Studio 2005 documentation states that the 4th
argument to
Post by John Stevenson-Hoare
this function, ie size, must be in the range 2 <= size <=
INT_MAX
Post by John Stevenson-Hoare
(2147483647). Clearly 0 is not in this range!
Sorry for the delay in replying to this. The problem is down to
a
difference between Windows and Unix platforms. On Unix
platforms, the
size parameter is the size of the buffer if one is provided,
which in
this case there isn't. Windows takes it to be the size of the
buffer it
should allocate.

Windows doesn't support line buffering at all, so the code is
pointless
there anyway. I've fixed it by #ifdefing it away on Windows.

Cheers,

Duncan.

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

_______________________________________________
omniORB-list mailing list
omniORB-***@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list




______________________________________________________________________

CONFIDENTIALITY AND DISCLAIMER NOTICE

This message and any attachment is confidential and is protected by copyright. If you are not the intended recipient, please email the sender or telephone +44 (0)1442 213440 and delete this message and any attachment from your system. Dissemination and or copying of this email is prohibited if you are not the intended recipient.

We believe, but do not warrant, that this email and any attachments are virus free. You should take full responsibility for virus checking.

No responsibility is accepted by FFEI Ltd for personal emails or emails unconnected with FFEI Limited's business.
______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070620/68783905/attachment.htm
Tahar Ouhrouche
2007-06-20 13:04:21 UTC
Permalink
Hi John, Duncan, All
Thanks for the quick answer,
Yes, I tried to debug the CORBA::ORB_init(argc, argv,"omniORB4"); and I
couldn't even step into this function, cuz it's on a Lib I guess. The error
that I get is:
"First-chance exception at 0x7c90eb74 in TestCORBA.exe: 0xC0000008: An
invalid handle was specified."
When it goes into the Assembly, the problem is in this instruction:
7C90EB6F call 7C90EBAC
7C90EB74 mov eax,dword ptr [esp]
It seems that the program tries to get a return value (which is null) of the
function 7C90EBAC from the stack :-o
I tried to compile the echo example in the <top>/src/examples/echo folder of
omniORB4 and i got the samething.

I tried with other versions of omniORB for VC8 followed all the instructions
to compile and run omniORB4 but the problem persists
Please note that this program is working just fine in VC6 with omniORB305

Thanks for help,

Cheers,
Tahar
Post by John Stevenson-Hoare
Hi Tahar,
Didn't experience this problem with 4.0.7 myself as we used the pre-built
version. Sounds a bit obvious but did you try debugging in to the affected
function to see why it crashes?
Cheers
John
------------------------------
*Sent:* 19 June 2007 17:47
*To:* Duncan Grisby
*Subject:* Re: [omniORB] omninames 4.1.0 for VC8 crashes when -errlog is
specified
Hi Guys,
I'm facing a kinda similar problem when compiling my application with
Visual Studio 2005 using omniORB4.0.7
As soon as the omniORB::Init() function is called, the program crashed,
windows returns an Acces violation error.
Did you ever faced this kind of problem?
Thanks,
Cheers,
Tahar
Post by John Stevenson-Hoare
If the -errlog parameter is supplied the program simply crashes out.
After examining the code it appears that the following line in
Line 159: setvbuf(stderr, 0, _IOLBF, 0);
The Visual Studio 2005 documentation states that the 4th argument to
this function, ie size, must be in the range 2 <= size <= INT_MAX
(2147483647). Clearly 0 is not in this range!
Sorry for the delay in replying to this. The problem is down to a
difference between Windows and Unix platforms. On Unix platforms, the
size parameter is the size of the buffer if one is provided, which in
this case there isn't. Windows takes it to be the size of the buffer it
should allocate.
Windows doesn't support line buffering at all, so the code is pointless
there anyway. I've fixed it by #ifdefing it away on Windows.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- http://www.grisby.org --
_______________________________________________
omniORB-list mailing list
http://www.omniorb-support.com/mailman/listinfo/omniorb-list
______________________________________________________________________
CONFIDENTIALITY AND DISCLAIMER NOTICE
This message and any attachment is confidential and is protected by
copyright. If you are not the intended recipient, please email the sender or
telephone +44 (0)1442 213440 and delete this message and any attachment from
your system. Dissemination and or copying of this email is prohibited if you
are not the intended recipient.
We believe, but do not warrant, that this email and any attachments are
virus free. You should take full responsibility for virus checking.
No responsibility is accepted by FFEI Ltd for personal emails or emails
unconnected with FFEI Limited's business.
______________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070620/f2bda760/attachment-0001.htm
Duncan Grisby
2007-06-22 23:35:32 UTC
Permalink
Post by Tahar Ouhrouche
Yes, I tried to debug the CORBA::ORB_init(argc, argv,"omniORB4"); and I
couldn't even step into this function, cuz it's on a Lib I guess. The error
"First-chance exception at 0x7c90eb74 in TestCORBA.exe: 0xC0000008: An
invalid handle was specified."
First of all, use the latest CVS snapshot.

Second, make sure you are not mixing debug and non-debug code.

When you say the echo example doesn't work, did you compile it with
omniORB's makefiles or did you compile it some other way?

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Tahar Ouhrouche
2007-06-23 16:25:52 UTC
Permalink
Hi Duncan, All,
I used Visual Studio 2005 compiler for all of these:

- I compiled the echo example using the omniORB's makefile, it worked.


- I compiled the echo example using the IDE, I followed all the steps
in the readme_win32 carefully, the compilation went ok, but when I try to
run the program under the IDE it crashes. It crashed in both modes, debug
and release. I checked the dlls used carefully to not mix up dll debug and
release modes, all the settings were ok but the problem persists.


Thanks for help,

Cheers,

Tahar
Post by Duncan Grisby
Post by Tahar Ouhrouche
Yes, I tried to debug the CORBA::ORB_init(argc, argv,"omniORB4"); and I
couldn't even step into this function, cuz it's on a Lib I guess. The
error
Post by Tahar Ouhrouche
"First-chance exception at 0x7c90eb74 in TestCORBA.exe: 0xC0000008: An
invalid handle was specified."
First of all, use the latest CVS snapshot.
Second, make sure you are not mixing debug and non-debug code.
When you say the echo example doesn't work, did you compile it with
omniORB's makefiles or did you compile it some other way?
Duncan.
--
-- Duncan Grisby --
-- http://www.grisby.org --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070623/f9f90b77/attachment-0001.htm
Tahar Ouhrouche
2007-06-27 15:48:09 UTC
Permalink
Hi Guys,
I finally resolved this problem. Shame on me! I was getting an exception
just to notify me that an exception was thrown in the omniORB code and
caught!!
just a VS2005 config problem.

Thanks you for all your help.

Cheers,

Tahar
Post by Tahar Ouhrouche
Hi Duncan, All,
- I compiled the echo example using the omniORB's makefile, it worked.
- I compiled the echo example using the IDE, I followed all the
steps in the readme_win32 carefully, the compilation went ok, but when I try
to run the program under the IDE it crashes. It crashed in both modes, debug
and release. I checked the dlls used carefully to not mix up dll debug and
release modes, all the settings were ok but the problem persists.
Thanks for help,
Cheers,
Tahar
Post by Duncan Grisby
Post by Tahar Ouhrouche
Yes, I tried to debug the CORBA::ORB_init(argc, argv,"omniORB4"); and
I
Post by Tahar Ouhrouche
couldn't even step into this function, cuz it's on a Lib I guess. The
error
Post by Tahar Ouhrouche
"First-chance exception at 0x7c90eb74 in TestCORBA.exe: 0xC0000008: An
invalid handle was specified."
First of all, use the latest CVS snapshot.
Second, make sure you are not mixing debug and non-debug code.
When you say the echo example doesn't work, did you compile it with
omniORB's makefiles or did you compile it some other way?
Duncan.
--
-- Duncan Grisby --
-- http://www.grisby.org --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070627/0f99f864/attachment.htm
Loading...