Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in preamble code report line 0 #13261

Open
p5pRT opened this issue Sep 15, 2013 · 10 comments
Open

Errors in preamble code report line 0 #13261

p5pRT opened this issue Sep 15, 2013 · 10 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 15, 2013

Migrated from rt.perl.org#119805 (status was 'open')

Searchable as RT119805$

@p5pRT
Copy link
Author

p5pRT commented Sep 15, 2013

From @cpansprout

Should this be saying line 0?

$ PERL5DB='@​_=~s/l//' perl -de0
Can't modify array dereference in substitution (s///) at -e line 0, near "s/l//;"
Execution of -e aborted due to compilation errors.

Some errors do that (those that go through yyerror); others simply use
a dot​:

$ PERL5DB='s/l/' perl -de0
Substitution replacement not terminated.

$ PERL5DB=die perl -de0
Died.

Should yyerror suppress the line number if it is 0, the way mess_sv does?


Flags​:
  category=core
  severity=low


Site configuration information for perl 5.19.4​:

Configured by sprout at Mon Sep 9 00​:16​:24 PDT 2013.

Summary of my perl5 (revision 5 version 19 subversion 4) configuration​:
  Commit id​: d47819ff6f55bfaa4b7eddc66c6db7d7dfdec11c
  Platform​:
  osname=darwin, osvers=12.2.0, archname=darwin-2level
  uname='darwin pint.local 12.2.0 darwin kernel version 12.2.0​: sat aug 25 00​:48​:52 pdt 2012; root​:xnu-2050.18.24~1release_x86_64 x86_64 '
  config_args='-de -Dcc=gcc -Dusedevel -Doptimize=-ggdb3 -Aoptimize=-O0 -DDEBUGGING'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='gcc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include',
  optimize='-ggdb3 -O0',
  cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /usr/lib
  libs=-ldbm -ldl -lm -lutil -lc
  perllibs=-ldl -lm -lutil -lc
  libc=, so=dylib, useshrplib=false, libperl=libperl.a
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'


@​INC for perl 5.19.4​:
  lib
  /usr/local/lib/perl5/site_perl/5.19.4/darwin-2level
  /usr/local/lib/perl5/site_perl/5.19.4
  /usr/local/lib/perl5/5.19.4/darwin-2level
  /usr/local/lib/perl5/5.19.4
  /usr/local/lib/perl5/site_perl
  .


Environment for perl 5.19.4​:
  DYLD_LIBRARY_PATH (unset)
  HOME=/Users/sprout
  LANG=en_US.UTF-8
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/usr/bin​:/bin​:/usr/sbin​:/sbin​:/usr/local/bin​:/usr/local/bin
  PERL_BADLANG (unset)
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Sep 16, 2013

From @nwc10

On Sun, Sep 15, 2013 at 01​:16​:13PM -0700, Father Chrysostomos wrote​:

Should this be saying line 0?

$ PERL5DB='@​_=~s/l//' perl -de0
Can't modify array dereference in substitution (s///) at -e line 0, near "s/l//;"
Execution of -e aborted due to compilation errors.

Some errors do that (those that go through yyerror); others simply use
a dot​:

$ PERL5DB='s/l/' perl -de0
Substitution replacement not terminated.

$ PERL5DB=die perl -de0
Died.

Should yyerror suppress the line number if it is 0, the way mess_sv does?

I think so. I can't think of a reason why not. "line 0" isn't exactly helpful.

Nicholas Clark

@p5pRT
Copy link
Author

p5pRT commented Sep 16, 2013

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Sep 16, 2013

From @wolfsage

On Mon, Sep 16, 2013 at 9​:56 AM, Nicholas Clark <nick@​ccl4.org> wrote​:

On Sun, Sep 15, 2013 at 01​:16​:13PM -0700, Father Chrysostomos wrote​:

Should this be saying line 0?

$ PERL5DB='@​_=~s/l//' perl -de0
Can't modify array dereference in substitution (s///) at -e line 0, near "s/l//;"
Execution of -e aborted due to compilation errors.

Some errors do that (those that go through yyerror); others simply use
a dot​:

$ PERL5DB='s/l/' perl -de0
Substitution replacement not terminated.

$ PERL5DB=die perl -de0
Died.

Should yyerror suppress the line number if it is 0, the way mess_sv does?

I think so. I can't think of a reason why not. "line 0" isn't exactly helpful.

Actually, is there some way we could make this more helpful?

$ export PERL5DB='s/l/'

(a few hours and a few beers later)

$ perl -de 'print "hi";'
Substitution replacement not terminated.

This error without any context is woefully unhelpful. I guess one
could surmise that since there's no line number it must (must it?) be
from the environment?

-- Matthew Horsfall (alh)

@p5pRT
Copy link
Author

p5pRT commented Sep 16, 2013

From @Hugmeir

On Sun, Sep 15, 2013 at 5​:16 PM, Father Chrysostomos <
perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Father Chrysostomos
# Please include the string​: [perl #119805]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=119805 >

Should this be saying line 0?

$ PERL5DB='@​_=~s/l//' perl -de0
Can't modify array dereference in substitution (s///) at -e line 0, near
"s/l//;"
Execution of -e aborted due to compilation errors.

Some errors do that (those that go through yyerror); others simply use
a dot​:

$ PERL5DB='s/l/' perl -de0
Substitution replacement not terminated.

$ PERL5DB=die perl -de0
Died.

Should yyerror suppress the line number if it is 0, the way mess_sv does?

How about making preamble code do this​:

#file preamble
#line 0
[preamble here]

which would make these easier to spot? I've been bitten by the lack of an
error location recently (while abusing preambles to do some glue magic in
pure-perl android apps).

@p5pRT
Copy link
Author

p5pRT commented Sep 16, 2013

From @cpansprout

On Mon Sep 16 09​:56​:01 2013, Hugmeir wrote​:

On Sun, Sep 15, 2013 at 5​:16 PM, Father Chrysostomos <
perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Father Chrysostomos
# Please include the string​: [perl #119805]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=119805 >

Should this be saying line 0?

$ PERL5DB='@​_=~s/l//' perl -de0
Can't modify array dereference in substitution (s///) at -e line 0, near
"s/l//;"
Execution of -e aborted due to compilation errors.

Some errors do that (those that go through yyerror); others simply use
a dot​:

$ PERL5DB='s/l/' perl -de0
Substitution replacement not terminated.

$ PERL5DB=die perl -de0
Died.

Should yyerror suppress the line number if it is 0, the way mess_sv
does?

How about making preamble code do this​:

#file preamble
#line 0
[preamble here]

which would make these easier to spot? I've been bitten by the lack of an
error location recently (while abusing preambles to do some glue magic in
pure-perl android apps).

Or we could special-case line 0 to say ‘in preamble’, which sounds
better than ‘at preamble line 0’ or ‘at preamble’.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Sep 16, 2013

From [Unknown Contact. See original ticket]

On Mon Sep 16 09​:56​:01 2013, Hugmeir wrote​:

On Sun, Sep 15, 2013 at 5​:16 PM, Father Chrysostomos <
perlbug-followup@​perl.org> wrote​:

# New Ticket Created by Father Chrysostomos
# Please include the string​: [perl #119805]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=119805 >

Should this be saying line 0?

$ PERL5DB='@​_=~s/l//' perl -de0
Can't modify array dereference in substitution (s///) at -e line 0, near
"s/l//;"
Execution of -e aborted due to compilation errors.

Some errors do that (those that go through yyerror); others simply use
a dot​:

$ PERL5DB='s/l/' perl -de0
Substitution replacement not terminated.

$ PERL5DB=die perl -de0
Died.

Should yyerror suppress the line number if it is 0, the way mess_sv
does?

How about making preamble code do this​:

#file preamble
#line 0
[preamble here]

which would make these easier to spot? I've been bitten by the lack of an
error location recently (while abusing preambles to do some glue magic in
pure-perl android apps).

Or we could special-case line 0 to say ‘in preamble’, which sounds
better than ‘at preamble line 0’ or ‘at preamble’.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Sep 16, 2013

From @rjbs

* Father Chrysostomos via RT <perlbug-comment@​perl.org> [2013-09-16T12​:59​:00]

Or we could special-case line 0 to say ‘in preamble’, which sounds
better than ‘at preamble line 0’ or ‘at preamble’.

Yes, this would be good.

--
rjbs

@p5pRT
Copy link
Author

p5pRT commented Oct 29, 2013

From @cpansprout

On Mon Sep 16 15​:42​:03 2013, perl.p5p@​rjbs.manxome.org wrote​:

* Father Chrysostomos via RT <perlbug-comment@​perl.org> [2013-09-
16T12​:59​:00]

Or we could special-case line 0 to say ‘in preamble’, which sounds
better than ‘at preamble line 0’ or ‘at preamble’.

Yes, this would be good.

Simply tacking on ‘in preamble’ when the line number is 0 is not so helpful. My first attempt at this gives the following​:

$ ./perl -b
Unrecognized switch​: -b (-h will show valid options) in preamble.

That’s just weird.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Oct 29, 2013

From [Unknown Contact. See original ticket]

On Mon Sep 16 15​:42​:03 2013, perl.p5p@​rjbs.manxome.org wrote​:

* Father Chrysostomos via RT <perlbug-comment@​perl.org> [2013-09-
16T12​:59​:00]

Or we could special-case line 0 to say ‘in preamble’, which sounds
better than ‘at preamble line 0’ or ‘at preamble’.

Yes, this would be good.

Simply tacking on ‘in preamble’ when the line number is 0 is not so helpful. My first attempt at this gives the following​:

$ ./perl -b
Unrecognized switch​: -b (-h will show valid options) in preamble.

That’s just weird.

--

Father Chrysostomos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants