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

Long input causes abort #3600

Closed
clayton-shopify opened this Issue Apr 11, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@clayton-shopify
Contributor

clayton-shopify commented Apr 11, 2017

https://hackerone.com/ilsani noticed that supplying a long input to mruby causes an abort():

$ ruby -e 'puts "A"*65535' | bin/mruby
ArgumentError: symbol length too long
Abort trap: 6

Backtrace:

* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007fffbbce8d42 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fffbbdd65bf libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fffbbc4e420 libsystem_c.dylib`abort + 129
    frame #3: 0x000000010006748b mruby`mrb_exc_raise(mrb=0x000061400000a440, exc=mrb_value @ 0x00007fff5fbf6b40) at error.c:310
    frame #4: 0x00000001000678cc mruby`mrb_raise(mrb=0x000061400000a440, c=0x000062f0000071b0, msg="symbol length too long") at error.c:318
    frame #5: 0x000000010013b746 mruby`sym_validate_len(mrb=0x000061400000a440, len=65535) at symbol.c:44
    frame #6: 0x000000010013a199 mruby`sym_intern(mrb=0x000061400000a440, name="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"...) at parse.y:82
    frame #10: 0x000000010027d07f mruby`parser_yylex(p=0x000062800000c120) at parse.y:5450
    frame #11: 0x000000010026bca1 mruby`yylex(lval=0x00007fff5fbf89a0, p=0x000062800000c120) at parse.y:5467
    frame #12: 0x000000010023d8e9 mruby`yyparse(p=0x000062800000c120) at y.tab.c:5584
    frame #13: 0x000000010023c8d0 mruby`mrb_parser_parse(p=0x000062800000c120, c=0x000060600000a040) at parse.y:5528
    frame #14: 0x0000000100267f55 mruby`mrb_parse_file(mrb=0x000061400000a440, f=0x00007fffc4ab40b0, c=0x000060600000a040) at parse.y:5686
    frame #15: 0x000000010026a603 mruby`mrb_load_file_cxt(mrb=0x000061400000a440, f=0x00007fffc4ab40b0, c=0x000060600000a040) at parse.y:5771
    frame #16: 0x00000001000022e7 mruby`main(argc=2, argv=0x00007fff5fbff4f0) at mruby.c:227
    frame #17: 0x00007fffbbbba235 libdyld.dylib`start + 1

@matz matz closed this in 326e043 Apr 12, 2017

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