Bad pointer access. Closing vsimk

Hello,

I use Modelsim, and I run simulations using a Python script. However, very often, I receive following error:

# Attempting stack trace sig 11
# Signal caught: signo [11]
# vsim_stacktrace.vstf written
# Current time Fri Aug 20 00:23:20 2021
# ModelSim - Intel FPGA Edition Stack Trace
# Program = vsim
# Id = "10.5c"
# Version = "2017.01"
# Date = "Jan 23 2017"
# Platform = win32pe
# Signature = 5e7f9b833961c34eb19f3225262e3a77
# 0    0x96490000: '<unknown (@0x96490000)>'
# 1    0x032d1277: '<unknown (@0x32d1277)>'
# 2    0x032d10f3: '<unknown (@0x32d10f3)>'
# 3    0x774c2d06: '<unknown (@0x774c2d06)>'
# 4    0x7749a0e8: '<unknown (@0x7749a0e8)>'
# 5    0x77490eee: '<unknown (@0x77490eee)>'
# 6    0x77490ade: '<unknown (@0x77490ade)>'
# 7    0x77485b94: '<unknown (@0x77485b94)>'
# 8    0x774995de: '<unknown (@0x774995de)>'
# 9    0x77490a2c: '<unknown (@0x77490a2c)>'
# 10   0x77490953: '<unknown (@0x77490953)>'
# 11   0x77328d4f: '<unknown (@0x77328d4f)>'
# 12   0x77327a66: '<unknown (@0x77327a66)>'
# 13   0x77327912: '<unknown (@0x77327912)>'
# 14   0x011499c4: '<unknown (@0x11499c4)>'
# 15   0x011490e0: '<unknown (@0x11490e0)>'
# End of Stack Trace


** Fatal: (SIGSEGV) Bad pointer access. Closing vsimk.
** Fatal: vsimk is exiting with code 211.
Exit codes are defined in the "Error and Warning Messages"
appendix of the ModelSim User's Manual.
Traceback (most recent call last):
  File "D:/doctorat/GitHub/algoritmiGenetici/lampaInteligenta/genetic_environment/AlgoritmGenetic.py", line 189, in <module>
    best, score = genetic_algorithm(objective_function, n_bits, n_iter, n_pop, r_cross, width, no_of_operations, sim_path, no_of_coverage_intervals)
  File "D:/doctorat/GitHub/algoritmiGenetici/lampaInteligenta/genetic_environment/AlgoritmGenetic.py", line 119, in genetic_algorithm
    scores = [objective(c, width, no_of_operations, simulation_path, no_of_coverage_intervals) for c in pop]
  File "D:/doctorat/GitHub/algoritmiGenetici/lampaInteligenta/genetic_environment/AlgoritmGenetic.py", line 119, in <listcomp>
    scores = [objective(c, width, no_of_operations, simulation_path, no_of_coverage_intervals) for c in pop]
  File "D:/doctorat/GitHub/algoritmiGenetici/lampaInteligenta/genetic_environment/AlgoritmGenetic.py", line 46, in objective_function
    coverage_value = read_simulation_values(path_to_sim)
  File "D:\doctorat\GitHub\algoritmiGenetici\lampaInteligenta\simulation_wrapper\utils_wrapper.py", line 57, in read_simulation_values
    return current_coverage_result
UnboundLocalError: local variable 'current_coverage_result' referenced before assignment

Process finished with exit code 1

In other situations I get following error:

C:/Users/z003phaf/AppData/Local/Temp\<user_name>_dpi_4572\win32pe_gcc-4.2.1\exportwrapper.c
# Loading C:/Users/z003phaf/AppData/Local/Temp\<user_name>_dpi_4572\win32pe_gcc-4.2.1\vsim_auto_compile.dll
# ** Fatal: (SIGSEGV) Bad handle or reference.
# FATAL ERROR while loading design
# Error loading design

Short description of my application: A uvm sequence gets some data from a text file which is further driven to DUT interface via uvm sequencer and uvm driver. After sequence finishes, the coverage is read (a mannualy implemented coverage collection), and a new simulation is started, reading other data items from the same text file (which was modified in meanwhile).

You see that there is a stack trace of 15 lines. I’ve run the same program on two computers and I received the same codes .I don’t know where to look for error.

Any advice is welcome.

Thank you,
Alexandru

I want also to mention that the script which starts each simulation is:

transcript file transcript_dut1_all_operations
#delete previous created library
vmap -del work
vdel -all -lib work  
#create a new work library
vlib work 
vmap work work
#compile uvm library
vlog +define+UVM_NO_DPI uvm-1.2/src/uvm_pkg.sv
# compile design
vlog +define+UVM_NO_DPI -reportprogress 300 -work work design.sv
# compile interfaces
vlog +define+UVM_NO_DPI -reportprogress 300 -work work interfata_senzor.sv
vlog +define+UVM_NO_DPI -reportprogress 300 -work work interfata_lampa.sv
vlog +define+UVM_NO_DPI -reportprogress 300 -work work interfata_buton.sv
# compile verification environment
vlog +define+UVM_NO_DPI -reportprogress 300 -work work testbench.sv
vsim -gui work.top
run -all
quit -f

In reply to alexandru_dinu:

I want also to mention that this error does not appear at same moment .Sometimes, it appears after that only a few simulations were run, sometimes it appears after more than a hundred of simulations were run.