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

AddressSanitizer: SEGV src/ast/validate.cc:49 in re2c::validate_ast(std::vector<re2c::spec_t, std::allocator<re2c::spec_t> > const&, bool) #227

Closed
fgeek opened this Issue Nov 4, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@fgeek

fgeek commented Nov 4, 2018

Tested commit: c432c5c
Tools: american fuzzy lop 2.52b, afl-utils
re2c-2018-11-04-001.zip

ASAN:DEADLYSIGNAL
=================================================================
==16818==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x5585338c21d4 bp 0x7fff26ad70f0 sp 0x7fff26ad7080 T0)
    #0 0x5585338c21d3 in re2c::validate_ast(std::vector<re2c::spec_t, std::allocator<re2c::spec_t> > const&, bool) src/ast/validate.cc:49
    #1 0x558533823362 in re2c::compile(re2c::Scanner&, re2c::Output&, re2c::Opt&) src/compile.cc:165
    #2 0x55853361c5f9 in main src/main.cc:31
    #3 0x7f5b809ea2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #4 0x55853361d709 in _start (/home/afl/builds/re2c/c432c5c34c60a9e450714a7d1d5c39b34c9fd0a0/bin/re2c+0x1e709)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV src/ast/validate.cc:49 in re2c::validate_ast(std::vector<re2c::spec_t, std::allocator<re2c::spec_t> > const&, bool)
==16818==ABORTING
(gdb) list
44          }
45
46          if (!cflag) {
47              for (i = b; i != e; ++i) {
48                  if (i->name != "") {
49                      fatal_l(i->rules[0].code->fline,
50                          "conditions are only allowed with '-c', '--conditions' option");
51                  }
52              }
53          } else {
@skvadrik

This comment has been minimized.

Owner

skvadrik commented Nov 4, 2018

Confirmed, minimized example is:

/*!re2c
    <c> * {}
*/

skvadrik added a commit that referenced this issue Nov 15, 2018

Fixed segfault cause by out of bounds access.
This fixes bug #227.
Found by american fuzzy lop (thanks to Henri Salo).
@skvadrik

This comment has been minimized.

Owner

skvadrik commented Nov 16, 2018

@fgeek Should be fixed by this commit: e566a24.

@fgeek

This comment has been minimized.

fgeek commented Nov 16, 2018

Confirmed. Thank you!

@fgeek fgeek closed this Nov 16, 2018

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