Yeah, next is a recursive call (which in turn calls nextQueued, which
can in turn call next again) so I can see how this could happen. We
may need to redesign this in a non-recursive way so it can better
handle arbitrarily large queues.
--oren
On Jan 19, 2005, at 2:04 PM, Caleb Epstein wrote:
> We had a crash in production today that I believe was caused by a
> stack overflow due to deep recursion by the Session::next and
> ::nextQueued methods.
>
> Basically, a session was disconnected (possibly due to a networking
> outage - still investigating that). Re-establishing the connection
> took long enough that a large backlog of messages built up on both
> sides of the connection. When the connection was re-established, we
> ended up with a large queue of messages, and our process crashed.
>
> I'm attaching the stack trace, which is over 2,600 levels deep! I'm
> pretty sure the stack overflowed.
>
> The process is compiled with optimized code on the Sun C++ compiler,
> so there are function names but no symbols etc in the output. Let me
> know if more info is needed to debug this.
>
> --
> Caleb Epstein
> caleb dot epstein at gmail dot com
> <stacktrace.txt.gz>
|