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

on multi sub named cross #4698

Closed
p6rt opened this issue Oct 31, 2015 · 7 comments
Closed

on multi sub named cross #4698

p6rt opened this issue Oct 31, 2015 · 7 comments
Labels
SEGV Segmentation fault, bus error, etc.

Comments

@p6rt
Copy link

p6rt commented Oct 31, 2015

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

Searchable as RT126508$

@p6rt
Copy link
Author

p6rt commented Oct 31, 2015

From @raydiak

22​:35​:18* raydiak | m​: multi sub cross () {}
22​:35​:19 +camelia | rakudo-moar 36c4c6​: OUTPUT«(signal SEGV)»

gdb backtrace at https://gist.github.com/flussence/fe3f1f829e3947b68d98 courtesy of fluessence++

http://irclog.perlgeek.de/perl6/2015-10-30#i_11459632 through 23​:15

@p6rt
Copy link
Author

p6rt commented Apr 14, 2016

From iteronvexor@gmail.com

This causes segmentation fault​:

perl6 -e "multi sub cross() { }"

This is Rakudo version 2016.03-106-gd847011 built on MoarVM version
2016.03-104-g10d3971
implementing Perl 6.c.

@p6rt
Copy link
Author

p6rt commented Apr 15, 2016

From @nwc10

On Thu, Apr 14, 2016 at 03​:22​:37PM -0700, Caligo Wall wrote​:

This causes segmentation fault​:

perl6 -e "multi sub cross() { }"

Thanks for the report.

It's an interesting failure - ASAN reports an out of bounds read​:

$ ./perl6-m -e "multi sub cross() { }"

==10839==ERROR​: AddressSanitizer​: heap-buffer-overflow on address 0x60300026c138 at pc 0x7f4e04aa7545 bp 0x7fffc486d790 sp 0x7fffc486d788
READ of size 8 at 0x60300026c138 thread T0
  #​0 0x7f4e04aa7544 in get_attribute src/6model/reprs/P6opaque.c​:227
  #​1 0x7f4e0495789f in MVM_interp_run src/core/interp.c​:1955
  #​2 0x7f4e04c33519 in MVM_vm_run_file src/moar.c​:303
  #​3 0x401a4f in main src/main.c​:191
  #​4 0x7f4e0417ed5c in __libc_start_main (/lib64/libc.so.6+0x1ed5c)
  #​5 0x401058 (/home/nicholas/Sandpit/moar-san/bin/moar+0x401058)

0x60300026c138 is located 8 bytes to the left of 24-byte region [0x60300026c140,0x60300026c158)
allocated by thread T0 here​:
  #​0 0x7f4e0555562f in __interceptor_malloc ../../.././libsanitizer/asan/asan_malloc_linux.cc​:72
  #​1 0x7f4e04b36799 in MVM_malloc src/core/alloc.h​:2
  #​2 0x7f4e04b4a09d in deserialize_stable src/6model/serialization.c​:2436
  #​3 0x7f4e04b4be9d in work_loop src/6model/serialization.c​:2597
  #​4 0x7f4e04b4c72f in MVM_serialization_demand_stable src/6model/serialization.c​:2667
  #​5 0x7f4e04b33be1 in MVM_sc_get_stable src/6model/sc.c​:244
  #​6 0x7f4e04b4815d in read_object_table_entry src/6model/serialization.c​:2145
  #​7 0x7f4e04b4da96 in repossess src/6model/serialization.c​:2828
  #​8 0x7f4e04b4ed51 in MVM_serialization_deserialize src/6model/serialization.c​:2986
  #​9 0x7f4e0496e8ea in MVM_interp_run src/core/interp.c​:3003
  #​10 0x7f4e04c33519 in MVM_vm_run_file src/moar.c​:303
  #​11 0x401a4f in main src/main.c​:191
  #​12 0x7f4e0417ed5c in __libc_start_main (/lib64/libc.so.6+0x1ed5c)

SUMMARY​: AddressSanitizer​: heap-buffer-overflow src/6model/reprs/P6opaque.c​:227 get_attribute
Shadow bytes around the buggy address​:
  0x0c06800457d0​: 00 fa fa fa 00 00 00 fa fa fa 00 00 00 00 fa fa
  0x0c06800457e0​: 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 04 fa
  0x0c06800457f0​: fa fa 00 00 00 fa fa fa 00 00 00 00 fa fa 00 00
  0x0c0680045800​: 00 00 fa fa 00 00 00 00 fa fa 00 00 00 fa fa fa
  0x0c0680045810​: 00 00 00 00 fa fa 00 00 00 fa fa fa 00 00 00 fa
=>0x0c0680045820​: fa fa 00 00 00 fa fa[fa]00 00 00 fa fa fa 00 00
  0x0c0680045830​: 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa
  0x0c0680045840​: 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa
  0x0c0680045850​: fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00
  0x0c0680045860​: 00 fa fa fa 00 00 00 fa fa fa 00 00 00 fa fa fa
  0x0c0680045870​: 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes)​:
  Addressable​: 00
  Partially addressable​: 01 02 03 04 05 06 07
  Heap left redzone​: fa
  Heap right redzone​: fb
  Freed heap region​: fd
  Stack left redzone​: f1
  Stack mid redzone​: f2
  Stack right redzone​: f3
  Stack partial redzone​: f4
  Stack after return​: f5
  Stack use after scope​: f8
  Global redzone​: f9
  Global init order​: f6
  Poisoned by user​: f7
  Contiguous container OOB​:fc
  ASan internal​: fe
==10839==ABORTING

[hopefully with formatting fixed]

Nicholas Clark

@p6rt
Copy link
Author

p6rt commented Apr 15, 2016

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

@p6rt
Copy link
Author

p6rt commented Apr 15, 2016

From @timo

On 04/15/2016 09​:36 PM, Nicholas Clark wrote​:

multi sub cross() { }
Here's a gdb backtrace and a moarvm-level backtrace. Value looks a tiny
bit suspicious, though i don't know if there's actually anything wrong
with it.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff78ef0d3 in get_attribute (tc=0x6037c0, st=0xe5a660,
root=0x7ffff6695bd8, data=0x7ffff6695bf0,
  class_handle=0xe5d1a8, name=pointer to '$!dispatchees', hint=5,
result_reg=0x70c648, kind=8)
  at src/6model/reprs/P6opaque.c​:242
242 MVMROOT(tc, value, {
(gdb) print value
$1 = (MVMObject *) 0x2104cc0
(gdb) print value[0]
$2 = {header = {sc_forward_u = {forwarder = 0x0, sc = {sc_idx = 0, idx =
0}, st = 0x0}, owner = 0, flags = 0,
  size = 0}, st = 0x0}
(gdb) print MVM_dump_backtrace(tc)
  at <unknown>​:1
(/home/timo/perl6/install/share/nqp/lib/Perl6/BOOTSTRAP.moarvm​:)
from src/Perl6/World.nqp​:2222
(/home/timo/perl6/install/share/nqp/lib/Perl6/World.moarvm​:derive_dispatcher)
from gen/moar/m-Perl6-Actions.nqp​:3389
(/home/timo/perl6/install/share/nqp/lib/Perl6/Actions.moarvm​:routine_def)
from gen/moar/stage2/QRegex.nqp​:1342
(/home/timo/perl6/install/share/nqp/lib/QRegex.moarvm​:!reduce)
from gen/moar/stage2/QRegex.nqp​:1303
(/home/timo/perl6/install/share/nqp/lib/QRegex.moarvm​:!cursor_pass)
from src/Perl6/Grammar.nqp​:2581
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:routine_def)
from <unknown>​:1
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:routine_declarator​:sym<sub>)
from gen/moar/stage2/QRegex.nqp​:1379
(/home/timo/perl6/install/share/nqp/lib/QRegex.moarvm​:!protoregex)
from <unknown>​:1
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:routine_declarator)
from src/Perl6/Grammar.nqp​:2360
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:declarator)
from src/Perl6/Grammar.nqp​:2374
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:multi_declarator​:sym<multi>)
from gen/moar/stage2/QRegex.nqp​:1379
(/home/timo/perl6/install/share/nqp/lib/QRegex.moarvm​:!protoregex)
from <unknown>​:1
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:multi_declarator)
from <unknown>​:1
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:term​:sym<multi_declarator>)
from gen/moar/stage2/QRegex.nqp​:1379
(/home/timo/perl6/install/share/nqp/lib/QRegex.moarvm​:!protoregex)
from <unknown>​:1
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:term)
from src/Perl6/Grammar.nqp​:3740
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:termish)
from gen/moar/stage2/NQPHLL.nqp​:860
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:EXPR)
from src/Perl6/Grammar.nqp​:3775
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:EXPR)
from src/Perl6/Grammar.nqp​:1232
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:statement)
from src/Perl6/Grammar.nqp​:1161
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:statementlist)
from gen/moar/stage2/NQPHLL.nqp​:1084
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:LANG)
from src/Perl6/Grammar.nqp​:1551
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:FOREIGN_LANG)
from src/Perl6/Grammar.nqp​:1145
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:comp_unit)
from src/Perl6/Grammar.nqp​:448
(/home/timo/perl6/install/share/nqp/lib/Perl6/Grammar.moarvm​:TOP)
from gen/moar/stage2/QRegex.nqp​:2093
(/home/timo/perl6/install/share/nqp/lib/QRegex.moarvm​:parse)
from gen/moar/stage2/NQPHLL.nqp​:1787
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:parse)
from gen/moar/stage2/NQPHLL.nqp​:1743
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:compile)
from gen/moar/stage2/NQPHLL.nqp​:1479
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:eval)
from src/Perl6/Compiler.nqp​:161
(/home/timo/perl6/install/share/nqp/lib/Perl6/Compiler.moarvm​:eval)
from gen/moar/stage2/NQPHLL.nqp​:1587
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:)
from gen/moar/stage2/NQPHLL.nqp​:1584
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:command_eval)
from src/Perl6/Compiler.nqp​:29
(/home/timo/perl6/install/share/nqp/lib/Perl6/Compiler.moarvm​:command_eval)
from gen/moar/stage2/NQPHLL.nqp​:1568
(/home/timo/perl6/install/share/nqp/lib/NQPHLL.moarvm​:command_line)
from gen/moar/m-main.nqp​:37
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:MAIN)
from gen/moar/m-main.nqp​:33
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:<mainline>)
from <unknown>​:1
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:<main>)
from <unknown>​:1
(/home/timo/perl6/install/share/perl6/runtime/perl6.moarvm​:<entry>)
$3 = void
(gdb) bt full
#​0 0x00007ffff78ef0d3 in get_attribute (tc=0x6037c0, st=0xe5a660,
root=0x7ffff6695bd8, data=0x7ffff6695bf0,
  class_handle=0xe5d1a8, name=pointer to '$!dispatchees', hint=5,
result_reg=0x70c648, kind=8)
  at src/6model/reprs/P6opaque.c​:242
  cloned = 0x3cf
  value = 0x2104cc0
  result = 0x0
  attr_st = 0x0
  repr_data = 0x2104b80
  slot = 5

@p6rt
Copy link
Author

p6rt commented Dec 23, 2016

From @zoffixznet

On Fri, 30 Oct 2015 20​:29​:37 -0700, raydiak@​cyberuniverses.com wrote​:

22​:35​:18* raydiak | m​: multi sub cross () {}
22​:35​:19 +camelia | rakudo-moar 36c4c6​: OUTPUT«(signal SEGV)»

gdb backtrace at
https://gist.github.com/flussence/fe3f1f829e3947b68d98 courtesy of
fluessence++

http://irclog.perlgeek.de/perl6/2015-10-30#i_11459632 through 23​:15

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@998a1ef1
Test​: Raku/roast@7cc4622b62

@p6rt
Copy link
Author

p6rt commented Dec 23, 2016

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Dec 23, 2016
@p6rt p6rt added the SEGV Segmentation fault, bus error, etc. label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SEGV Segmentation fault, bus error, etc.
Projects
None yet
Development

No branches or pull requests

1 participant