Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

panic: leave_scope inconsistency

by davidfilmer (Acolyte)
on Mar 08, 2014 at 00:21 UTC ( #1077472=perlquestion: print w/replies, xml ) Need Help??
davidfilmer has asked for the wisdom of the Perl Monks concerning the following question:

Masters -

I have a program which is bombing with the message:

panic: leave_scope inconsistency

It indicates a line number, which is inside a recursive subroutine fetching database info (it is the line that recursively calls the sub).

It works fine when the amount of recursion is low, but when many recursive queries must be made, I get this error.

I'm not asking for help with my code - I just want to understand what this error means. It does not appear to be a resource constraint message (as might be expected in recursion - out of memory, etc). Information about this message seems scarce (and old).

I suspect the answer lies in the reference to "leave_scope" - the underline makes me think this might be some internal subroutine in perl. But I wouldn't know where to begin to investigate.

I seek enlightenment.

System: perl 5.12.1 on server-class AIX hardware

Replies are listed 'Best First'.
Re: panic: leave_scope inconsistency
by davido (Archbishop) on Mar 08, 2014 at 02:54 UTC

    You should never be able to get Perl to issue a Panic message using pure-Perl. What XS code is involved?

    (That's not to say it is impossible, but it would indicate a Perl bug. My bet is XS modules.)


Re: panic: leave_scope inconsistency
by kcott (Canon) on Mar 08, 2014 at 01:34 UTC

    G'day davidfilmer,

    If you search for 'panic: leave_scope inconsistency' in perldiag (which lists Perl's diagnostic messages), you'll find one match with a short description.

    If that's not helpful, you'll probably need to provide more information: the guidelines in "How do I post a question effectively?" should give you an idea of what would be useful to post.

    -- Ken

Re: panic: leave_scope inconsistency
by BrowserUk (Pope) on Mar 08, 2014 at 08:31 UTC
    I suspect the answer lies in the reference to "leave_scope" - the underline makes me think this might be some internal subroutine in perl. But I wouldn't know where to begin to investigate.

    See Scope.c:Perl_leave_scope(), the default case.

    In a nutshell, something has been found on the (Perl) stack that has a type value that is not a real type value. That suggests stack corruption, which could come about in many ways.

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1077472]
Approved by kcott
[Corion]: marto: Heh ;) No, you were likely at Tegel or Schönefeld, the new one ("BER") will be somewhat outside of Berlin ;)
[marto]: Corion Schoenfeld, but my friend has been telling me about this new airport for about 7-8 years now :P
[marto]: I doubt it even exists as a building site :P
[ambrus]: Corion: does building airports "somewhat outside of" a city ever work? cities always grow around the airport quickly, because it's practical to be close to it, and after that, people start to complain that the airplanes land so close to their house and sh
[ambrus]: ould keep down the noise

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2017-02-23 12:04 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (346 votes). Check out past polls.