"END failed" -- but why?

M

Matthias Urlichs

One of my programs exits with these lines, after its last line has
executed:

Use of uninitialized value in null operation, <F> line 1796.
Undefined subroutine &main:: called, <F> line 1796.
END failed--call queue aborted at tools/mig.strings line 1, <F> line 1796.

Well, that's helpful. :-/
Any ideas on how to figure out *where* and *why* that happens would be
greatly appreciated.

--
Matthias Urlichs | {M:U} IT Design @ m-u-it.de | (e-mail address removed)
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
- -
Diplomacy is to do and say, the nastiest thing in the nicest way.
-- Balfour
 
C

Chris

Matthias said:
One of my programs exits with these lines, after its last line has
executed:

Use of uninitialized value in null operation, <F> line 1796.
Undefined subroutine &main:: called, <F> line 1796.
END failed--call queue aborted at tools/mig.strings line 1, <F> line 1796.

Well, that's helpful. :-/
Any ideas on how to figure out *where* and *why* that happens would be
greatly appreciated.

Are you able to reproduce it in a smaller script (less than 1800 lines)?
If not, can you post your END block(s)?

-chris
 
A

Anno Siegel

Chris said:
Are you able to reproduce it in a smaller script (less than 1800 lines)?
If not, can you post your END block(s)?

"<F> line 1796" refers to a file opened by the program. The only
source line referenced is line 1, but I would take that with a grain
of salt.

Anno
 
P

Paul Lalli

Matthias said:
One of my programs exits with these lines, after its last line has
executed:

Use of uninitialized value in null operation, <F> line 1796.
Undefined subroutine &main:: called, <F> line 1796.
END failed--call queue aborted at tools/mig.strings line 1, <F> line 1796.

Are those the actual error messages, or did you replace the actual name
Well, that's helpful. :-/
Any ideas on how to figure out *where* and *why* that happens would be
greatly appreciated.

If <F> is your placeholder for your sourcecode file, I would start by
looking at line 1796 of your source. If the error message actually
does say <F>, I would look at line 1796 of the input file. Somewhere
along the line, you're attempting to call a function with a blank name.


My completely random guess is that the last line of your input file is
blank, but your program doesn't take this into account, and that you're
attempting to process a blank line as though it has data - which would
lead to the uninitialzed value errors and the undefined and unnamed
subroutine being called.

Paul Lalli
 
X

xhoster

Matthias Urlichs said:
One of my programs exits with these lines, after its last line has
executed:

What modules are you using in your script?

Use of uninitialized value in null operation, <F> line 1796.
Undefined subroutine &main:: called, <F> line 1796.
END failed--call queue aborted at tools/mig.strings line 1, <F> line
1796.

Do you have any END blocks in your script? Do you actually open a
filehandle named F?
Well, that's helpful. :-/
Any ideas on how to figure out *where* and *why* that happens would be
greatly appreciated.

Xho
 
M

Matthias Urlichs

"<F> line 1796" refers to a file opened by the program. The only source
line referenced is line 1, but I would take that with a grain of salt.

A large grain. In fact, make that a mid-sized boulder.

Here's what happens when I run it under "debugperl -DtlsDvv":

[ lots of output ]
(tools/mig.strings:219) print
This is the last line of mig.strings, my main code

STACK 0: MAIN
CX 0: BLOCK => SV_YES

(tools/mig.strings:219) leave
(tools/mig.strings:0) POPBLOCK scope 2 at pp_hot.c:1800
Leaving block 0, type BLOCK
(tools/mig.strings:0) LEAVE scope 2 at pp_hot.c:1837
(tools/mig.strings:0) LEAVE scope 1 at perl.c:2257
(tools/mig.strings:0) Setting up jumplevel bffe8770, was bffe8bb0
(tools/mig.strings:0) ENTER scope 1 at perl.c:2126
(tools/mig.strings:0) ENTER scope 2 at perl.c:2176
Entering block 0, type EVAL
(tools/mig.strings:0) Setting up jumplevel bffe85d0, was bffe8770
Use of uninitialized value in null operation, <F> line 1796.
(tools/mig.strings:0) ENTER scope 3 at pp_hot.c:2624
(tools/mig.strings:0) (Found eval #0)
(tools/mig.strings:0) POPBLOCK scope 2 at pp_ctl.c:1361
Leaving block 0, type EVAL
(tools/mig.strings:0) LEAVE scope 2 at pp_ctl.c:1375
(tools/mig.strings:0) LEAVE scope 1 at perl.c:2257
Undefined subroutine &main:: called, <F> line 1796.
END failed--call queue aborted at tools/mig.strings line 1, <F> line 1796.

<F> is of course the file I was reading in my main code.
Line 1 is a no-argument #!/usr/bin/perl line.

The main code doesn't use any END blocks. One of my modules does use END,
but (I just added print statements to it) the problem occurs before that
END block is called...


Anyway, I just found the trigger for this problem. The script is using
autoloaded code. A load failure (file not found) results in a non-local
GOTO. Apparently Perl's support for these is still somewhat buggy.

I'll check whether the problem goes away if I replace the GOTO with a
die/eval combo, but historically that hasn't worked at all well either.
(In fact it was worse in the past, which is why my current code tries
not to use it.)

I'll also have to prepare a nice small testcase for this, but I'm afraid
it simply runs afoul of similar cross-namespace call issue perlbug #24589
hits, just in the other direction...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,081
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top