New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling $display with real %t argument causes segfault in _vl_vsformat #1443
Comments
Original Redmine Comment The segfault seems to be dependent upon the %t time format output, and the call to $realtime also being present. Without these, it works fine. I was also surprised the time output by $display is always "1" in this case, even though I am incrementing time in the testbench, though I may be doing something wrong here ... |
Original Redmine Comment Thanks for the test case. Basically %t didn't support real numbers ($realtime). Fixed in git towards 4.015. |
Original Redmine Comment Great, fix confirmed, thanks. One very minor observation. For consistency with other simulators, could we suffix %t output with "ns/us" to distinguish the value as a time? Suggested patch attached |
Original Redmine Comment Re time format: IEEE does not say to print "ns" by default. I suspect what you have is a call to $timeformat specifying that string. Verilator doesn't implement $timeformat (see e.g. test_regress/t/t_display_time.v). If you want to have this supported please file a new bug, and it would be great if you would consider a patch to implement it (e.g. parse it, then pass into C file, then verilated.c saves the values to affect printing). Thanks |
Original Redmine Comment In 4.016. |
Author Name: Julien Margetts
Original Redmine Issue: 1443 from https://www.veripool.org
Original Assignee: Wilson Snyder (@wsnyder)
Standalone minimal test case attached
Output running executable under GDB:
TestCase at 1 this is fine
TestCase at 1 this is fine
TestCase at 1 this is fine
TestCase at 1 this is fine
Program received signal SIGSEGV, Segmentation fault.
0x000000000040510c in _vl_vsformat(std::string&, char const*, __va_list_tag*) ()
Missing separate debuginfos, use: debuginfo-install glibc-2.17-157.el7_3.1.x86_64 libgcc-4.8.5-11.el7.x86_64 libstdc++-4.8.5-11.el7.x86_64
(gdb) bt
#0 0x000000000040510c in _vl_vsformat(std::string&, char const*, __va_list_tag*) ()
#1 0x0000000000407b2f in VL_WRITEF(char const*, ...) ()
#2 0x0000000000414254 in VBUG::_sequent__TOP__1(VBUG__Syms*) ()
#3 0x00000000004142ca in VBUG::_eval(VBUG__Syms*) ()
#4 0x0000000000414088 in VBUG::eval() ()
#5 0x000000000040226b in main ()
The text was updated successfully, but these errors were encountered: