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

Null pointer dereference during rule compilation #21

Closed
dkasak opened this issue Oct 5, 2018 · 1 comment
Closed

Null pointer dereference during rule compilation #21

dkasak opened this issue Oct 5, 2018 · 1 comment

Comments

@dkasak
Copy link

dkasak commented Oct 5, 2018

Problematic input:

shape N{L(=)[]}
shape L(e)

Valgrind report:

==10794== Memcheck, a memory error detector
==10794== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==10794== Using Valgrind-3.14.0.GIT and LibVEX; rerun with -h for copyright info
==10794== Command: cfdg-github 2
==10794== 
==10794== Invalid read of size 8
==10794==    at 0x14A9E7: std::vector<AST::ASTparameter, std::allocator<AST::ASTparameter> >::begin() const (stl_vector.h:708)
==10794==    by 0x1BE213: AST::ASTruleSpecifier::compile(AST::CompilePhase, Builder*) (astexpression.cpp:2658)
==10794==    by 0x1E7FC0: AST::ASTreplacement::compile(AST::CompilePhase, Builder*) (astreplacement.cpp:638)
==10794==    by 0x1E4012: AST::ASTrepContainer::compile(AST::CompilePhase, Builder*, AST::ASTloop*, AST::ASTdefine*) (astreplacement.cpp:111)
==10794==    by 0x1E9BFA: AST::ASTrule::compile(AST::CompilePhase, Builder*) (astreplacement.cpp:974)
==10794==    by 0x1E4012: AST::ASTrepContainer::compile(AST::CompilePhase, Builder*, AST::ASTloop*, AST::ASTdefine*) (astreplacement.cpp:111)
==10794==    by 0x143FEA: CFDGImpl::rulesLoaded() (cfdgimpl.cpp:459)
==10794==    by 0x134EF1: CFDG::ParseFile(char const*, AbstractSystem*, int) (cfdg.cpp:279)
==10794==    by 0x21CDCA: main (main.cpp:454)
==10794==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==10794== 
==10794== 
==10794== Process terminating with default action of signal 11 (SIGSEGV)
==10794==  Access not within mapped region at address 0x0
==10794==    at 0x14A9E7: std::vector<AST::ASTparameter, std::allocator<AST::ASTparameter> >::begin() const (stl_vector.h:708)
==10794==    by 0x1BE213: AST::ASTruleSpecifier::compile(AST::CompilePhase, Builder*) (astexpression.cpp:2658)
==10794==    by 0x1E7FC0: AST::ASTreplacement::compile(AST::CompilePhase, Builder*) (astreplacement.cpp:638)
==10794==    by 0x1E4012: AST::ASTrepContainer::compile(AST::CompilePhase, Builder*, AST::ASTloop*, AST::ASTdefine*) (astreplacement.cpp:111)
==10794==    by 0x1E9BFA: AST::ASTrule::compile(AST::CompilePhase, Builder*) (astreplacement.cpp:974)
==10794==    by 0x1E4012: AST::ASTrepContainer::compile(AST::CompilePhase, Builder*, AST::ASTloop*, AST::ASTdefine*) (astreplacement.cpp:111)
==10794==    by 0x143FEA: CFDGImpl::rulesLoaded() (cfdgimpl.cpp:459)
==10794==    by 0x134EF1: CFDG::ParseFile(char const*, AbstractSystem*, int) (cfdg.cpp:279)
==10794==    by 0x21CDCA: main (main.cpp:454)
==10794==  If you believe this happened as a result of a stack
==10794==  overflow in your program's main thread (unlikely but
==10794==  possible), you can try to increase the size of the
==10794==  main thread stack using the --main-stacksize= flag.
==10794==  The main thread stack size used in this run was 8388608.
==10794== 
==10794== HEAP SUMMARY:
==10794==     in use at exit: 67,530 bytes in 240 blocks
==10794==   total heap usage: 594 allocs, 354 frees, 236,041 bytes allocated
==10794== 
==10794== LEAK SUMMARY:
==10794==    definitely lost: 0 bytes in 0 blocks
==10794==    indirectly lost: 0 bytes in 0 blocks
==10794==      possibly lost: 0 bytes in 0 blocks
==10794==    still reachable: 67,530 bytes in 240 blocks
==10794==         suppressed: 0 bytes in 0 blocks
==10794== Rerun with --leak-check=full to see details of leaked memory
==10794== 
==10794== For counts of detected and suppressed errors, rerun with: -v
==10794== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
MtnViewJohn added a commit that referenced this issue Oct 6, 2018
@MtnViewJohn
Copy link
Owner

Fixed in version 3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants