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

Segmentation fault caused by null pointer ranges_ inside PGModule::dump #1188

Open
YikeZhou opened this issue Dec 10, 2024 · 0 comments
Open

Comments

@YikeZhou
Copy link

Hi,

I tried to run ivl with the -P <path> flag. However, I got a segmentation fault when working with examples/sqrt.vl.

Here is the backtrace:

#0  PGate::dump_ranges (this=this@entry=0x555555898490, out=...) at pform_dump.cc:721
#1  0x000055555573910d in PGModule::dump (this=0x555555898490, out=..., ind=<optimized out>) at pform_dump.cc:826
#2  0x000055555573ff63 in Module::dump (this=<optimized out>, out=...) at pform_dump.cc:1783
#3  0x00005555557401de in pform_dump (out=..., mod=<optimized out>) at pform_dump.cc:1815
#4  0x0000555555605cdc in main (argc=<optimized out>, argv=<optimized out>) at main.cc:1168

After investigation, I found that this segmentation fault happened when dumping a PGModule object in module main. Therefore, I guess this PGModule object corresponds to the following line in the module definition:

sqrt32 root(.clk(clk), .rdy(rdy), .reset(reset), .x(value), .y(result));

Additionally, PGModule::dump doesn't check whether ranges_ is null before calling the dump_ranges() function, resulting in this segmentation fault.
After wrapping dump_ranges(out); with if (is_array()) {...}, the segmentation fault was eliminated.

for (list<pform_range_t>::iterator cur = ranges_->begin()

dump_ranges(out);

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

No branches or pull requests

1 participant