SIGSEGV Error in Questa while simulation

Hello,

I am new to system verilog and my quesry might be a silly one I’m stuck with this error and I couldn’t find a resolution to it.
I am running a simulation on questa which was running fine the other day and I was also able to generate coverage reports, but today its throwing this SIGSEGV error. I dont know why its happening although I have not made any significant change to my code ( just commented some lines and changed the value of “i” for the for loop). Also it runs fine for few iterations, but shows the same error for the 9th iteration every time I run this.

The error log :
time=70000| eth_env1::new():: sample_env

Warning: In instance '/eth_env_pkg::eth_drvr_c::eth_cov ’ the ‘option.per_instance’ is set to ‘0’ (false). Assignment to members ‘weight’, ‘goal’ and ‘comment’ of ‘option’ would not have any effect.

time=70000| eth_pkt1::new()

PACKET TYPE::Z

time=70000| eth_pkt1::data filled at position da is 000000a2

time=70000| eth_pkt1::data filled at position sa is 000000b1

time=70000| eth_pkgn1::randomization done for pkt no. 0

time=70000| eth_drvr1::drive_pkt_portB1: numDwords=3

time=80000| eth_drvr1::drive_pkt_portB1:count=0 cur_dword=00000000:sop=0:eop=0

time=90000| eth_drvr1::drive_pkt_portB1:count=1 cur_dword=000000a2:sop=1:eop=0

time=100000| eth_drvr1::drive_pkt_portB1:count=2 cur_dword=000000b1:sop=0:eop=0

time=105000| eth_mntr1::Detected Sop on input PortB1

time=105000| eth_pkt1::new()

time=110000| eth_drvr1::drive_pkt_portB1:count=3 cur_dword=faceface:sop=0:eop=1

time=125000| eth_mntr1::Transmitting packet from input PortB1: pkt=da=a2 sa=b1 data='{} crc=faceface

time=125000| eth_chkr1::Port=1 is Transmitting packet=da=a2 sa=b1 data='{} crc=faceface

time=170000| eth_pkt2::new()

PACKET TYPE::XL

.
.
.
.

time=2430000| eth_drvr9::drive_pkt_portB1:count=8 cur_dword=842a1073:sop=0:eop=0

time=2435000| eth_mntr8::Received packet on output PortB2: pkt=da=a1 sa=b1 data='{1057181516, 3807078360, 1201251325, 3553121147, 280745459} crc=faceface

time=2435000| eth_chkr8::Port=3 is Receiving packet=da=a1 sa=b1 data='{1057181516, 3807078360, 1201251325, 3553121147, 280745459} crc=faceface

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

Time: 2435 ns Iteration: 2 Process: /eth_env_pkg::eth_chkr_c::run/#FORK#40_f6d2525 File: eth_chkr.sv

Fatal error in Function eth_pkt_pkg/eth_pkt::compare_pkt at /home/user1/Vansh/1123/eth_pkt.sv line 119

HDL call sequence:

Stopped at /home/user1/Vansh/1123/eth_pkt.sv 119 Function eth_pkt_pkg/eth_pkt::compare_pkt

called from eth_chkr.sv 83 Function eth_env_pkg/eth_chkr_c::chk_exp_packet_q

called from eth_chkr.sv 55 Task eth_env_pkg/eth_chkr_c::get_and_process_pkt

called from eth_chkr.sv 40 Task eth_env_pkg/eth_chkr_c::run

The corresponding codes are :
--------eth_pkt.sv
line 118 :

 function bit compare_pkt(eth_pkt pkt);
    if((this.pkt_sa==pkt.pkt_sa) &&
       (this.pkt_da==pkt.pkt_da) &&
	   (this.pkt_crc==pkt.pkt_crc) &&
       is_data_match(this.frame, pkt.frame)) begin
return 1'b1;
end else return 1'b0;
endfunction

--------eth_chkr.sv

line 35 :

 task run();
fork
  get_and_process_pkt(0);
  get_and_process_pkt(1);
  get_and_process_pkt(2);
  get_and_process_pkt(3);
join_none
endtask

task get_and_process_pkt(int port);
eth_pkt pkt;

  //$display("time=%0t| eth_chkr%0d::process_pkt on port=%0d",$time,scnt, port);
forever begin
mbx_chkr[port].get(pkt);
if(port<2) begin 					//input packets
  $display("time=%0t| eth_chkr%0d::Port=%0d is Transmitting packet=%s",$time,scnt,port,pkt.to_string());
gen_exp_packet_q(pkt);
end else begin 						//output packets
  $display("time=%0t| eth_chkr%0d::Port=%0d is Receiving packet=%s",$time,scnt,port,pkt.to_string());
chk_exp_packet_q(port, pkt);
end
end
endtask

line 75:

function void chk_exp_packet_q(int port, eth_pkt pkt);
eth_pkt exp;
if(port==2) begin
exp = exp_pkt_A_q.pop_front();
end else if (port==3) begin
exp = exp_pkt_B_q.pop_front();
end
  
if(pkt.compare_pkt(exp)) begin
  $display("*******Iteration%0d::Packet on output port %h matches***********",scnt,pkt.pkt_da);
end else begin
//-> eth_top.eth_if1.err;
  $error("Iteration%0d::Error::Packet on output port %h mismatches",scnt, pkt.pkt_da);
//$error("Iteration%0d::Error%0d::Packet on output port %h mismatches",scnt,eth_top.eth_if1.error_count, pkt.pkt_da);
end
scnt++;
endfunction

In reply to Vanshlata_cdac:

Not enough data, but probably “exp” in chk_exp_packet_q is null. Have you checked “exp_pkt_B_q” is not an empty queue before popping it? There are no checks on “exp” after popping the queue as well.

Thanks,
Ahmed