Skip to content
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

changes for Issue #1592 and Issue #1619 #6

Closed
wants to merge 7 commits into from

Conversation

@wsnyder
Copy link
Member

wsnyder commented Dec 3, 2019

Pushed, thanks for your effort.

@wsnyder wsnyder closed this Dec 3, 2019
VarunKoyyalagunta added a commit to VarunKoyyalagunta/verilator that referenced this pull request Jul 13, 2022
Causes verilator to segfault when there's no DPI export, or produce bad
code when there is

$ ./test_regress/t/t_trace_split_cfuncs.pl -- debug --gdbbt

	Program received signal SIGSEGV, Segmentation fault.
	V3OutFormatter::puts (this=0x0, strg=0x5555562e2ba0 "\nvoid Vt_trace_split_cfuncs__Syms::_traceDump() {\n") at ../V3File.cpp:699
	699	    if (m_prependIndent && strg[0] != '\n') {
	#0  V3OutFormatter::puts (this=0x0, strg=0x5555562e2ba0 "\nvoid Vt_trace_split_cfuncs__Syms::_traceDump() {\n") at ../V3File.cpp:699
	verilator#1  0x00005555559798f1 in V3OutFormatter::puts (strg=..., this=<optimized out>) at /usr/include/c++/9/bits/basic_string.h:2304
	verilator#2  EmitCBaseVisitor::puts (str=..., this=0x7fffffffd8f0) at ../V3EmitCBase.h:58
	verilator#3  EmitCSyms::emitSymImp (this=this@entry=0x7fffffffd8f0) at ../V3EmitCSyms.cpp:928
	verilator#4  0x00005555559abe1e in EmitCSyms::visit (this=0x7fffffffd8f0, nodep=<optimized out>) at ../V3EmitCSyms.cpp:275
	verilator#5  0x000055555579324a in AstNetlist::accept (this=<optimized out>, v=...) at ../V3AstNodes.h:9348
	verilator#6  0x0000555555974795 in VNVisitor::iterate (nodep=0x555556255f80, this=0x7fffffffd8f0) at ../V3Ast.h:3245
	verilator#7  EmitCSyms::EmitCSyms (dpiHdrOnly=false, nodep=0x555556255f80, this=0x7fffffffd8f0) at ../V3EmitCSyms.cpp:369
	verilator#8  V3EmitC::emitcSyms (dpiHdrOnly=<optimized out>) at ../V3EmitCSyms.cpp:1071
	verilator#9  0x0000555555742333 in process () at ../Verilator.cpp:524
	verilator#10 0x0000555555742c7a in verilate (argString=...) at ../Verilator.cpp:607
	verilator#11 0x0000555555745319 in main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>) at ../Verilator.cpp:733

$ ./test_regress/t/t_trace_split_cfuncs_dpi_export.pl

	vlt/t_trace_split_cfuncs_dpi_export: %Error: Exec of make failed: g++  -I.  -MMD -I/home/ubuntu/src/verilator/test_regress/../include -I/home/ubuntu/src/verilator/test_regress/../include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow      -std=gnu++14 -DVERILATOR=1 -DVL_DEBUG=1 -DTEST_OBJ_DIR=obj_vlt/t_trace_split_cfuncs_dpi_export -DVM_PREFIX=Vt_trace_split_cfuncs_dpi_export -DVM_PREFIX_INCLUDE="<Vt_trace_split_cfuncs_dpi_export.h>" -DVM_PREFIX_ROOT_INCLUDE="<Vt_trace_split_cfuncs_dpi_export___024root.h>" -DT_TRACE_SPLIT_CFUNCS_DPI_EXPORT   -O0 -c -o Vt_trace_split_cfuncs_dpi_export__main.o ../../obj_vlt/t_trace_split_cfuncs_dpi_export/Vt_trace_split_cfuncs_dpi_export__main.cpp
VarunKoyyalagunta added a commit to VarunKoyyalagunta/verilator that referenced this pull request Jul 13, 2022
Causes verilator to segfault when there's no DPI export, or produce bad
code when there is

$ ./test_regress/t/t_trace_split_cfuncs.pl -- debug --gdbbt

	Program received signal SIGSEGV, Segmentation fault.
	V3OutFormatter::puts (this=0x0, strg=0x5555562e2ba0 "\nvoid Vt_trace_split_cfuncs__Syms::_traceDump() {\n") at ../V3File.cpp:699
	699	    if (m_prependIndent && strg[0] != '\n') {
	#0  V3OutFormatter::puts (this=0x0, strg=0x5555562e2ba0 "\nvoid Vt_trace_split_cfuncs__Syms::_traceDump() {\n") at ../V3File.cpp:699
	verilator#1  0x00005555559798f1 in V3OutFormatter::puts (strg=..., this=<optimized out>) at /usr/include/c++/9/bits/basic_string.h:2304
	verilator#2  EmitCBaseVisitor::puts (str=..., this=0x7fffffffd8f0) at ../V3EmitCBase.h:58
	verilator#3  EmitCSyms::emitSymImp (this=this@entry=0x7fffffffd8f0) at ../V3EmitCSyms.cpp:928
	verilator#4  0x00005555559abe1e in EmitCSyms::visit (this=0x7fffffffd8f0, nodep=<optimized out>) at ../V3EmitCSyms.cpp:275
	verilator#5  0x000055555579324a in AstNetlist::accept (this=<optimized out>, v=...) at ../V3AstNodes.h:9348
	verilator#6  0x0000555555974795 in VNVisitor::iterate (nodep=0x555556255f80, this=0x7fffffffd8f0) at ../V3Ast.h:3245
	verilator#7  EmitCSyms::EmitCSyms (dpiHdrOnly=false, nodep=0x555556255f80, this=0x7fffffffd8f0) at ../V3EmitCSyms.cpp:369
	verilator#8  V3EmitC::emitcSyms (dpiHdrOnly=<optimized out>) at ../V3EmitCSyms.cpp:1071
	verilator#9  0x0000555555742333 in process () at ../Verilator.cpp:524
	verilator#10 0x0000555555742c7a in verilate (argString=...) at ../Verilator.cpp:607
	verilator#11 0x0000555555745319 in main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>) at ../Verilator.cpp:733

$ ./test_regress/t/t_trace_split_cfuncs_dpi_export.pl

	vlt/t_trace_split_cfuncs_dpi_export: %Error: Exec of make failed: g++  -I.  -MMD -I/home/ubuntu/src/verilator/test_regress/../include -I/home/ubuntu/src/verilator/test_regress/../include/vltstd -DVM_COVERAGE=0 -DVM_SC=0 -DVM_TRACE=1 -DVM_TRACE_FST=0 -DVM_TRACE_VCD=1 -faligned-new -fcf-protection=none -Wno-bool-operation -Wno-sign-compare -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-shadow      -std=gnu++14 -DVERILATOR=1 -DVL_DEBUG=1 -DTEST_OBJ_DIR=obj_vlt/t_trace_split_cfuncs_dpi_export -DVM_PREFIX=Vt_trace_split_cfuncs_dpi_export -DVM_PREFIX_INCLUDE="<Vt_trace_split_cfuncs_dpi_export.h>" -DVM_PREFIX_ROOT_INCLUDE="<Vt_trace_split_cfuncs_dpi_export___024root.h>" -DT_TRACE_SPLIT_CFUNCS_DPI_EXPORT   -O0 -c -o Vt_trace_split_cfuncs_dpi_export__main.o ../../obj_vlt/t_trace_split_cfuncs_dpi_export/Vt_trace_split_cfuncs_dpi_export__main.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants