Bug #52946 std::bad_alloc execption not caught
Submitted: 19 Apr 2010 15:35 Modified: 12 Nov 2010 14:28
Reporter: Andrew Hutchings Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-6.3 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[19 Apr 2010 15:35] Andrew Hutchings
Description:
When 'new' fails to allocate memory an exception is thrown, this is not always caught so an abort occurs with no clear error to say where the problem lies.

A good example of this is in TransporterRegistry::allocate_send_buffers.  This has an if which is meant to capture a failing 'new' but it will not as an exception is thrown instead.

How to repeat:
.

Suggested fix:
Make failing send buffers alloc either use the same code as the rest of the allocations or capture the exception.
[12 Oct 2010 14:28] Jonas Oreland
This feels like a compile problem,
"configure" wo/ arguments adds "-fno-exceptions"
which makes it impossible to catch exceptions.

How was configure run ?

/Jonas
[12 Oct 2010 19:22] Davi Arnaut
AFAIR, the server (or whatever gets linked with mysys I think) ends up using our implementation of new that does not throw exceptions. This being ndb, ymmv...
[13 Nov 2010 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".