100 levels deep in subroutine calls!

100 levels deep in subroutine calls!

am 19.06.2007 18:32:02 von Peter.Loo

------_=_NextPart_001_01C7B28F.5E590F57
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello Everyone,
=20
I have a large program that loops through approximately 150 rows of data
from an Oracle database using Perl DBI. Within each row of data the
program performs further actions like logging on to a different database
(Netezza using ODBC driver) to gather further information then writing
to yet another database. I am making sure that $sth->finish() and
$dbh->disconnect are being used appropriately where necessary.
Everything seem to be checking out, but at this very same row of data, I
always get a core dump while attempting to logon to the same database to
which I was connecting and disconnecting in the previous steps. So I
turned on the Perl debug to step through the each row. At the very same
row, I get the following error from Perl.
=20
DB<19> c
main::sub_exit(/usr/local/apps/common/devl/bin/GlobalRoutine s.pm:551):
551: print STDERR "***** sub_exit() begins. *****\n\n";
100 levels deep in subroutine calls!
=20
Is this strictly a Perl debug error message or is this a generic Perl
error message? Is there a way around this limitation? I saw something
while searching on the Internet about setting the $DB::deep to a higher
number.
=20
I hope you can shed some light for me.
=20
Thanks.
=20
Peter
=20

------_=_NextPart_001_01C7B28F.5E590F57--

Re: 100 levels deep in subroutine calls!

am 20.06.2007 03:51:24 von matthew.persico

On 6/19/07, Ron Savage wrote:
> Hi Peter
>
> > 100 levels deep in subroutine calls!
> >
> > Is this strictly a Perl debug error message or is this a generic Perl
> > error message? Is there a way around this limitation? I saw something
> > while searching on the Internet about setting the $DB::deep to a higher
> > number.
>
> You can easily test this with a little program which does not use DBI.
> Hence, it's not a DBI, nor a debug, specific problem.
>
> I think you'd best assume it's a bug in your code :-).

Um, maybe not:

DB<6> sub deep { print caller() }

DB<7>deep
main(eval 14)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2

DB<8> sub deep { print caller() ; deep()}

DB<9> deep();
main(eval 16)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main(eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]2main::deep((eval
15)[/opt/perl/lib/5.6.1/perl5db.pl:1521]:2):
2: sub deep { print caller() ; deep()};
100 levels deep in subroutine calls!
DB<<10>>

Furthermore:
perl -e '$i=0; sub deep { print caller(), $i++, "\n" ; deep()};deep()'

continues ad nauswam. Stopped it about 10 seconds in when it got to

main-e1416483

So, the 100 levels is probably a debugger artifact.

FYI:
perl -v

This is perl, v5.6.1 built for sun4-solaris

> --
> Ron Savage
> ron@savage.net.au
>
>


--
Matthew O. Persico