-3

I have an exception which its raise command causes stack overflow. I read this article in order to know what should I do: http://www.debuggingexperts.com/modeling-exception-handling

What I understood is the exception 0xc0000025 means attempt to catch an exception which is forbidden to be caught (EXCEPTION_NONCONTINUABLE_EXCEPTION). Am I right?

If so, I wish to know what cause the exception to be defined as non-continuable. The exception is defined in Pascal and derived from Exception object.

In addition, I failed to found where this exception is handled, and added by myself a try-catch block. The exception caught successfully. Why?

EDIT

I want to explain the specific situation I need help:
There is a C++ code which calls Pascal code, which has the exception definition, and raise command happens in it.
Before I put the try-catch block in the C++ code, the raise in Pascal causes 1000 times exception of EXCEPTION_NONCONTINUABLE_EXCEPTION until stack overflowed.
After I added the try-catch block in the C++ code, the raise in Pascal code returned to the catch block in the C++ code.

Now I have 2 questions:

  1. Why process didn't stop on the first NONCONTINUABLE exception?
  2. Why the catch block in C++ code didn't cause this exception?
Aharon
  • 117
  • 1
  • 1
  • 14

1 Answers1

4

You are correct that EXCEPTION_NONCONTINUABLE_EXCEPTION means the program attempted to continue from an exception that isn't continuable. However, it's not possible to define such an exception in Delphi, so the source of your problem is elsewhere.

Consider debugging the creation, raising, catching, and destruction of your custom exception type. If there are external libraries involved in your program, particularly any written in something other than Delphi, make sure they either know what to do with external exceptions, or are shielded entirely from exceptions.

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
  • I edited the question and added questions after you confirmed I right. Can you please answer all the questions I wrote? thanks. – Aharon Mar 12 '13 at 12:58
  • 7
    The nature of your new question is entirely different from your original. No fair changing the question after it's already been answered. Please revert your question and post your new questions separately. When you do, please consider including the minimal code necessary for others to reproduce your problem: show the exception definition, the coffee that calls `raise`, the C++ code that calls the Delphi code, and the try-catch block. – Rob Kennedy Mar 12 '13 at 13:18
  • Why are you so angry with me? All of the edited information I added is written above. **You** didn't answer the last part of the question, and I explained it more specifically. I can't provide the whole code here, and only want to know if this behaviour is familiar to you. – Aharon Mar 13 '13 at 05:18
  • 2
    I'm not angry at all. Yes, I can see what you added, but I'm not interested in it because, as I said, it's irrelevant to the question of what the exception code means and how to define such an exception in Delphi. Furthermore, your additional questions would have me comment on the behavior of code I can't see. Please try to make a minimal test case that reproduces the problem, and them post it as a new question: "Why does this Delphi class lead to unending noncontinuable exceptions in C++?" – Rob Kennedy Mar 13 '13 at 05:57
  • @RobKennedy I understand that you are not familiar with this phenomenon. For me, it ends the discussion here. – Aharon Mar 13 '13 at 06:46