Skip to content

Fuzz testing #1038

@avelure

Description

@avelure

I ran the fuzzing for a week and collected 32 crashing cases.
crashes_cmin.zip
There might be some duplicates in here as there often is different code paths that lead to the same crash.
The log below shows SIGABRT, but you can ignore this as this is because it is neceseary to modify the source to raise a signal to the fuzzer when something interesting occurs. You can see my patch here: https://github.com/avelure/vhdl_fuzz/blob/main/nvc_bug_abort.patch

# find . -maxdepth 1 -type f -exec echo "file: {}" \; -exec /usr/local/bin/nvc --std=08 --ignore-time -a --relaxed --error-limit=1 --psl {} \;
file: ./12dc86da02baf50abcdb2d9777c5ff7f6ef12056c14535fd30c1ad9e50f71411
nvc: ../src/tree.c:587: tree_kind_t tree_kind(tree_t): Assertion `t != NULL' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555573bafa] tree_kind
[0x55555573bafa] ../src/tree.c:655 is_subprogram
[0x55555581302f] /nvc/build/../src/names.c:792 make_visible
             return;   // Ignore ports in component, etc.
-->       else if (is_subprogram(it->container))
             return;   // Do not warn when subprogram parameters hide ports
[0x555555627498] /nvc/build/../src/parse.c:7265 p_variable_declaration
          tree_add_decl(parent, t);
-->       insert_name(nametab, t, it->ident);
          sem_check(t, nametab);
[0x5555556220ba] /nvc/build/../src/parse.c:12936 p_package_body_declarative_item
       case tSHARED:
-->       p_variable_declaration(parent);
          break;
[0x555555620858] p_package_body_declarative_part
[0x555555620858] /nvc/build/../src/parse.c:13064 p_package_body
-->    p_package_body_declarative_part(body);
[0x555555622239] /nvc/build/../src/parse.c:12987 p_package_body_declarative_item
             require_std(STD_08, "nested package declarations");
-->          tree_add_decl(parent, p_package_body(NULL));
          }
[0x555555620858] p_package_body_declarative_part
[0x555555620858] /nvc/build/../src/parse.c:13064 p_package_body
-->    p_package_body_declarative_part(body);
[0x5555556180b3] /nvc/build/../src/parse.c:13098 p_secondary_unit
       case tPACKAGE:
-->       p_package_body(unit);
          break;
[0x555555613593] p_library_unit
[0x555555613593] p_design_unit
[0x555555613593] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./1725b8e09f4abd33a4be1451e6b69e2f56112371ad021eeffd3deb4e2334def1
nvc: ../src/type.c:164: _Bool _type_eq(type_t, type_t, _Bool, hash_t *): Assertion `a != NULL' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x5555556af12c] /nvc/build/../src/type.c:164 _type_eq
    {
-->    assert(a != NULL);
       assert(b != NULL);
[0x555555812e5a] ../src/type.c:264 make_visible
[0x555555630e08] make_visible_slow
[0x555555630e08] insert_name
[0x555555630e08] ../src/names.c:7439 p_alias_declaration
[0x555555637072] p_package_declarative_item
[0x555555637072] p_package_declarative_part
[0x555555637072] /nvc/build/../src/parse.c:8820 p_package_declaration
-->    p_package_declarative_part(pack);
[0x555555615eac] /nvc/build/../src/parse.c:9390 p_primary_unit
          else
-->          p_package_declaration(unit);
          break;
[0x5555556135e3] p_library_unit
[0x5555556135e3] p_design_unit
[0x5555556135e3] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./181a6c3f1ee6985b3b3d3f5b38b8d6f81f5c826a761045cb7740b8d93a753314
nvc: ../src/parse.c:4622: tree_t p_primary(tree_t): Assertion `is_scanned_as_psl()' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555564bc36] /nvc/build/../src/parse.c:4622 p_primary
       case tNONDETV:
-->       assert(is_scanned_as_psl());
          return p_psl_builtin_function_call();
[0x55555564efb9] p_unary_expression
[0x55555564efb9] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fb5f] /nvc/build/../src/parse.c:4798 p_simple_expression
       else
-->       expr = p_term(head);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564e6c3] /nvc/build/../src/parse.c:4893 p_relation
-->    tree_t rel = p_shift_expression(head);
[0x55555564c393] /nvc/build/../src/parse.c:4917 p_expression_with_head
-->    tree_t expr = p_relation(head);
[0x555555668d42] /nvc/build/../src/parse.c:4417 p_element_association
       if (head == NULL && peek() != tOTHERS)
-->       head = p_expression();
[0x55555565028a] ../src/tree.c:0 p_aggregate_or_expression
[0x55555564b03e] /nvc/build/../src/parse.c:4585 p_primary
       case tLPAREN:
-->       return p_aggregate_or_expression();
[0x55555564efb9] p_unary_expression
[0x55555564efb9] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fb5f] /nvc/build/../src/parse.c:4798 p_simple_expression
       else
-->       expr = p_term(head);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564e6c3] /nvc/build/../src/parse.c:4893 p_relation
-->    tree_t rel = p_shift_expression(head);
[0x55555564c393] /nvc/build/../src/parse.c:4917 p_expression_with_head
-->    tree_t expr = p_relation(head);
[0x555555668d42] /nvc/build/../src/parse.c:4417 p_element_association
       if (head == NULL && peek() != tOTHERS)
-->       head = p_expression();
[0x55555565028a] ../src/tree.c:0 p_aggregate_or_expression
[0x55555564b03e] /nvc/build/../src/parse.c:4585 p_primary
       case tLPAREN:
-->       return p_aggregate_or_expression();
[0x55555564efb9] p_unary_expression
[0x55555564efb9] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fb5f] /nvc/build/../src/parse.c:4798 p_simple_expression
       else
-->       expr = p_term(head);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564e6c3] /nvc/build/../src/parse.c:4893 p_relation
-->    tree_t rel = p_shift_expression(head);
[0x55555564c393] /nvc/build/../src/parse.c:4917 p_expression_with_head
-->    tree_t expr = p_relation(head);
[0x555555650149] /nvc/build/../src/parse.c:4476 p_aggregate_or_expression
-->    tree_t head = p_expression();
[0x55555564b03e] /nvc/build/../src/parse.c:4585 p_primary
       case tLPAREN:
-->       return p_aggregate_or_expression();
[0x55555564efb9] p_unary_expression
[0x55555564efb9] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fb5f] /nvc/build/../src/parse.c:4798 p_simple_expression
       else
-->       expr = p_term(head);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564e6c3] /nvc/build/../src/parse.c:4893 p_relation
-->    tree_t rel = p_shift_expression(head);
[0x55555564c393] /nvc/build/../src/parse.c:4917 p_expression_with_head
-->    tree_t expr = p_relation(head);
[0x555555674bf4] p_expression
[0x555555674bf4] /nvc/build/../src/parse.c:5016 p_interface_constant_declaration
       if (optional(tWALRUS)) {
-->       init = p_expression();
          solve_types(nametab, init, type);
[0x55555567053d] /nvc/build/../src/parse.c:0 p_interface_declaration
[0x55555566f88a] p_interface_element
[0x55555566f88a] /nvc/build/../src/parse.c:5844 p_interface_list
-->    p_interface_element(parent, kind, ordered);
[0x555555678ec0] /nvc/build/../src/parse.c:5507 p_formal_parameter_list
-->    p_interface_list(decl, T_PARAM_DECL, standard() >= STD_19);
[0x555555624d43] /nvc/build/../src/parse.c:7107 p_subprogram_specification
       if (has_param_list) {
-->       p_formal_parameter_list(t, type);
          consume(tRPAREN);
[0x55555561b248] /nvc/build/../src/parse.c:9449 p_block_declarative_item
          else {
-->          tree_t spec = p_subprogram_specification();
             if (peek() == tSEMI)
[0x555555618d80] p_architecture_declarative_part
[0x555555618d80] p_architecture_body
[0x555555618d80] /nvc/build/../src/parse.c:13094 p_secondary_unit
       case tARCHITECTURE:
-->       p_architecture_body(unit);
          break;
[0x555555613593] p_library_unit
[0x555555613593] p_design_unit
[0x555555613593] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./209648284096242ef8e489ec9a8c9878d32f790438edcca953a49bd7bf7ad8f4
nvc: ../src/parse.c:4622: tree_t p_primary(tree_t): Assertion `is_scanned_as_psl()' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555564bc36] /nvc/build/../src/parse.c:4622 p_primary
       case tNONDETV:
-->       assert(is_scanned_as_psl());
          return p_psl_builtin_function_call();
[0x55555564efb9] p_unary_expression
[0x55555564efb9] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fb5f] /nvc/build/../src/parse.c:4798 p_simple_expression
       else
-->       expr = p_term(head);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564e6c3] /nvc/build/../src/parse.c:4893 p_relation
-->    tree_t rel = p_shift_expression(head);
[0x55555564c393] /nvc/build/../src/parse.c:4917 p_expression_with_head
-->    tree_t expr = p_relation(head);
[0x555555664bd8] p_actual_part
[0x555555664bd8] /nvc/build/../src/parse.c:3257 p_association_element
-->    tree_t value = p_actual_part(class, kind);
[0x55555568e001] p_association_list
[0x55555568e001] /nvc/build/../src/parse.c:8891 p_port_map_aspect
-->    p_association_list(inst, unit, F_PORT_MAP);
[0x55555568af5f] /nvc/build/../src/parse.c:10655 p_component_instantiation_statement
       if (peek() == tPORT)
-->       p_port_map_aspect(t, entity);
[0x55555561c695] p_concurrent_statement
[0x55555561c695] /nvc/build/../src/parse.c:10946 p_concurrent_statement_or_psl
       else
-->       tree_add_stmt(parent, p_concurrent_statement());
    }
[0x555555618e70] p_architecture_statement_part
[0x555555618e70] p_architecture_body
[0x555555618e70] /nvc/build/../src/parse.c:13094 p_secondary_unit
       case tARCHITECTURE:
-->       p_architecture_body(unit);
          break;
[0x555555613593] p_library_unit
[0x555555613593] p_design_unit
[0x555555613593] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./237dc1fae4aa4449167b52e5af0094718eba6de3b79c3676c1f186fd0589cc85
nvc: ../src/tree.c:587: tree_kind_t tree_kind(tree_t): Assertion `t != NULL' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555573bafa] tree_kind
[0x55555573bafa] ../src/tree.c:655 is_subprogram
[0x55555581302f] /nvc/build/../src/names.c:792 make_visible
             return;   // Ignore ports in component, etc.
-->       else if (is_subprogram(it->container))
             return;   // Do not warn when subprogram parameters hide ports
[0x5555558262cd] /nvc/build/../src/names.c:1038 insert_generics
-->    make_visible(s, name, decl, DIRECT, s);
    }
[0x555555636d58] p_package_header
[0x555555636d58] /nvc/build/../src/parse.c:8818 p_package_declaration
       if (standard() >= STD_08)
-->       p_package_header(pack);
[0x5555556372a2] p_package_declarative_item
[0x5555556372a2] p_package_declarative_part
[0x5555556372a2] /nvc/build/../src/parse.c:8820 p_package_declaration
-->    p_package_declarative_part(pack);
[0x555555615eac] /nvc/build/../src/parse.c:9390 p_primary_unit
          else
-->          p_package_declaration(unit);
          break;
[0x5555556135e3] p_library_unit
[0x5555556135e3] p_design_unit
[0x5555556135e3] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./291f781a7966d1fd9f6d08d2319d1607c2e8eb00bfddfd1934373b86c504926e
nvc: ../src/tree.c:587: tree_kind_t tree_kind(tree_t): Assertion `t != NULL' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555573bafa] tree_kind
[0x55555573bafa] ../src/tree.c:655 is_subprogram
[0x55555581302f] /nvc/build/../src/names.c:792 make_visible
             return;   // Ignore ports in component, etc.
-->       else if (is_subprogram(it->container))
             return;   // Do not warn when subprogram parameters hide ports
[0x5555558262cd] /nvc/build/../src/names.c:1038 insert_generics
-->    make_visible(s, name, decl, DIRECT, s);
    }
[0x555555636d58] p_package_header
[0x555555636d58] /nvc/build/../src/parse.c:8818 p_package_declaration
       if (standard() >= STD_08)
-->       p_package_header(pack);
[0x5555556372a2] p_package_declarative_item
[0x5555556372a2] p_package_declarative_part
[0x5555556372a2] /nvc/build/../src/parse.c:8820 p_package_declaration
-->    p_package_declarative_part(pack);
[0x555555615eac] /nvc/build/../src/parse.c:9390 p_primary_unit
          else
-->          p_package_declaration(unit);
          break;
[0x5555556135e3] p_library_unit
[0x5555556135e3] p_design_unit
[0x5555556135e3] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./2b65ad2cdb69369c35d7d777fd176d371435d69906e9636fcb1799c756dc834e
nvc: ../src/tree.c:587: tree_kind_t tree_kind(tree_t): Assertion `t != NULL' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555573bafa] tree_kind
[0x55555573bafa] ../src/tree.c:655 is_subprogram
[0x55555581302f] /nvc/build/../src/names.c:792 make_visible
             return;   // Ignore ports in component, etc.
-->       else if (is_subprogram(it->container))
             return;   // Do not warn when subprogram parameters hide ports
[0x55555562f4f9] /nvc/build/../src/parse.c:6946 p_constant_declaration
-->       insert_name(nametab, t, it->ident);
          sem_check(t, nametab);
[0x555555636e68] p_package_declarative_item
[0x555555636e68] p_package_declarative_part
[0x555555636e68] /nvc/build/../src/parse.c:8820 p_package_declaration
-->    p_package_declarative_part(pack);
[0x5555556372a2] p_package_declarative_item
[0x5555556372a2] p_package_declarative_part
[0x5555556372a2] /nvc/build/../src/parse.c:8820 p_package_declaration
-->    p_package_declarative_part(pack);
[0x555555615eac] /nvc/build/../src/parse.c:9390 p_primary_unit
          else
-->          p_package_declaration(unit);
          break;
[0x5555556135e3] p_library_unit
[0x5555556135e3] p_design_unit
[0x5555556135e3] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./3d6eaf8db2d6639e23ef48375bf8637db2916b4fa93f1da0af569e929e0ec2a4
nvc: ../src/parse.c:4622: tree_t p_primary(tree_t): Assertion `is_scanned_as_psl()' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555564bc36] /nvc/build/../src/parse.c:4622 p_primary
       case tNONDETV:
-->       assert(is_scanned_as_psl());
          return p_psl_builtin_function_call();
[0x55555564efb9] p_unary_expression
[0x55555564efb9] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fb5f] /nvc/build/../src/parse.c:4798 p_simple_expression
       else
-->       expr = p_term(head);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564e6c3] /nvc/build/../src/parse.c:4893 p_relation
-->    tree_t rel = p_shift_expression(head);
[0x55555564c393] /nvc/build/../src/parse.c:4917 p_expression_with_head
-->    tree_t expr = p_relation(head);
[0x5555556759b4] p_expression
[0x5555556759b4] /nvc/build/../src/parse.c:5132 p_interface_signal_declaration
          if (optional(tWALRUS)) {
-->          init = p_expression();
             solve_types(nametab, init, type);
[0x55555566fb8f] /nvc/build/../src/parse.c:5810 p_interface_declaration
          if (kind == T_PORT_DECL)
-->          p_interface_signal_declaration(parent, kind, ordered);
          else
[0x55555566f953] p_interface_element
[0x55555566f953] /nvc/build/../src/parse.c:5851 p_interface_list
          }
-->       p_interface_element(parent, kind, ordered);
       }
[0x55555568de86] p_port_list
[0x55555568de86] /nvc/build/../src/parse.c:5876 p_port_clause
-->    p_port_list(parent);
[0x555555616cf0] p_entity_header
[0x555555616cf0] p_entity_declaration
[0x555555616cf0] /nvc/build/../src/parse.c:9383 p_primary_unit
       case tENTITY:
-->       p_entity_declaration(unit);
          break;
[0x5555556135e3] p_library_unit
[0x5555556135e3] p_design_unit
[0x5555556135e3] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./3f3d061108d3a7abc82e067554883df795dbce17ade7348fee15e17524275f5b
nvc: ../src/parse.c:4622: tree_t p_primary(tree_t): Assertion `is_scanned_as_psl()' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555564bc36] /nvc/build/../src/parse.c:4622 p_primary
       case tNONDETV:
-->       assert(is_scanned_as_psl());
          return p_psl_builtin_function_call();
[0x55555564efb9] p_unary_expression
[0x55555564efb9] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fb5f] /nvc/build/../src/parse.c:4798 p_simple_expression
       else
-->       expr = p_term(head);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564ea23] /nvc/build/../src/parse.c:1500 p_relation
-->    tree_t right = (*right_fn)(NULL);
       tree_set_loc(expr, CURRENT_LOC);
[0x55555564c393] /nvc/build/../src/parse.c:4917 p_expression_with_head
-->    tree_t expr = p_relation(head);
[0x55555565f0b4] /nvc/build/../src/parse.c:4366 p_choice
       else {
-->       tree_t name = head ?: p_expression();
          const tree_kind_t name_kind = tree_kind(name);
[0x55555565932c] p_choices
[0x55555565932c] p_case_statement_alternative
[0x55555565932c] p_case_statement
[0x55555565932c] /nvc/build/../src/parse.c:10504 p_sequential_statement
       case tCASE:
-->       return p_case_statement(label);
[0x55555562693f] p_sequence_of_statements
[0x55555562693f] /nvc/build/../src/parse.c:8287 p_subprogram_body
-->    p_sequence_of_statements(spec);
[0x55555561b2a6] /nvc/build/../src/parse.c:9453 p_block_declarative_item
             else
-->             tree_add_decl(parent, p_subprogram_body(spec));
          }
[0x555555618d80] p_architecture_declarative_part
[0x555555618d80] p_architecture_body
[0x555555618d80] /nvc/build/../src/parse.c:13094 p_secondary_unit
       case tARCHITECTURE:
-->       p_architecture_body(unit);
          break;
[0x555555613593] p_library_unit
[0x555555613593] p_design_unit
[0x555555613593] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./40a5c50caef74d633f7831cfc4451f713e7ba9f6616d70434e0d1e1f52de0209
nvc: ../src/type.c:111: tree_t tree_array_nth(item_t *, unsigned int): Assertion `(n) < (item->obj_array)->count' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x555555739eca] tree_array_nth
[0x555555739eca] type_enum_literal
[0x555555739eca] ../src/type.c:209 get_enum_lit
[0x5555557447c4] /nvc/build/../src/common.c:2043 subtype_for_string
       if (is_enum)
-->       right = get_enum_lit(str, index_type, iright);
       else
[0x55555582ee19] /nvc/build/../src/names.c:3782 try_solve_string
-->    type_t sub = subtype_for_string(str, type);
       tree_set_type(str, sub);
[0x555555829069] solve_string
[0x555555829069] /nvc/build/../src/names.c:4866 _solve_types
       case T_STRING:
-->       return solve_string(tab, expr);
       case T_REF:
[0x55555582880a] /nvc/build/../src/names.c:4918 solve_types
       type_set_add(tab, constraint, NULL);
-->    type_t type = _solve_types(tab, expr);
       type_set_pop(tab);
[0x55555562f315] /nvc/build/../src/parse.c:6929 p_constant_declaration
          if (standard() < STD_19 || type_is_unconstrained(type))
-->          solve_types(nametab, init, type);
          else
[0x55555561ac32] /nvc/build/../src/parse.c:9439 p_block_declarative_item
       case tCONSTANT:
-->       p_constant_declaration(parent);
          break;
[0x555555618d80] p_architecture_declarative_part
[0x555555618d80] p_architecture_body
[0x555555618d80] /nvc/build/../src/parse.c:13094 p_secondary_unit
       case tARCHITECTURE:
-->       p_architecture_body(unit);
          break;
[0x555555613593] p_library_unit
[0x555555613593] p_design_unit
[0x555555613593] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./47354825eb49e9636e5c14b41152066c063dfb46c47ece41b84eceaef6ebcb87
nvc: ../src/parse.c:4622: tree_t p_primary(tree_t): Assertion `is_scanned_as_psl()' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555564bc36] /nvc/build/../src/parse.c:4622 p_primary
       case tNONDETV:
-->       assert(is_scanned_as_psl());
          return p_psl_builtin_function_call();
[0x55555564efb9] p_unary_expression
[0x55555564efb9] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fb5f] /nvc/build/../src/parse.c:4798 p_simple_expression
       else
-->       expr = p_term(head);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564e6c3] /nvc/build/../src/parse.c:4893 p_relation
-->    tree_t rel = p_shift_expression(head);
[0x55555564c393] /nvc/build/../src/parse.c:4917 p_expression_with_head
-->    tree_t expr = p_relation(head);
[0x555555668d42] /nvc/build/../src/parse.c:4417 p_element_association
       if (head == NULL && peek() != tOTHERS)
-->       head = p_expression();
[0x555555661408] /nvc/build/../src/parse.c:4456 p_aggregate
       do {
-->       p_element_association(t, NULL);
       } while (optional(tCOMMA));
[0x5555556569d0] /nvc/build/../src/parse.c:10526 p_sequential_statement
          {
-->          tree_t agg = p_aggregate();
[0x55555565853e] p_sequence_of_statements
[0x55555565853e] p_loop_statement
[0x55555565853e] /nvc/build/../src/parse.c:10509 p_sequential_statement
       case tFOR:
-->       return p_loop_statement(label);
[0x55555562693f] p_sequence_of_statements
[0x55555562693f] /nvc/build/../src/parse.c:8287 p_subprogram_body
-->    p_sequence_of_statements(spec);
[0x55555562213f] /nvc/build/../src/parse.c:12931 p_package_body_declarative_item
             else
-->             tree_add_decl(parent, p_subprogram_body(spec));
          }
[0x555555620858] p_package_body_declarative_part
[0x555555620858] /nvc/build/../src/parse.c:13064 p_package_body
-->    p_package_body_declarative_part(body);
[0x5555556180b3] /nvc/build/../src/parse.c:13098 p_secondary_unit
       case tPACKAGE:
-->       p_package_body(unit);
          break;
[0x555555613593] p_library_unit
[0x555555613593] p_design_unit
[0x555555613593] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./4788c6e651f9bdbb83fccfa6b861cea794f91ca18db53483e637342df4f2d5d8
nvc: ../src/parse.c:4622: tree_t p_primary(tree_t): Assertion `is_scanned_as_psl()' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555564bc36] /nvc/build/../src/parse.c:4622 p_primary
       case tNONDETV:
-->       assert(is_scanned_as_psl());
          return p_psl_builtin_function_call();
[0x55555564efb9] p_unary_expression
[0x55555564efb9] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fb5f] /nvc/build/../src/parse.c:4798 p_simple_expression
       else
-->       expr = p_term(head);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564e6c3] /nvc/build/../src/parse.c:4893 p_relation
-->    tree_t rel = p_shift_expression(head);
[0x55555564c4e2] /nvc/build/../src/parse.c:1500 p_expression_with_head
-->    tree_t right = (*right_fn)(NULL);
       tree_set_loc(expr, CURRENT_LOC);
[0x555555664bd8] p_actual_part
[0x555555664bd8] /nvc/build/../src/parse.c:3257 p_association_element
-->    tree_t value = p_actual_part(class, kind);
[0x5555556390a1] p_association_list
[0x5555556390a1] /nvc/build/../src/parse.c:8906 p_generic_map_aspect
-->    p_association_list(inst, unit, F_GENERIC_MAP);
[0x55555568af07] /nvc/build/../src/parse.c:10652 p_component_instantiation_statement
       if (peek() == tGENERIC)
-->       p_generic_map_aspect(t, entity);
[0x55555561c695] p_concurrent_statement
[0x55555561c695] /nvc/build/../src/parse.c:10946 p_concurrent_statement_or_psl
       else
-->       tree_add_stmt(parent, p_concurrent_statement());
    }
[0x555555618e70] p_architecture_statement_part
[0x555555618e70] p_architecture_body
[0x555555618e70] /nvc/build/../src/parse.c:13094 p_secondary_unit
       case tARCHITECTURE:
-->       p_architecture_body(unit);
          break;
[0x555555613593] p_library_unit
[0x555555613593] p_design_unit
[0x555555613593] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./4e16949ec326542a03cb8ee829bf5203566412f9579e4450ebf336010a8a64a5
nvc: ../src/parse.c:4622: tree_t p_primary(tree_t): Assertion `is_scanned_as_psl()' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555564bc36] /nvc/build/../src/parse.c:4622 p_primary
       case tNONDETV:
-->       assert(is_scanned_as_psl());
          return p_psl_builtin_function_call();
[0x55555564efb9] p_unary_expression
[0x55555564efb9] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fb5f] /nvc/build/../src/parse.c:4798 p_simple_expression
       else
-->       expr = p_term(head);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564e6c3] /nvc/build/../src/parse.c:4893 p_relation
-->    tree_t rel = p_shift_expression(head);
[0x55555564c393] /nvc/build/../src/parse.c:4917 p_expression_with_head
-->    tree_t expr = p_relation(head);
[0x55555567a779] /nvc/build/../src/parse.c:6817 p_conditional_expression
-->    tree_t expr0 = p_expression();
[0x5555556271e9] /nvc/build/../src/parse.c:7246 p_variable_declaration
       if (optional(tWALRUS)) {
-->       init = p_conditional_expression();
          solve_types(nametab, init, type);
[0x5555556264bf] p_subprogram_declarative_item
[0x5555556264bf] p_subprogram_declarative_part
[0x5555556264bf] /nvc/build/../src/parse.c:8283 p_subprogram_body
-->    p_subprogram_declarative_part(spec);
[0x55555562213f] /nvc/build/../src/parse.c:12931 p_package_body_declarative_item
             else
-->             tree_add_decl(parent, p_subprogram_body(spec));
          }
[0x555555620858] p_package_body_declarative_part
[0x555555620858] /nvc/build/../src/parse.c:13064 p_package_body
-->    p_package_body_declarative_part(body);
[0x5555556180b3] /nvc/build/../src/parse.c:13098 p_secondary_unit
       case tPACKAGE:
-->       p_package_body(unit);
          break;
[0x555555613593] p_library_unit
[0x555555613593] p_design_unit
[0x555555613593] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./5167d85a877bda6ab1f16c5bdaabd10d0770f1fdffce7e8ea975c936ef622fc9
nvc: ../src/tree.c:587: tree_kind_t tree_kind(tree_t): Assertion `t != NULL' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555573bafa] tree_kind
[0x55555573bafa] ../src/tree.c:655 is_subprogram
[0x55555581302f] /nvc/build/../src/names.c:792 make_visible
             return;   // Ignore ports in component, etc.
-->       else if (is_subprogram(it->container))
             return;   // Do not warn when subprogram parameters hide ports
[0x55555562f4f9] /nvc/build/../src/parse.c:6946 p_constant_declaration
-->       insert_name(nametab, t, it->ident);
          sem_check(t, nametab);
[0x555555636e68] p_package_declarative_item
[0x555555636e68] p_package_declarative_part
[0x555555636e68] /nvc/build/../src/parse.c:8820 p_package_declaration
-->    p_package_declarative_part(pack);
[0x555555622357] /nvc/build/../src/parse.c:12991 p_package_body_declarative_item
             require_std(STD_08, "nested package declarations");
-->          tree_add_decl(parent, p_package_declaration(NULL));
          }
[0x555555620858] p_package_body_declarative_part
[0x555555620858] /nvc/build/../src/parse.c:13064 p_package_body
-->    p_package_body_declarative_part(body);
[0x5555556180b3] /nvc/build/../src/parse.c:13098 p_secondary_unit
       case tPACKAGE:
-->       p_package_body(unit);
          break;
[0x555555613593] p_library_unit
[0x555555613593] p_design_unit
[0x555555613593] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./51fa4f1f438bd4398b99ad3f713af0426f7c83c68efc109d6970d0e465dd78ac
nvc: ../src/tree.c:587: tree_kind_t tree_kind(tree_t): Assertion `t != NULL' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555573bafa] tree_kind
[0x55555573bafa] ../src/tree.c:655 is_subprogram
[0x55555581302f] /nvc/build/../src/names.c:792 make_visible
             return;   // Ignore ports in component, etc.
-->       else if (is_subprogram(it->container))
             return;   // Do not warn when subprogram parameters hide ports
[0x5555558262cd] /nvc/build/../src/names.c:1038 insert_generics
-->    make_visible(s, name, decl, DIRECT, s);
    }
[0x555555636d58] p_package_header
[0x555555636d58] /nvc/build/../src/parse.c:8818 p_package_declaration
       if (standard() >= STD_08)
-->       p_package_header(pack);
[0x5555556372a2] p_package_declarative_item
[0x5555556372a2] p_package_declarative_part
[0x5555556372a2] /nvc/build/../src/parse.c:8820 p_package_declaration
-->    p_package_declarative_part(pack);
[0x555555615eac] /nvc/build/../src/parse.c:9390 p_primary_unit
          else
-->          p_package_declaration(unit);
          break;
[0x5555556135e3] p_library_unit
[0x5555556135e3] p_design_unit
[0x5555556135e3] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./52c07ae78c40db41f4206f42bda1a2d7ff7e49219e3cd3e9753bd0f7c431860f
nvc: ../src/tree.c:587: tree_kind_t tree_kind(tree_t): Assertion `t != NULL' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555573bafa] tree_kind
[0x55555573bafa] ../src/tree.c:655 is_subprogram
[0x55555581302f] /nvc/build/../src/names.c:792 make_visible
             return;   // Ignore ports in component, etc.
-->       else if (is_subprogram(it->container))
             return;   // Do not warn when subprogram parameters hide ports
[0x55555562f4f9] /nvc/build/../src/parse.c:6946 p_constant_declaration
-->       insert_name(nametab, t, it->ident);
          sem_check(t, nametab);
[0x555555636e68] p_package_declarative_item
[0x555555636e68] p_package_declarative_part
[0x555555636e68] /nvc/build/../src/parse.c:8820 p_package_declaration
-->    p_package_declarative_part(pack);
[0x5555556372a2] p_package_declarative_item
[0x5555556372a2] p_package_declarative_part
[0x5555556372a2] /nvc/build/../src/parse.c:8820 p_package_declaration
-->    p_package_declarative_part(pack);
[0x555555615eac] /nvc/build/../src/parse.c:9390 p_primary_unit
          else
-->          p_package_declaration(unit);
          break;
[0x5555556135e3] p_library_unit
[0x5555556135e3] p_design_unit
[0x5555556135e3] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./5f97485ea9e89ad928bdf5fffb747446d7d91688ebbe112bce0caa63c9dda2c6
nvc: ../src/parse.c:4622: tree_t p_primary(tree_t): Assertion `is_scanned_as_psl()' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x55555564bc36] /nvc/build/../src/parse.c:4622 p_primary
       case tNONDETV:
-->       assert(is_scanned_as_psl());
          return p_psl_builtin_function_call();
[0x55555564efb9] p_unary_expression
[0x55555564efb9] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fcd8] /nvc/build/../src/parse.c:1500 p_simple_expression
-->    tree_t right = (*right_fn)(NULL);
       tree_set_loc(expr, CURRENT_LOC);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564e6c3] /nvc/build/../src/parse.c:4893 p_relation
-->    tree_t rel = p_shift_expression(head);
[0x55555564c4e2] /nvc/build/../src/parse.c:1500 p_expression_with_head
-->    tree_t right = (*right_fn)(NULL);
       tree_set_loc(expr, CURRENT_LOC);
[0x555555650149] /nvc/build/../src/parse.c:4476 p_aggregate_or_expression
-->    tree_t head = p_expression();
[0x55555564b03e] /nvc/build/../src/parse.c:4585 p_primary
       case tLPAREN:
-->       return p_aggregate_or_expression();
[0x55555564eec0] p_unary_expression
[0x55555564eec0] /nvc/build/../src/parse.c:4704 p_factor
-->    tree_t operand = p_unary_expression(head);
[0x55555564bf73] /nvc/build/../src/parse.c:4743 p_term
-->    tree_t term = p_factor(head);
[0x55555564fb5f] /nvc/build/../src/parse.c:4798 p_simple_expression
       else
-->       expr = p_term(head);
[0x55555564f593] /nvc/build/../src/parse.c:4836 p_shift_expression
-->    tree_t shift = p_simple_expression(head);
[0x55555564e6c3] /nvc/build/../src/parse.c:4893 p_relation
-->    tree_t rel = p_shift_expression(head);
[0x55555564c393] /nvc/build/../src/parse.c:4917 p_expression_with_head
-->    tree_t expr = p_relation(head);
[0x55555565dadd] p_condition
[0x55555565dadd] /nvc/build/../src/parse.c:6971 p_assertion
-->    tree_set_value(s, p_condition());
[0x555555656f57] p_assertion_statement
[0x555555656f57] /nvc/build/../src/parse.c:10489 p_sequential_statement
       case tASSERT:
-->       return p_assertion_statement(label);
[0x555555689c2e] p_sequence_of_statements
[0x555555689c2e] p_process_statement_part
[0x555555689c2e] /nvc/build/../src/parse.c:8483 p_process_statement
-->    p_process_statement_part(t);
[0x55555561d2ff] p_concurrent_statement
[0x55555561d2ff] /nvc/build/../src/parse.c:10946 p_concurrent_statement_or_psl
       else
-->       tree_add_stmt(parent, p_concurrent_statement());
    }
[0x555555618e70] p_architecture_statement_part
[0x555555618e70] p_architecture_body
[0x555555618e70] /nvc/build/../src/parse.c:13094 p_secondary_unit
       case tARCHITECTURE:
-->       p_architecture_body(unit);
          break;
[0x555555613593] p_library_unit
[0x555555613593] p_design_unit
[0x555555613593] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./60bc12eff12e4f7e41dc5499ffb25c74da54d4f78c77d1200d3621e7a8d6ca30
nvc: ../src/common.c:1602: unsigned int get_case_choice_char(tree_t, int): Assertion `tree_kind(decl) == T_CONST_DECL || tree_kind(decl) == T_ALIAS' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x5555557412af] /nvc/build/../src/common.c:1602 get_case_choice_char
             tree_t decl = tree_ref(value);
-->          assert(tree_kind(decl) == T_CONST_DECL || tree_kind(decl) == T_ALIAS);
             assert(tree_has_value(decl));
[0x55555575c562] ../src/common.c:1657 bounds_check_array_case
[0x555555754c87] bounds_check_case
[0x555555754c87] /nvc/build/../src/bounds.c:1412 bounds_visit_fn
       case T_CASE:
-->       bounds_check_case(t);
          break;
[0x555555765051] /nvc/build/../src/object.c:715 object_rewrite
       for (;;) {
-->       object_t *new = (*ctx->post_fn[object->tag])(object, ctx->context);
          if (new == object || (object = object_rewrite(new, ctx)) == NULL)
[0x555555764dfd] /nvc/build/../src/object.c:790 object_rewrite
                      object_t *o = object->items[n].obj_array->items[i];
-->                   if ((o = object_rewrite(o, ctx))) {
                         object_write_barrier(object, o);
[0x555555764dfd] /nvc/build/../src/object.c:790 object_rewrite
                      object_t *o = object->items[n].obj_array->items[i];
-->                   if ((o = object_rewrite(o, ctx))) {
                         object_write_barrier(object, o);
[0x5555556ada40] /nvc/build/../src/tree.c:1310 tree_rewrite
-->    object_t *result = object_rewrite(&(t->object), &ctx);
       free(ctx.cache);
[0x55555574960c] ../src/bounds.c:1447 analyse_file
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6
file: ./725310712b02f458c257a89910b594f20804b03730f0984a88b89b23df2f2311
nvc: ../src/sem.c:3795: _Bool sem_check_array_aggregate(tree_t, nametab_t *): Assertion `akind == A_CONCAT || akind == A_SLICE' failed.

*** Caught signal 6 (SIGABRT) ***

[0x55555560d299] /nvc/build/../src/util.c:875 signal_handler
-->    show_stacktrace();
[0x7ffff0b1351f] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b679fc] (/usr/lib/x86_64-linux-gnu/libc.so.6) pthread_kill
[0x7ffff0b13475] (/usr/lib/x86_64-linux-gnu/libc.so.6) raise
[0x7ffff0af97f2] (/usr/lib/x86_64-linux-gnu/libc.so.6) abort
[0x7ffff0af971a] (/usr/lib/x86_64-linux-gnu/libc.so.6)
[0x7ffff0b0ae95] (/usr/lib/x86_64-linux-gnu/libc.so.6) __assert_fail
[0x5555556cbe2c] sem_check_array_aggregate
[0x5555556cbe2c] /nvc/build/../src/sem.c:3996 sem_check_aggregate
       if (type_is_array(composite_type))
-->       return sem_check_array_aggregate(t, tab);
       else
[0x5555556d0766] /nvc/build/../src/sem.c:2936 sem_check_cond_assign
-->    if (!sem_check(target, tab))
          return false;
[0x55555568c491] /nvc/build/../src/parse.c:10874 p_concurrent_signal_assignment_statement
       if (label) insert_name(nametab, t, NULL);
-->    sem_check(t, nametab);
       return t;
[0x55555561c2ec] p_concurrent_statement
[0x55555561c2ec] /nvc/build/../src/parse.c:10946 p_concurrent_statement_or_psl
       else
-->       tree_add_stmt(parent, p_concurrent_statement());
    }
[0x555555618e70] p_architecture_statement_part
[0x555555618e70] p_architecture_body
[0x555555618e70] /nvc/build/../src/parse.c:13094 p_secondary_unit
       case tARCHITECTURE:
-->       p_architecture_body(unit);
          break;
[0x555555613593] p_library_unit
[0x555555613593] p_design_unit
[0x555555613593] /nvc/build/../src/parse.c:13236 parse
-->    tree_t unit = p_design_unit();
[0x555555749617] /nvc/build/../src/common.c:2468 analyse_file
             tree_t unit;
-->          while (base_errors = error_count(), (unit = parse())) {
                if (error_count() == base_errors) {
[0x5555555eeed7] analyse
[0x5555555eeed7] /nvc/build/../src/nvc.c:2135 process_command
       case 'a':
-->       return analyse(argc, argv, state);
       case 'e':
[0x5555555ec042] /nvc/build/../src/nvc.c:2297 main
-->    const int ret = process_command(argc, argv, &state);
find: '/usr/local/bin/nvc' terminated by signal 6

Second part of log comes in a new comment as there is a comment length limit.

There was also one that causes an input buffer overflow, can't enlarge buffer because scanner uses REJECT, but that might not be so interesting.
input_buffer_overflow.zip

Then there were 5 cases that seem to hang the parser or the parser takes an abnormal long time to complete.
hangs.zip

Currently I'm just using the analyze switch for fuzzing which is a bit slow. I guess I could use the --syntax switch to parse the file, but it is missing some of the analysis switches like --psl, --relaxed and --error-limit, though it seems quite easy to add, so maybe I can make a pullrequest.
Another option is to use persistence mode to loop the parser and just change the input buffer to speed up the testing https://github.com/AFLplusplus/AFLplusplus/blob/stable/instrumentation/README.persistent_mode.md
this also seems feasible in nvc, so I can look at this next.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions