Menu

#300 Segfault/crash while scoring

0.7.x
closed
5
2014-12-13
2010-01-11
Cary R.
No

While trying to score part of my top level circuit covered segfaults during scoring. Here is the gdb trace.

0 0x080daa79 in vector_rshift_ulong (vec=0x819a828, vall=0xbfd0b3c0, valh=0xbfd0d3c0, lsb=46, msb=137)

at vector.c:1827

1 0x080db124 in vector_part_select_push (tgt=0x8175778, tgt_lsb=0, tgt_msb=22, src=0x819a828, src_lsb=46,

src_msb=137, sign_extend=FALSE) at vector.c:2011

2 0x08087de7 in expression_assign (lhs=0x818eca8, rhs=0x818f048, lsb=0xbfd0f6a8, thr=0x8189450, time=0x8189478,

eval_lhs=TRUE, nb=FALSE) at expr.c:5960

3 0x080882d5 in expression_assign (lhs=0x818ef88, rhs=0x818f048, lsb=0xbfd0f6a8, thr=0x8189450, time=0x8189478,

eval_lhs=TRUE, nb=FALSE) at expr.c:6124

4 0x080882f8 in expression_assign (lhs=0x818ef38, rhs=0x818f048, lsb=0xbfd0f6a8, thr=0x8189450, time=0x8189478,

eval_lhs=TRUE, nb=FALSE) at expr.c:6125

5 0x080882f8 in expression_assign (lhs=0x818ed68, rhs=0x818f048, lsb=0xbfd0f6a8, thr=0x8189450, time=0x8189478,

eval_lhs=TRUE, nb=FALSE) at expr.c:6125

6 0x080882d5 in expression_assign (lhs=0x818ee98, rhs=0x818f048, lsb=0xbfd0f6a8, thr=0x8189450, time=0x8189478,

eval_lhs=TRUE, nb=FALSE) at expr.c:6124

7 0x08085ef8 in expression_op_func__assign (expr=0x818edd8, thr=0x8189450, time=0x81258d8) at expr.c:4684

8 0x080874e9 in expression_operate (expr=0x818edd8, thr=0x8189450, time=0x81258d8) at expr.c:5584

9 0x080c5440 in sim_expression (expr=0x818edd8, thr=0x8189450, time=0x81258d8, lhs=FALSE) at sim.c:985

10 0x080c54c9 in sim_thread (thr=0x8189450, time=0x81258d8) at sim.c:1030

11 0x080c5698 in sim_simulate (time=0x81258d8) at sim.c:1122

12 0x0807b435 in db_do_timestep (time=5819460, final=FALSE) at db.c:3098

13 0x080a45e8 in vcd_callback (lt=0xbfd0f820, pnt_time=0x81b3750, pnt_facidx=0xbfd0f7f0, pnt_value=0x81b62a8)

at lxt.c:93

14 0x080a5521 in lxt2_rd_iter_radix (lt=0x81b3418, b=0x8165148) at lxt2_read.c:357

15 0x080a69e4 in lxt2_rd_process_block (lt=0x81b3418, b=0x8165148) at lxt2_read.c:787

16 0x080a8ca6 in lxt2_rd_iter_blocks (lt=0x81b3418, value_change_callback=0x80a4586 <vcd_callback>,</vcd_callback>

user_callback_data_pointer=0x0) at lxt2_read.c:1768

17 0x080a494a in lxt_parse (lxt_file=0x81601d8 "q1005.lx2") at lxt.c:211

18 0x080b123c in parse_and_score_dumpfile (db=0x8160298 "q1005.cdd", dump_file=0x81601d8 "q1005.lx2", dump_mode=2)

at parse.c:276

19 0x080c34dd in command_score (argc=17, last_arg=1, argv=0xbfd10e54) at score.c:1172

20 0x080a93ef in main (argc=17, argv=0xbfd10e54) at main.c:189

What's interesting about this is that I do not have any vectors the have an lsb of 46 and a msb of 137. the 23 bit tgt look correct. Any thoughts on how to track down what part of the code is causing this so I can submit an appropriate test case would be appreciated. Another interesting point is the only place that I'm using right shifts is in a block that is not currently included in the top level, so I'm quite confused.

Discussion

  • Trevor Williams

    Trevor Williams - 2010-01-12

    Cary,

    The segmentation fault is occurring as a result of an assignment to a concatenation (e.g., "assign {a,b,c} = x;") The assignment is to one of the variables in the upper bits of the assignment. You could find the line of code that is causing the problem by doing the following in gdb:

    frame 8
    display *expr

    This structure will contain a variable called line which will be the line number of the file that the expression exists in. To get the filename (if you are unsure), the following in gdb:

    display *thr->funit->filename

    This will point you to the code that is causing the issue. Perhaps this line of code could simply be isolated. If the code is within a generate statement or contains any parameter information within it, make sure that you retain that in the example. Let me know when I can be of further assistance.

    Thanks,
    Trevor

     
  • Cary R.

    Cary R. - 2010-01-12

    OK, here's a functionally equivalent version of the code that is causing the crash and it appears to be crashing at the same point. FYI when I tried to display the filename I got "." as the name in my real code. I'm guessing that is because the file was included from the current directory (-I .). You may want to look at the filename override when including as well. It's too late for me to do any more debug work!

     
  • Cary R.

    Cary R. - 2010-01-12

    Example bug file, run just like all the other I have provided

     
  • Trevor Williams

    Trevor Williams - 2010-01-13

    Attaching a bug patch for this issue which will be generally available in the 0.7.8 stable release of Covered.

     
  • Trevor Williams

    Trevor Williams - 2010-01-13

    Bug fix patch

     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Log in to post a comment.

MongoDB Logo MongoDB