# Fatal: (SIGSEGV) Bad handle or reference at the definition of coverpoint

**URL:** <https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369>\
**Category:** UVM\
**Tags:** UVM, SIGSEGV, Bad-handle\
**Created:** [February 16, 2015, 8:58am UTC](https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369 "2015-02-16T08:58:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vkantamn](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/7c8e57/32.png) [@vkantamn](https://verificationacademy.com/forums/u/vkantamn)\
**Post date:** [February 16, 2015, 8:58am UTC](https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369/1 "2015-02-16T08:58:08Z")

</div>

Dear all,

I am confused with the following error: Fatal: (SIGSEGV) Bad handle or reference.

This error directs me to the line where I define the coverpoint.

covergroup reset\_coverage (ref reset\_seq\_item item);

rst\_cp: coverpoint item.rstn { // error seems to be here  
option.at\_least = 3;  
bins low = {0};  
bins high = {1};  
bins others = default;  
}

endgroup : reset\_coverage

Any help will be appreciated.

Thank you.  
Best regards,  
vkantamn

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [February 16, 2015, 9:50pm UTC](https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369/2 "2015-02-16T21:50:14Z")

</div>

This looks like a run time error - there should be more information in the error message, like a call stack trace. Most likely you failed to construct the covergroup before calling sample().

---

<div class="post-metadata">

**Author:** ![vkantamn](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/7c8e57/32.png) [@vkantamn](https://verificationacademy.com/forums/u/vkantamn)\
**Post date:** [February 17, 2015, 8:46am UTC](https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369/3 "2015-02-17T08:46:12Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369/2):_

Hello Dave,

the stack trace says:

HDL call sequence:  
stopped at ./some\_path/RESET\_IF\_coverage.svh 31 Function sample

This is exactly where I defined the coverpoint. Coming to the contructor of the covergroup, I see, I did it in the coverage class.

class coverage extends uvm\_subscriber #(item);  
uvm\_component\_utils macro

item item\_inst;  
reset\_coverage cov\_group;

function new (string name, uvm\_component p);  
super.new(name, p);  
item\_inst = new();  
cov\_group = new(item\_inst);  
endfunction

function void write (input item t);  
item\_inst = t;  
cov\_group.sample();  
endfunction

endclass

Any suggestions please?

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [February 17, 2015, 4:45pm UTC](https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369/4 "2015-02-17T16:45:00Z")

</div>

_In reply to [vkantamn](https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369/3):_

There should be more information that that one line of error message you showed. There is normally information about the process that the segfault was executing on.

If you can runt interactively, use the tb command after the simulation halts.

---

<div class="post-metadata">

**Author:** ![vkantamn](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/v/7c8e57/32.png) [@vkantamn](https://verificationacademy.com/forums/u/vkantamn)\
**Post date:** [February 18, 2015, 9:37am UTC](https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369/5 "2015-02-18T09:37:43Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369/4):_

Dave,

thank you very much for your follow-up and inevitable support. I sincerely appreciate this. I am adding entire log for your reference.

* * *

# UVM\_INFO verilog\_src/questa\_uvm\_pkg-1.2/src/questa\_uvm\_pkg.sv(217) @ 0: reporter [Questa UVM] questa\_uvm::init(+struct)

# \*\* Warning: NUMERIC\_STD.“=”: metavalue detected, returning FALSE

# Time: 0 ns Iteration: 0 Instance: /filter\_verify\_top/DUT\_wrapper/filter\_seqeuencer\_dut\_e\_i

# \*\* Warning: NUMERIC\_STD.“=”: metavalue detected, returning FALSE

# Time: 0 ns Iteration: 0 Instance: /filter\_verify\_top/DUT\_wrapper/filter\_seqeuencer\_dut\_e\_i

# UVM\_INFO @ 0: reporter [RNTST] Running test test\_filter\_001…

# \*\* Warning: NUMERIC\_STD.“=”: metavalue detected, returning FALSE

# Time: 0 ns Iteration: 1 Instance: /filter\_verify\_top/DUT\_wrapper/filter\_seqeuencer\_dut\_e\_i

# \*\* Warning: NUMERIC\_STD.“=”: metavalue detected, returning FALSE

# Time: 0 ns Iteration: 1 Instance: /filter\_verify\_top/DUT\_wrapper/filter\_seqeuencer\_dut\_e\_i

# UVM\_WARNING ./FILTER\_VERIFY\_tb/sv/filter\_verify\_sb/sv//filter\_verify\_sb\_env.svh(49) @ 0: uvm\_test\_top.tb\_env.sb [CFG] Configuration object not initialized from outside. Generating one internally

# UVM\_INFO ./FILTER\_VERIFY\_tb/sv/filter\_verify\_tests/sv//filter\_test\_001.svh(27) @ 0: uvm\_test\_top.tb\_env.virtual\_sequencer@@filter\_001\_seq. [filter\_001\_seq] GP\_FILT\_VAL\_I SET

# UVM\_INFO ./FILTER\_VERIFY\_tb/sv/filt\_sequencer\_IF/sv//FILT\_SEQUENCER\_IF\_seq\_lib.svh(147) @ 0: uvm\_test\_top.tb\_env.filt\_sequencer\_IF\_inst\_env.agent.sequencer@@filter\_001\_seq..f\_sequence\_001 [FILT\_SEQUENCER\_IF\_001\_seq] Starting to generate traffic …

# UVM\_INFO ./FILTER\_VERIFY\_tb/sv/filt\_sequencer\_IF/sv//FILT\_SEQUENCER\_IF\_driver.svh(104) @ 0: uvm\_test\_top.tb\_env.filt\_sequencer\_IF\_inst\_env.agent.driver [ITEM]

# -------------------------------------------------------------------------------------------------------------------------------------

# Name Type Size Value

# -------------------------------------------------------------------------------------------------------------------------------------

# s\_item FILT\_SEQUENCER\_IF\_seq\_item - @1260

# gp\_chan\_1\_i integral 4 'ha

# gp\_chan\_2\_i integral 4 'hf

# gp\_chan\_3\_i integral 4 'h0

# gp\_chan\_4\_i integral 4 'h0

# gp\_chan\_5\_i integral 4 'hc

# gp\_filt\_val\_i integral 10 'hcd

# rd\_filt integral 1 'h0

# begin\_time time 64 0

# depth int 32 'd3

# parent sequence (name) string 14 f\_sequence\_001

# parent sequence (full name) string 68 uvm\_test\_top.tb\_env.virtual\_sequencer.filter\_001\_seq..f\_sequence\_001

# sequencer string 62 uvm\_test\_top.tb\_env.filt\_sequencer\_IF\_inst\_env.agent.sequencer

# -------------------------------------------------------------------------------------------------------------------------------------

# 

# UVM\_INFO ./FILTER\_VERIFY\_tb/sv/filt\_sequencer\_IF/sv//FILT\_SEQUENCER\_IF\_seq\_lib.svh(155) @ 10: uvm\_test\_top.tb\_env.filt\_sequencer\_IF\_inst\_env.agent.sequencer@@filter\_001\_seq..f\_sequence\_001 [FILT\_SEQUENCER\_IF\_001\_seq] Traffic sequences have completed.

# UVM\_INFO ./FILTER\_VERIFY\_tb/sv/filter\_verify\_tests/sv//filter\_test\_001.svh(37) @ 1010: uvm\_test\_top.tb\_env.virtual\_sequencer@@filter\_001\_seq. [filter\_001\_seq] RESET SET INACTIVE

# UVM\_INFO ./FILTER\_VERIFY\_tb/sv/filter\_verify\_tests/sv//filter\_test\_001.svh(50) @ 1010: uvm\_test\_top.tb\_env.virtual\_sequencer@@filter\_001\_seq. [filter\_001\_seq] RD\_FILT RAISED HIGH

# UVM\_INFO ./FILTER\_VERIFY\_tb/sv/reset\_IF/sv//RESET\_IF\_seq\_lib.svh(121) @ 1010: uvm\_test\_top.tb\_env.reset\_IF\_inst\_env.agent.sequencer@@filter\_001\_seq..r\_sequence\_001 [RESET\_IF\_001\_seq] Starting to generate traffic …

# UVM\_INFO ./FILTER\_VERIFY\_tb/sv/filt\_sequencer\_IF/sv//FILT\_SEQUENCER\_IF\_seq\_lib.svh(147) @ 1010: uvm\_test\_top.tb\_env.filt\_sequencer\_IF\_inst\_env.agent.sequencer@@filter\_001\_seq..f\_sequence\_001 [FILT\_SEQUENCER\_IF\_001\_seq] Starting to generate traffic …

# UVM\_INFO ./FILTER\_VERIFY\_tb/sv/filt\_sequencer\_IF/sv//FILT\_SEQUENCER\_IF\_driver.svh(104) @ 1010: uvm\_test\_top.tb\_env.filt\_sequencer\_IF\_inst\_env.agent.driver [ITEM]

# -------------------------------------------------------------------------------------------------------------------------------------

# Name Type Size Value

# -------------------------------------------------------------------------------------------------------------------------------------

# s\_item FILT\_SEQUENCER\_IF\_seq\_item - @1758

# gp\_chan\_1\_i integral 4 'hb

# gp\_chan\_2\_i integral 4 'hd

# gp\_chan\_3\_i integral 4 'h9

# gp\_chan\_4\_i integral 4 'h5

# gp\_chan\_5\_i integral 4 'h6

# gp\_filt\_val\_i integral 10 'h96

# rd\_filt integral 1 'h1

# begin\_time time 64 1010

# depth int 32 'd3

# parent sequence (name) string 14 f\_sequence\_001

# parent sequence (full name) string 68 uvm\_test\_top.tb\_env.virtual\_sequencer.filter\_001\_seq..f\_sequence\_001

# sequencer string 62 uvm\_test\_top.tb\_env.filt\_sequencer\_IF\_inst\_env.agent.sequencer

# -------------------------------------------------------------------------------------------------------------------------------------

# 

# \*\* Fatal: (SIGSEGV) Bad handle or reference.

# Time: 1030 ns Iteration: 1 Process: /RESET\_IF\_pkg::RESET\_IF\_driver::run\_phase/#fork#74\_f61cbb6 File: ./FILTER\_VERIFY\_tb/sv/reset\_IF/sv//RESET\_IF\_coverage.svh

# Fatal error in Function sample at ./FILTER\_VERIFY\_tb/sv/reset\_IF/sv//RESET\_IF\_coverage.svh line 31

# 

# HDL call sequence:

# Stopped at ./FILTER\_VERIFY\_tb/sv/reset\_IF/sv//RESET\_IF\_coverage.svh 31 Function sample

# called from ./FILTER\_VERIFY\_tb/sv/reset\_IF/sv//RESET\_IF\_coverage.svh 61 Function RESET\_IF\_pkg/RESET\_IF\_coverage::write

# called from /opt/questasim\_10.1c/questasim/linux/../verilog\_src/uvm-1.1b/src/tlm1/uvm\_analysis\_port.svh 114 Function uvm\_pkg/uvm\_analysis\_imp::write

# called from /opt/questasim\_10.1c/questasim/linux/../verilog\_src/uvm-1.1b/src/tlm1/uvm\_analysis\_port.svh 76 Function uvm\_pkg/uvm\_analysis\_port::write

# called from ./FILTER\_VERIFY\_tb/sv/reset\_IF/sv//RESET\_IF\_driver.svh 94 Task RESET\_IF\_pkg/RESET\_IF\_driver::get\_and\_drive

# called from ./FILTER\_VERIFY\_tb/sv/reset\_IF/sv//RESET\_IF\_driver.svh 74 Task RESET\_IF\_pkg/RESET\_IF\_driver::run\_phase

# 

# Fatal error reported during simulation. Cannot run ‘fcover’ command. Please look above output for the fatal error message(s).

# 

# Fatal error reported during simulation. Cannot run ‘fcover’ command. Please look above output for the fatal error message(s).

* * *

The error pops up only when the following line of the code is uncommented: cov\_group.sample();

The error closely points to driver where the drive task is defined:

```
    task drive(REQ req, RSP rsp);
        `uvm_info("DEBUG", {"\n", req.sprint()}, UVM_FULL);

        `uvm_info("ITEM", {"\n", req.sprint()}, UVM_NONE);
        // set signals according to 'req'
        // capture any output (including input) in 'rsp'
        @(posedge vif.clk_i);
		vif.rstn = req.rstn;
    endtask: drive

```

I dont have good understand about req and rsp. Maybe something wrong with driving the signals?

Thank you and Regards,

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [February 18, 2015, 3:26pm UTC](https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369/6 "2015-02-18T15:26:45Z")

</div>

_In reply to [vkantamn](https://verificationacademy.com/forums/t/fatal-sigsegv-bad-handle-or-reference-at-the-definition-of-coverpoint/30369/5):_

That stack trace starts where it says

# HDL call sequence

You need to look at line 94 of

# called from ./FILTER\_VERIFY\_tb/sv/reset\_IF/sv//RESET\_IF\_driver.svh 94 Task RESET\_IF\_pkg/RESET\_IF\_driver::get\_and\_drive

There is probably a call to ap.write(t) and t is null. This may get very complicated to debug in a forum, I suggest you learn how to interactively debug your code and trace the execution of your code. Try to find someone locally to help you.

BTW, there is no need for the line in your class coverage’s constructor

item\_inst = new();

item\_inst will be overwritten with another object what write() gets called.
