473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Strange Exception Specification Behaviour

Hi all,

I am developing software for Linux Redhat9 and I have noticed some very
strange behaviour when throwing exceptions within a shared library.
All our exceptions are derived from std::exception. We have a base
class which all processes derive from which is always instantiated in
main surrounded by a try/catch(std::exception) which catches all
exceptions that have not be handled at a higher level. The catch block
cleans up and attempts to restart the process. Standard stuff.

During testing however, we noticed that quite a few tasks were crashing
without any error message other than "Aborted" on stdout (or stderr
maybe). During debugging it was found that the abort would occur
directly after a throw from within the shared library.

The strange thing is that the problem **DISAPPEARS** by including an
exception specification for every single method in the hierarchy of
calls from main to where the throw occurs! Does this mean that
exception specifcations are mandatory? No, it can't because by
definition, no exception specification means that a method can throw
anything!

I have tried isolating the problem using a dummy shared lib and a test
harness but it works fine without any exception specification which
suggests they are not mandatory, and that there is something else going
on!

Can anyone offer any insight into this strange behaviour?

Jul 23 '05 #1
2 1936
On 2005-06-07, Paul Drummond <pa***********@dsl.pipex.com> wrote:
The strange thing is that the problem **DISAPPEARS** by including an
exception specification for every single method in the hierarchy of
calls from main to where the throw occurs! Does this mean that
exception specifcations are mandatory? No, it can't because by
definition, no exception specification means that a method can throw
anything!

I have tried isolating the problem using a dummy shared lib and a test
harness but it works fine without any exception specification which
suggests they are not mandatory, and that there is something else going
on!

Can anyone offer any insight into this strange behaviour?


This problem can happen when something in the chain isn't built with
support for exceptions. People have had this problem writing modules
for python, for example. Use google, it's been discussed elsewhere but
not topical here.

Cheers,
--
Donovan Rebbechi
http://pegasus.rutgers.edu/~elflord/
Jul 23 '05 #2
I spent about 2 weeks on and off searching google for a solution to
this. Certain topics were relevant but all suggested solutions have
failed to fix the problem.

How is my problem not topical here? It's a c++ problem is it not? If
not here then where should I post this sort of problem?

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: CoolPint | last post by:
Standard exception classes in C++ have what() which returns const char * and they have constructors accepting string. Where is that string created and when is the string destroyed? In the...
5
by: juergen perlinger | last post by:
Hello out there. sometimes I need to have proper control of the floating point arithmetic of the C(and C++) runtime system, and using the f.p. exception handling of the C99 standard is quite...
2
by: Chris | last post by:
Hi, a strange behaviour when working with exceptions : when I divide and integer by 0 will an exception be thrown. OK but, when I divide a double by 0 is no exception thrown ??? How come ? ...
1
by: Chris | last post by:
Hi, a strange behaviour when working with exceptions : when I divide and integer by 0 will an exception be thrown. OK but, when I divide a double by 0 is no exception thrown ??? How come ? ...
10
by: tborn | last post by:
Hi there, Not sure if any one has experienced this before and can tell me what's wrong with this statement: if verified = false then dataObjects.HasError = true This is all on one line...
13
by: junw2000 | last post by:
Is C++ Exception handling useful? think it is too complicated. What kinds of project need to use it? Thanks.
9
by: Fijoy George | last post by:
Hi all, I am a bit perplexed by the following behaviour of the 'is' comparator False True My understanding was that every literal is a constructure of an object. Thus, the '2.' in 'x = 2.'...
132
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid...
7
by: Keith Halligan | last post by:
I'm a bit unsure about exception specifications and the rules that they enforce. I've had a look at the C++ spec and it doesn't state about the errors that it enforces, if an exception is thrown...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.