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

S_scan_heredoc: Assertion `shared' failed (toke.c:9284) #14564

Closed
p5pRT opened this issue Mar 6, 2015 · 8 comments
Labels

Comments

@p5pRT
Copy link
Collaborator

@p5pRT p5pRT commented Mar 6, 2015

Migrated from rt.perl.org#123995 (status was 'resolved')

Searchable as RT123995$

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Mar 6, 2015

From @geeknik

Built v5.21.10 (v5.21.9-73-gd98e5cd) with the following command line​:

./Configure -des -Dusedevel -DDEBUGGING -Dcc=afl-gcc -Doptimize=-O2\ -g && AFL_HARDEN=1 make -j12 test-prep

Bug found with AFL (http​://lcamtuf.coredump.cx/afl)

Valgrind​:
Use of bare << to mean <<"" is deprecated at test18-min line 1.
perl​: toke.c​:9284​: S_scan_heredoc​: Assertion `shared' failed.
Aborted

GDB​:
gdb-peda$ file ~/perl/perl
gdb-peda$ set args test18-min
gdb-peda$ r
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Use of bare << to mean <<"" is deprecated at test18-min line 1.
perl​: toke.c​:9284​: S_scan_heredoc​: Assertion `shared' failed.

Program received signal SIGABRT, Aborted.
[----------------------------------registers-----------------------------------]
RAX​: 0x0
RBX​: 0x7fffffffe63b --> 0x736574006c726570 ('perl')
RCX​: 0xffffffffffffffff
RDX​: 0x6
RSI​: 0x111f
RDI​: 0x111f
RBP​: 0x7ffff6ea9a07 --> 0x257325732500203a ('​: ')
RSP​: 0x7fffffffd848 --> 0x7ffff6d923e0 (<*__GI_abort+384>​: mov rdx,QWORD PTR fs​:0x10)
RIP​: 0x7ffff6d8f165 (<*__GI_raise+53>​: cmp rax,0xfffffffffffff000)
R8 : 0x7ffff7fdd700 (0x00007ffff7fdd700)
R9 : 0x6163735f53203a34 ('4​: S_sca')
R10​: 0x8
R11​: 0x202
R12​: 0xef12e3 --> 0x4500646572616873 ('shared')
R13​: 0xefdd53 ("S_scan_heredoc")
R14​: 0x7ffff6ea9a07 --> 0x257325732500203a ('​: ')
R15​: 0x2444 ('D$')
EFLAGS​: 0x202 (carry parity adjust zero sign trap INTERRUPT direction overflow)
[-------------------------------------code-------------------------------------]
  0x7ffff6d8f15b <*__GI_raise+43>​: movsxd rdi,eax
  0x7ffff6d8f15e <*__GI_raise+46>​: mov eax,0xea
  0x7ffff6d8f163 <*__GI_raise+51>​: syscall
=> 0x7ffff6d8f165 <*__GI_raise+53>​: cmp rax,0xfffffffffffff000
  0x7ffff6d8f16b <*__GI_raise+59>​: ja 0x7ffff6d8f182 <*__GI_raise+82>
  0x7ffff6d8f16d <*__GI_raise+61>​: repz ret
  0x7ffff6d8f16f <*__GI_raise+63>​: nop
  0x7ffff6d8f170 <*__GI_raise+64>​: test eax,eax
[------------------------------------stack-------------------------------------]
0000| 0x7fffffffd848 --> 0x7ffff6d923e0 (<*__GI_abort+384>​: mov rdx,QWORD PTR fs​:0x10)
0008| 0x7fffffffd850 --> 0xef12e3 --> 0x4500646572616873 ('shared')
0016| 0x7fffffffd858 --> 0x7ffff6eab9c1 --> 0x706c6568007325 ('%s')
0024| 0x7fffffffd860 --> 0x7fffffffd880 --> 0x3000000018
0032| 0x7fffffffd868 --> 0x2444 ('D$')
0040| 0x7fffffffd870 --> 0x7fffffffd970 --> 0x7fffffffe63b --> 0x736574006c726570 ('perl')
0048| 0x7fffffffd878 --> 0x7ffff6dc3fe6 (<__fxprintf+310>​: lea rsp,[rbp-0x20])
0056| 0x7fffffffd880 --> 0x3000000018
[------------------------------------------------------------------------------]
Legend​: code, data, rodata, value
Stopped reason​: SIGABRT
0x00007ffff6d8f165 in *__GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c​:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c​: No such file or directory.

Hexdump of 7-byte test case​:
0000000 3b73 7b40 3c3c 003b
0000007

System Info​: Debian 7, Kernel 3.2.65-1+deb7u1 x86_64, GCC 4.9.2, libc 2.13-38+deb7u7

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Mar 6, 2015

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Mar 7, 2015

From @hvds

I thought Father C had fixed this type of thing in [perl #123712] via commits e47d32d and d27f4b9.

It seems to fail only with ';' as the separator though​:

% ./miniperl -ce 's;@​{<<;'
Use of bare << to mean <<"" is deprecated at -e line 1.
miniperl​: toke.c​:9284​: S_scan_heredoc​: Assertion `shared' failed.
Aborted (core dumped)
% ./miniperl -ce 's/@​{<</'
Substitution replacement not terminated at -e line 1.
% ./miniperl -ce 's/@​{<<//'
Use of bare << to mean <<"" is deprecated at -e line 1.
Can't find string terminator "" anywhere before EOF at -e line 1.
%

.. but IIRC we stick a fake ';' on the end of the input, so maybe it is interacting with that somehow.

Hugo

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Mar 7, 2015

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

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Mar 20, 2015

From @cpansprout

On Sat Mar 07 01​:23​:24 2015, hv wrote​:

I thought Father C had fixed this type of thing in [perl #123712] via
commits e47d32d and d27f4b9.

It seems to fail only with ';' as the separator though​:

% ./miniperl -ce 's;@​{<<;'
Use of bare << to mean <<"" is deprecated at -e line 1.
miniperl​: toke.c​:9284​: S_scan_heredoc​: Assertion `shared' failed.
Aborted (core dumped)
% ./miniperl -ce 's/@​{<</'
Substitution replacement not terminated at -e line 1.
% ./miniperl -ce 's/@​{<<//'
Use of bare << to mean <<"" is deprecated at -e line 1.
Can't find string terminator "" anywhere before EOF at -e line 1.
%

.. but IIRC we stick a fake ';' on the end of the input, so maybe it
is interacting with that somehow.

Yes. Your premonition was correct and helped me to fix the bug in b24768f.

--

Father Chrysostomos

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Mar 20, 2015

@cpansprout - Status changed from 'open' to 'pending release'

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 2, 2015

From @khwilliamson

Thank you for submitting this ticket.

The issue should now be resolved with the release today of Perl v5.22, which is available at http​://www.perl.org/get.html
--
Karl Williamson for the Perl 5 team

@p5pRT

This comment has been minimized.

Copy link
Collaborator Author

@p5pRT p5pRT commented Jun 2, 2015

@khwilliamson - Status changed from 'pending release' to 'resolved'

@p5pRT p5pRT closed this Jun 2, 2015
@p5pRT p5pRT added the Severity Low label Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.