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
[PATCH] lib/perldb5.t fails with TERM=vt100 #13093
Comments
From @ppisarHello, perl-5.18.0 fails perl5db AutoTrace test if environment variable TERM=vt100. -- Petr |
From @ppisarperl-5.18.0-Disable-ornaments-on-perl5db-AutoTrace-tests.patchFrom 27728658b28c256f96dd6e7b5a2de70373d62ff1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 9 Jul 2013 12:25:00 +0200
Subject: [PATCH] Disable ornaments on perl5db AutoTrace tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If TERM=vt100, Term::ReadLine will put ornaments that break the
AutoTrace test:
Failed test 100 - Test the o AutoTrace command at ../lib/perl5db.t line 2302
got 'main::(../lib/perl5db/t/disable-breakpoints-1:2):
2: my $x = "One";
main::(../lib/perl5db/t/disable-breakpoints-1:3):
3: my $dummy = 0;
main::(../lib/perl5db/t/disable-breakpoints-1:5):
5: $x = "FirstVal";
main::(..Debugged program terminated. Use �[1m��q�[0m�� to quit or �[1m��R�[0m�� to restart,
use �[1m��o�[0m�� �[4m��inhibit_exit�[m�� to avoid stopping after program termination,
�[1m��h q�[0m��, �[1m��h R�[0m�� or �[1m��h o�[0m�� to get additional info.
auto(-1) DB<2> q
::(../lib/perl5db/t/disable-breakpoints-1:15):
15: $dummy++;
main::(../lib/perl5db/t/disable-breakpoints-1:17):
17: $x = "FourthVal";
main::(../lib/perl5db/t/disable-breakpoints-1:19):
19: $dummy++;
'
expected /(?^msx:
^main::\([^:]+:15\):\n
15:\s+\$dummy\+\+;\n
main::\([^:]+:17\):\n
17:\s+\$x\ =\ "FourthVal";\n
)/
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
lib/perl5db.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/perl5db.t b/lib/perl5db.t
index 9a57960..186f695 100644
--- a/lib/perl5db.t
+++ b/lib/perl5db.t
@@ -2334,7 +2334,7 @@ sub _calc_trace_wrapper
{
cmds =>
[
- 'o AutoTrace',
+ 'o AutoTrace ornaments=0',
'c',
'q',
],
--
1.8.1.4
|
From @tonycozOn Tue Jul 09 03:52:05 2013, ppisar wrote:
I haven't been able to reproduce this. I thought the fix from #118821 might have fixed it, but I can't Any hints? Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @ppisarOn 2013-07-11, Tony Cook via RT <perlbug-followup@perl.org> wrote:
[...]
The report #118821 fix does not affect this issue. I've just checked it I configured perl this way: $ sh Configure -des -Dusedevel -Dusethreads -Duseithreads -Dldflags="-lm and after building, the test run as: petr@dhcp-0-146:~/perl/perl-git/t $ TERM=vt100 ./perl -I../lib harness still fails for me: # Failed test 102 - Test the o AutoTrace command at ../lib/perl5db.t line 2346 I guess the VT100 ANSI sequences used for the ornaments break UTF-8-ness How does the perl debugger get terminal capabilites. Does the -- Petr |
From @khwilliamsonOn 07/11/2013 01:42 AM, Petr Pisar wrote:
Those ANSI sequences should be entirely ASCII characters, so by |
From @tonycozOn Thu Jul 11 00:43:57 2013, ppisar wrote:
It uses Term::Cap to work out terminal capabilities. On my Debian system I think it falls back to using infocmp -C to fetch Do you get the failure if you build perl with -Dprefix=/somewhere where Perl doesn't include Term::ReadLine::Perl itself, so I assume the test Can you please let me know if changing line 29 from: $ENV{PERL_RL} = 'Perl'; # Suppress system Term::ReadLine::Gnu to $ENV{PERL_RL} = 'Stub'; # Suppress system Term::ReadLine::Gnu prevents the failure? Tony |
From @ppisarOn 2013-07-16, Tony Cook via RT <perlbug-followup@perl.org> wrote:
Yes, the same here. It executes ["infocmp", "-C"] and that opens
Haven't tried yet, but according to strace, it does not open any file in
No, it does not prevent. Maybe my terminfo entry for vt100 is broken $ TERM=vt100 "infocmp" "-C" -- Petr |
From @ppisarOn 2013-07-11, Petr Pisar <ppisar@redhat.com> wrote:
I hooked a Data::Dumper::Dumper() and the problem is the perl debugger Here is TERM=xterm case: "main::(../lib/perl5db/t/disable-breakpoints-1:2):\n2:\tmy \$x = \"One\";\nmain::(../lib/perl5db/t/disable-breakpoints-1:3):\n3:\tmy \$dummy = 0;\nmain::(../lib/perl5db/t/disable-breakpoints-1:5):\n5:\t\$x = \"FirstVal\";\nmain::Debugged program terminated. Use \e[1mq\e[0m to quit or \e[1mR\e[0m to restart,\nuse \e[1mo\e[0m \e[4minhibit_exit\e[24m to avoid stopping after program termination,\n\e[1mh q\e[0m, \e[1mh R\e[0m or \e[1mh o\e[0m to get additional info.\nauto(-1) DB<2> q\n3):\n13:\t\$x = \"ThirdVal\";\nmain::(../lib/perl5db/t/disable-breakpoints-1:15):\n15:\t\$dummy++;\nmain::(../lib/perl5db/t/disable-breakpoints-1:17):\n17:\t\$x = \"FourthVal\";\nmain::(../lib/perl5db/t/disable-breakpoints-1:19):\n19:\t\$dummy++;\n" TERM=vt100 case: "main::(../lib/perl5db/t/disable-breakpoints-1:2):\n2:\tmy \$x = \"One\";\nmain::(../lib/perl5db/t/disable-breakpoints-1:3):\n3:\tmy \$dummy = 0;\nmain::(../lib/perl5db/t/disable-breakpoints-1:5):\n5:\t\$x = \"FirstVal\";\nmain::Debugged program terminated. Use \e[1m\0\0q\e[0m\0\0 to quit or \e[1m\0\0R\e[0m\0\0 to restart,\nuse \e[1m\0\0o\e[0m\0\0 \e[4m\0\0inhibit_exit\e[m\0\0 to avoid stopping after program termination,\n\e[1m\0\0h q\e[0m\0\0, \e[1m\0\0h R\e[0m\0\0 or \e[1m\0\0h o\e[0m\0\0 to get additional info.\nauto(-1) DB<2> q\nain::(../lib/perl5db/t/disable-breakpoints-1:15):\n15:\t\$dummy++;\nmain::(../lib/perl5db/t/disable-breakpoints-1:17):\n17:\t\$x = \"FourthVal\";\nmain::(../lib/perl5db/t/disable-breakpoints-1:19):\n19:\t\$dummy++;\n" The problem is visible even in formated output: $ diff -u xterm.format vt100.format Inline Patch--- xterm.format 2013-07-16 12:33:39.275684102 +0200
+++ vt100.format 2013-07-16 12:33:14.258570730 +0200
@@ -8,9 +8,7 @@
use o inhibit_exit to avoid stopping after program termination,
h q, h R or h o to get additional info.
auto(-1) DB<2> q
-3):
-13: $x = "ThirdVal";
-main::(../lib/perl5db/t/disable-breakpoints-1:15):
+ain::(../lib/perl5db/t/disable-breakpoints-1:15):
15: $dummy++;
main::(../lib/perl5db/t/disable-breakpoints-1:17):
17: $x = "FourthVal";
The same problem can be seen in the Dumper output I quoted above. -- Petr |
From @cpansproutOn Tue Jul 16 03:57:41 2013, ppisar wrote:
This sounds similar to bug #118627. Have you tried a commit more recent -- Father Chrysostomos |
From @ppisarOn 2013-07-16, Father Chrysostomos via RT <perlbug-followup@perl.org> wrote:
I tried latest blead which is after 4e917a0 now and unfotuntelly, -- Petr |
From @cpansproutOn Wed Jul 17 00:08:51 2013, ppisar wrote:
What do you get if you apply the attached patch? Does it give you an (I know the patch makes t/uni/tr_7jis.t fail. I’m looking into that.) -- Father Chrysostomos |
From @cpansproutFrom dbcd50e70a5da2d18b218a69d368faba7ae28647 Mon Sep 17 00:00:00 2001 Inline Patchdiff --git a/toke.c b/toke.c
index 1615cb6..e2c8b85 100644
--- a/toke.c
+++ b/toke.c
@@ -5145,6 +5145,8 @@ Perl_yylex(pTHX)
return yylex();
}
+ /* We really do *not* want PL_linestr ever becoming a COW. */
+ assert (!SvIsCOW(PL_linestr));
s = PL_bufptr;
PL_oldoldbufptr = PL_oldbufptr;
PL_oldbufptr = s; |
From @kevindawsonmy 2d $ TERM=vt100 LD_LIBRARY_PATH=$PWD ./perl -I$PWD/lib utils/prove -l $ TERM=vt100 LD_LIBRARY_PATH=$PWD ./perl -I$PWD/lib -d Loading DB routines from perl5db.pl version 1.42 Enter h or 'h h' for help, or 'man perldebug' for more help. main::(/home/kevin/workspace/p5p/script/term.pl:10): |
From [Unknown Contact. See original ticket]my 2d $ TERM=vt100 LD_LIBRARY_PATH=$PWD ./perl -I$PWD/lib utils/prove -l $ TERM=vt100 LD_LIBRARY_PATH=$PWD ./perl -I$PWD/lib -d Loading DB routines from perl5db.pl version 1.42 Enter h or 'h h' for help, or 'man perldebug' for more help. main::(/home/kevin/workspace/p5p/script/term.pl:10): |
From @tonycozOn Wed Jul 17 00:08:51 2013, ppisar wrote:
I tried reproducing this with blead on Fedora 19 x64 but couldn't. Could you please provide more information about the environment this is happening in? Especially: - the operating system (I assume it's Linux), the distribution and the release of that distribution (if this is Redhat, the closest I can come is CentOS) - the compiler and its version, if it's not the compiler supplied with the distribution. Thanks, |
From @ppisarOn Wed, Jul 17, 2013 at 09:50:49AM -0700, Father Chrysostomos via RT wrote:
[...]
I'm sorry for not devoting to this bug for a long time. I've just tried blead which containts the patch and I cannot see any change. -- Petr |
From @ppisarOn Sun, Nov 17, 2013 at 03:47:56PM -0800, Tony Cook via RT wrote:
Current Fedora 19 on x86_64 with distribution-provided GCC (4.8.2-1). The test still fails with current blead for me. I will try to move the test to -- Petr |
From @ppisarOn Mon, Dec 09, 2013 at 11:14:36AM +0100, Petr Pisar wrote:
I have the same problem in Fedora Rawhide. -- Petr |
From @tonycozOn Mon Dec 09 03:03:03 2013, ppisar wrote:
I've reproduced this on rawhide. This appears to be a bug in the test code or in the debugger. The tests run the debugger with the following options: NonStop=0 TTY=db.out LineInfo=db.out and ends up with two handles both pointing at db.out, one for Neither handle is opened with O_APPEND, so the file positions are In our case, the debugger intro is written to $TTY, then the Once the program is complete, the "Debugged program As to why this is limited to TERM=vt100 - the vt100 terminal Removing the setting of LineInfo allows this test, but several Tony * for various forms of Redhat linux |
From @tonycozOn Mon Dec 09 03:03:03 2013, ppisar wrote:
Please let me know if the attached patch fixes this for you. Tony |
From @tonycoz0001-perl-118817-avoid-using-2-handles-to-write-to-the-de.patchFrom 7b58d7c4e3ad14ac3c60f1ea5d1032205a086e71 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Tue, 14 Jan 2014 09:24:40 +1100
Subject: [perl #118817] avoid using 2 handles to write to the debug output
Previously the tests were run with the following config:
NonStop=0 TTY=db.out LineInfo=db.out
This meant that the debugger would write the prologue, command prompts
and their results and the epilogue to one handle, and any line trace
information to the second handle. Since those handles didn't share
file a file position, the line trace info would overwrite the
prologue, and the epilogue would overwrite part of the line trace
info.
When TTY=vt100 on Redhat systems, this made the epilogue just long
enough to overwrite the line trace data that a test matched against,
causing the test to fail.
To fix this, I avoided setting LineInfo:
NonStop=0 TTY=db.out
and since LineInfo defaults to using the TTY handle, both type of
content are written to db.out *without* overwriting each other.
Unfortunately this broke some other tests, since now the command
prompts which were overwritten by line trace information are mixed in
with the line traces - I've modified the tests that failed to account
for the included command lines.
---
lib/perl5db.t | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/lib/perl5db.t b/lib/perl5db.t
index 17fa744..95d2030 100644
--- a/lib/perl5db.t
+++ b/lib/perl5db.t
@@ -72,7 +72,7 @@ sub _out_contents
rc(
<<'EOF',
-&parse_options("NonStop=0 ReadLine=0 TTY=db.out LineInfo=db.out");
+&parse_options("NonStop=0 ReadLine=0 TTY=db.out");
sub afterinit {
push(@DB::typeahead,
@@ -267,7 +267,7 @@ sub _quote
sub _run {
my $self = shift;
- my $rc = qq{&parse_options("NonStop=0 TTY=db.out LineInfo=db.out");\n};
+ my $rc = qq{&parse_options("NonStop=0 TTY=db.out");\n};
$rc .= join('',
map { "$_\n"}
@@ -1235,6 +1235,7 @@ DebugWrap->new({
$wrapper->contents_like(
qr/
$line_out
+ auto\(-\d+\)\s+DB<\d+>\s+\.\n
$line_out
/msx,
'Test the "." command',
@@ -2380,6 +2381,10 @@ DebugWrap->new({
$wrapper->contents_like(qr/
^main::\([^:]+:28\):\n
28:\s+myfunc\(\);\n
+ auto\(-\d+\)\s+DB<1>\s+t\n
+ Trace\ =\ on\n
+ auto\(-\d+\)\s+DB<1>\s+b\ 18\n
+ auto\(-\d+\)\s+DB<2>\s+c\n
main::myfunc\([^:]+:25\):\n
25:\s+bar\(\);\n
/msx,
@@ -2407,10 +2412,14 @@ DebugWrap->new({
$wrapper->contents_like(qr/
^main::\([^:]+:28\):\n
28:\s+myfunc\(\);\n
+ auto\(-\d+\)\s+DB<1>\s+o\ AutoTrace\n
+ \s+AutoTrace\s+=\s+'1'\n
+ auto\(-\d+\)\s+DB<2>\s+b\ 18\n
+ auto\(-\d+\)\s+DB<3>\s+c\n
main::myfunc\([^:]+:25\):\n
25:\s+bar\(\);\n
/msx,
- 'Test the t command with function calls.',
+ 'Test the o AutoTrace command with function calls.',
);
}
--
1.8.5.2
|
From @ppisarOn Mon, Jan 13, 2014 at 03:40:23PM -0800, Tony Cook via RT wrote:
Yes, I confirm it works for me. Thank you. -- Petr |
From @craigberryOn Tue, Jan 14, 2014 at 5:19 AM, Petr Pisar <ppisar@redhat.com> wrote:
FWIW this gets the number of failures in this test on VMS from 14 down |
From @tonycozOn Tue Jan 14 03:20:24 2014, ppisar wrote:
Applied to blead in 24fc4d4. Thanks for your help. Tony |
@tonycoz - Status changed from 'open' to 'resolved' |
From @tonycozOn Tue Jan 14 06:17:30 2014, craig.a.berry@gmail.com wrote:
Can you please run: ./perl -Ilib lib/perl5db.t and open a new ticket? If it's just newline matches (which wouldn't surprise me, from what little Tony |
From @craigberryOn Tue, Jan 14, 2014 at 4:03 PM, Tony Cook via RT
Now done as [perl #121081] . |
Migrated from rt.perl.org#118817 (status was 'resolved')
Searchable as RT118817$
The text was updated successfully, but these errors were encountered: