Skip to content

segfaults on simple invalid formulas #5238

@zhendongsu

Description

@zhendongsu

Commit: 51a4db8
Related to #5224

[522] % z3release t1.smt2 
Segmentation fault
[523] % z3debug t1.smt2 
Segmentation fault
[524] % z3san t1.smt2 
ASAN:DEADLYSIGNAL
=================================================================
==25122==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000004 (pc 0x5566c7d7fcc2 bp 0x7ffd4eddfe60 sp 0x7ffd4eddfd10 T0)
==25122==The signal is caused by a READ memory access.
==25122==Hint: address points to the zero page.
    #0 0x5566c7d7fcc1 in ast::get_kind() const ../src/ast/ast.h:508
    #1 0x5566c7d7fcc1 in is_app(ast const*) ../src/ast/ast.h:921
    #2 0x5566c7d7fcc1 in is_ground(expr const*) ../src/ast/ast.h:1382
    #3 0x5566c7d7fcc1 in smt2::parser::push_local(smt2::parser::local const&) ../src/parsers/smt2/smt2parser.cpp:1738
    #4 0x5566c7da4624 in smt2::parser::pop_app_frame(smt2::parser::app_frame*) ../src/parsers/smt2/smt2parser.cpp:1900
    #5 0x5566c7da4624 in smt2::parser::pop_expr_frame() ../src/parsers/smt2/smt2parser.cpp:2065
    #6 0x5566c7da4624 in smt2::parser::parse_expr() ../src/parsers/smt2/smt2parser.cpp:2101
    #7 0x5566c7dac5f2 in smt2::parser::parse_assert() ../src/parsers/smt2/smt2parser.cpp:2563
    #8 0x5566c7db7297 in smt2::parser::parse_cmd() ../src/parsers/smt2/smt2parser.cpp:2935
    #9 0x5566c7db7297 in smt2::parser::operator()() ../src/parsers/smt2/smt2parser.cpp:3139
    #10 0x5566c7d6c935 in parse_smt2_commands(cmd_context&, std::istream&, bool, params_ref const&, char const*) ../src/parsers/smt2/smt2parser.cpp:3188
    #11 0x5566c50fb96f in read_smtlib2_commands(char const*) ../src/shell/smtlib_frontend.cpp:142
    #12 0x5566c50a6357 in main ../src/shell/main.cpp:372
    #13 0x7ff10c685b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #14 0x5566c50bc109 in _start (/local/suz-local/software/z3san/build-05022021104022-51a4db8/z3+0x206109)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ../src/ast/ast.h:508 in ast::get_kind() const
==25122==ABORTING
[525] % 
[525] % cat t1.smt2 
(assert (let ((a (= 0))) (a true)))
[526] % 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions