UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
2,765 Views
Registered: ‎10-09-2017

Re: xsim gives stack dump

under:

/opt(Xilinx/Vivado/

0 Kudos
Observer a_bert
Observer
2,760 Views
Registered: ‎04-07-2017

Re: xsim gives stack dump

I experience the same issue on Linux Mint. The stack trace is thrown everytime I exit a simulation on 2017.3.1

0 Kudos
Highlighted
Visitor msteveb0
Visitor
2,749 Views
Registered: ‎05-07-2014

Re: xsim gives stack dump

I can confirm the same behaviour:

 

Ubuntu 14.04.5 LTS

Vivado 2017.3

 

e.g.

 

*** Error in `xsim.dir/trex_tb_behav/xsimk': double free or corruption (!prev): 0x0000000000d0e3d0 ***
*** Error in `xsim.dir/ReadNMRData_tb_behav/xsimk': double free or corruption (!prev): 0x0000000001366440 ***
*** Error in `xsim.dir/ReadNMRData_tb_behav/xsimk': double free or corruption (!prev): 0x0000000001c17420 ***
*** Error in `xsim.dir/ReadNMRData_tb_behav/xsimk': double free or corruption (!prev): 0x0000000002562570 ***
*** Error in `xsim.dir/ReadNMRData_tb_behav/xsimk': double free or corruption (!prev): 0x00000000015b64d0 ***
0 Kudos
Observer hgomersall
Observer
2,737 Views
Registered: ‎12-27-2014

Re: xsim gives stack dump

I'm happy to do some more debugging at my end, but I'd hazard a guess that the necessary debugging symbols are not present on my system.

0 Kudos
Moderator
Moderator
2,693 Views
Registered: ‎04-24-2013

Re: xsim gives stack dump

Hi @hgomersall,

 

Can you try to specify either "-cc gcc" or "-cc clang" in xelab and see if this makes any difference?

 

Also if you could run ltrace / strace on xsimk, this can then be compared to the output from a machine that doesn't have the issue.

 

If you do this, please include the commands so that it can be replicated exactly.

 

To run strace on a running program you can do the following

ps -C xsimk
PID TTY TIME CMD
1725 ? 00:40:50 xsimk

sudo strace -p 1725 -o xsimk.txt

 

Best Regards
Aidan

 

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------
0 Kudos
Contributor
Contributor
2,674 Views
Registered: ‎10-09-2017

Re: xsim gives stack dump

In my simple design I'm unable to use gcc as it missing an shared object file.

 

/usr/bin/gcc -c -Wa,-W -fPIC -m64 -I"/opt/Xilinx/Vivado/2017.3/data/xsim/include" "xsim.dir/elab/obj/xsim_0.c" -O -o "xsim.dir/elab/obj/xsim_0.lnx64.o"
/usr/lib/gcc/x86_64-linux-gnu/5/cc1: error while loading shared libraries: libgmp.so.7: cannot open shared object file: No such file or directory
ERROR: [XSIM 43-3409] Failed to compile generated C file xsim.dir/elab/obj/xsim_0.c.
ERROR: [XSIM 43-3915] Encountered a fatal error. Cannot continue. Exiting...

 

0 Kudos
2,627 Views
Registered: ‎11-16-2016

Re: xsim gives stack dump

I also get the same error message when using xsim, but it appears to be the last thing it does before exiting. Any VCD files I output from the simulation get written without corruption.

 

This occurs when the simulation binary is compiled with either GCC or Clang using that flag you mentioned. My simulation is sufficiently short that I cannot hook into the running process.

 

Based on when it occurs, it seems like an issue in the simulation teardown (which would be consistent with the double free the allocator is reporting).

 

I got a little curious and decided to do some digging, and it is in fact true that this bug is related to simulator teardown. Specifically, it only occurs when $finish() is called from within a task that is not the top-level testbench module.

 

Consider the following file test_top_tb.sv (which is just about the simplest  possible executable that invokes $finish()):

 

module test_tb;
    initial
        $finish();
endmodule

 

Running the following will cause the generated executables to exit without the error:

 

xvlog -sv -v 2 test_top_tb.sv
xelab -v 2 -cc gcc -R test_tb
xelab -v 2 -cc clang -R test_tb

You will see that it exits normally in both compilers.

 

Now consider the following file test_task_tb.sv:

 

module test_tb;
    task main;
        $finish();
    endtask
    initial
        main();
endmodule

Running the following will cause the generate executables to raise this double free exception.

 

xvlog -sv -v 2 test_task_tb.sv
xelab -v 2 -cc gcc -R test_tb
xelab -v 2 -cc clang -R test_tb

You will see that there is this problem regardless of the C compiler, which suggests the issue is in the logic of the generated C code produced xelab.

 

The good news is that this particular problem with the double free does not really seem to effect the ability of the simulator to perform the actual simulations, but it could be an issue if your Tcl/shell/[scripting language of choice] outer script is expecting a clean exit code.

 

There could be other causes, but so far this looks like one sure fire way to repro the issue.

 

-Tom

 

0 Kudos
Moderator
Moderator
2,603 Views
Registered: ‎04-24-2013

Re: xsim gives stack dump

 

Hi @thomasrepetti,

 

Thank you for digging into this. I have tried to replicate the error on multiple servers but can't get it to happen, see below.

I will bring what you have found to the Simulation community as it may help the developers.

 

Best Regards
Aidan

 

Built simulation snapshot work.test_tb_bad

****** xsim v2017.3 (64-bit)
**** SW Build 2018833 on Wed Oct 4 19:58:07 MDT 2017
**** IP Build 2016188 on Wed Oct 4 21:52:56 MDT 2017
** Copyright 1986-2017 Xilinx, Inc. All Rights Reserved.

source xsim.dir/work.test_tb_bad/xsim_script.tcl
# xsim {work.test_tb_bad} -autoloadwcfg -runall
Vivado Simulator 2017.3
Time resolution is 1 ps
run -all
$finish called at time : 0 fs : File "/home/amaccre/forums/test_tb_bad.sv" Line 3
exit
INFO: [Common 17-206] Exiting xsim at Thu Dec 7 10:24:21 2017...

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------
0 Kudos
Contributor
Contributor
2,581 Views
Registered: ‎10-09-2017

Re: xsim gives stack dump

I am unable to recreate @thomasrepetti s results. I get the stack dump even if I call finish alone in a initail block as the first thing I do. but as I have said before I can not run with gcc only clang. 

0 Kudos
Observer chamch
Observer
2,085 Views
Registered: ‎05-22-2017

Re: xsim gives stack dump

I have the same problem also with 2017.4 on CentOS Linux release 7.4.1708 (Core).

0 Kudos
Observer xminer
Observer
1,463 Views
Registered: ‎01-31-2018

Re: xsim gives stack dump

I have the same issue on ubuntu 16.04.

 

*** Error in `xsim.dir/scrypt_v1_1_tb_behav/xsimk': double free or corruption (!prev): 0x00000000025e6cd0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fda3362f7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fda3363837a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fda3363c53c]
/opt/Xilinx/Vivado/2017.4/lib/lnx64.o/librdi_simulator_kernel.so(+0x409050)[0x7fda34028050]
/lib/x86_64-linux-gnu/libc.so.6(__cxa_finalize+0x9a)[0x7fda335f236a]
/opt/Xilinx/Vivado/2017.4/lib/lnx64.o/librdi_simulator_kernel.so(+0x12b913)[0x7fda33d4a913]
======= Memory map: ========
00400000-006c0000 r-xp 00000000 08:06 35390867                           /home/developer/xp/project_2/project_2.sim/sim_1/behav/xsim/xsim.dir/scrypt_v1_1_tb_behav/xsimk
008bf000-008c0000 r--p 002bf000 08:06 35390867                           /home/developer/xp/project_2/project_2.sim/sim_1/behav/xsim/xsim.dir/scrypt_v1_1_tb_behav/xsimk
008c0000-008d0000 rw-p 002c0000 08:06 35390867                           /home/developer/xp/project_2/project_2.sim/sim_1/behav/xsim/xsim.dir/scrypt_v1_1_tb_behav/xsimk
02428000-0317a000 rw-p 00000000 00:00 0                  

0 Kudos
Moderator
Moderator
1,428 Views
Registered: ‎04-24-2013

Re: xsim gives stack dump

Hi @martin.rognerud@xminer@chamch@thomasrepetti@hgomersall,

 

Just a quick update on this. This issue was finally replicated on an internal machine and it appears to be related to webtalk.

If you are not using a webpack version of the tools then it is possible to turn this off.

 

You can do this using the following command in the tcl console:

config_webtalk -user off

 

or via the gui in the settings

 

webtalk.PNG

 

Can you try this and see if the results are the same.

This is scheduled to be fixed in the 2018.1 version of the tools.

 

Best Regards
Aidan

 

------------------------------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if this answered your question
Give Kudos to a post which you think is helpful and may help other users
------------------------------------------------------------------------------------------------------------------
Observer hgomersall
Observer
1,423 Views
Registered: ‎12-27-2014

Re: xsim gives stack dump

@amaccrethat's great news. Thanks for pursuing this.

 

We are using the webpack version so will have to wait for 2018.1 I think.

0 Kudos
Contributor
Contributor
1,410 Views
Registered: ‎10-09-2017

Re: xsim gives stack dump

I'm scripting the simulation starting it with xsim and I can not see any change with your proposed fix.

 

I have:

added it to my ~/.Xilinx/Vivado/init.tcl file ()

added it to a ~/Xilinx/xsim/init.tcl file

put it in the tcl file I use in the command "xsim -t sim.tcl ..."

writing it in the gui tcl console

setting it in the settings.

 

Non of the ones above helps. 

 

Is there somewhere else I can set it?

0 Kudos
Newbie fadisaady
Newbie
1,280 Views
Registered: ‎03-05-2018

Re: xsim gives stack dump

I'm having the same issue on Ubuntu 16.04.

I tried turning off webtalk from the tcl console and from gui and it still did not solve it.

0 Kudos