Forum > LCL

Stack Overflow in RtlVirtualUnwind

(1/3) > >>

simone:
Dear all, I have a strange problem that I can't solve. In a complex gui intensive application, if the user performs a repetitive action for a few seconds (it's a compulsive stress test!), an external stack overflow occurs. There are no obvious classic situations that determine stack overflow (too deep recursion, excessive input size, etc.)

Examining the call stack only the following item emerges:

#0 ntdll:RtlVirtualUnwind+1746 at :0

I realize that the elements I provide are minimal, but maybe someone of you who knows the Windows API better than me could have some intuition.

Thanks in advance.

Martin_fr:
The Unwind is (probably) just called because of some error. E.g. maybe you have an other error somewhere, and it is either covered by an try-except/finally block of yours, or by a try-finally that was automatically generated.

Any Exception on Windows calls that function, which then calls the except or finally handler or some other error handler.

Mind that this may have been called by some error *before* the stack overflew. But the stack was near overflow. Then the overflow happens while the Unwind tried to deal with some other error.
And that includes any error in dll, including the kernel, if any function in such code would trigger an error.

How many entries does the "stack window" (menu: view > debug windows) show?

If it does on show any entries except for ntdll entries, then try in Tools > Option > Debugger to use the gdb debugger.
While FpDebug is better in many things, getting a longer stacktrace is something gdb is still sometimes better.

Application.ProcessMessages can also deep recurse. Just in case...

simone:
Thanks Martin. Your information is valuable.

In the stack window there is only the item indicated above, as shown in the attached screenshot.

Martin_fr:

--- Quote from: simone on September 18, 2024, 02:03:19 pm ---Thanks Martin. Your information is valuable.

In the stack window there is only the item indicated above, as shown in the attached screenshot.

--- End quote ---

And that is the same with GDB?

Thaddy:

--- Quote from: simone on September 18, 2024, 01:04:56 pm ---an external stack overflow occurs.

--- End quote ---
External? What external libraries are you using?
RtlVirtualUnwind can not cause a stack problem on its own.

Navigation

[0] Message Index

[#] Next page

Go to full version