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

Verilator hangs in malloc() when assignment pattern key is not found #1364

Closed
veripoolbot opened this issue Nov 1, 2018 · 3 comments
Closed

Verilator hangs in malloc() when assignment pattern key is not found #1364

veripoolbot opened this issue Nov 1, 2018 · 3 comments
Assignees

Comments

@veripoolbot
Copy link

@veripoolbot veripoolbot commented Nov 1, 2018


Author Name: Matt Myers
Original Redmine Issue: 1364 from https://www.veripool.org

Original Assignee: Wilson Snyder (@wsnyder)


The following code correctly gives an error message:

%Error: Assignment pattern key 'valids' not found as member

However, Verilator 3.926 does not exit, it hangs

#0  0x00007f6c45dbdc90 in __memcpy_ssse3_back () from /lib64/libc.so.6
#1  0x0000000000430fb0 in char* std::string::_S_construct<char*>(char*, char*, std::allocator<char> const&, std::forward_iterator_tag) ()
#2  0x00007f6c465e6328 in std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const () from /lib64/libstdc++.so.6
#3  0x000000000040c208 in std::string cvtToStr<int>(int const&) ()
#4  0x00000000004e9ab1 in FileLine::ascii() const ()
#5  0x00000000004e9d63 in operator<<(std::ostream&, FileLine*) ()
#6  0x00000000004eac43 in FileLine::v3errorEnd(std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >&) ()
#7  0x000000000041b8f9 in AstNode::v3errorEnd(std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >&) const ()
#8  0x00000000005d3655 in WidthVisitor::visit(AstPattern*) ()
#9  0x000000000041a7f8 in AstNode::iterateAndNext(AstNVisitor&) ()
#10 0x00000000005ca3a3 in WidthVisitor::visit(AstNodeAssign*) ()
#11 0x000000000041a7f8 in AstNode::iterateAndNext(AstNVisitor&) ()
#12 0x000000000041a87d in AstNode::iterateChildren(AstNVisitor&) ()
#13 0x00000000005bdbdb in WidthVisitor::visit(AstNode*) ()
#14 0x000000000041a7f8 in AstNode::iterateAndNext(AstNVisitor&) ()
#15 0x000000000041a891 in AstNode::iterateChildren(AstNVisitor&) ()
#16 0x00000000005bdbdb in WidthVisitor::visit(AstNode*) ()
#17 0x000000000041a7f8 in AstNode::iterateAndNext(AstNVisitor&) ()
#18 0x000000000041a891 in AstNode::iterateChildren(AstNVisitor&) ()
#19 0x00000000005bdbdb in WidthVisitor::visit(AstNode*) ()
#20 0x000000000041a900 in AstNode::iterateListBackwards(AstNVisitor&) ()
#21 0x000000000041a93a in AstNode::iterateChildrenBackwards(AstNVisitor&) ()
#22 0x00000000005b9c1d in WidthVisitor::visit(AstNetlist*) ()
#23 0x000000000041ccaf in AstNode::iterateSubtreeReturnEdits(AstNVisitor&) ()
#24 0x00000000005b7358 in V3Width::width(AstNetlist*) ()
#25 0x000000000040a82f in process() ()
#26 0x0000000000407461 in main ()

Adding --debug gives:

  CastSizeClc: 1: SEL 0x7446df0 <e736497#> {kj584} @dt=0x6e014e0@(G/sw11)
  CastSizeClc: 1:1: VARREF 0x6784ab0 <e736492#> {kj584} @dt=0x6de6b50@(G/sw32)  NUM_BYTES_4_UPDATE pkg=0x4f17650 [RV] <- VAR 0x4f733c0 <e520685> {kj439} @dt=0x6de6b50@(G/sw32)  NUM_BYTES_4_UPDATE LPARAM
  CastSizeClc: 1:2: CONST 0x7446fc0 <e736493#> {kj584} @dt=0x17dc460@(G/w32)  32'h0
  CastSizeClc: 1:3: CONST 0x7446ec0 <e736494#> {kj584} @dt=0x17dc460@(G/w32)  32'hb
  CastSizeClc: 2: CONST 0x4f8e880 <e736480#> {kj584} @dt=0xb14cd0@(G/swu32/4)  ?32?shb
%Error: : Assignment pattern key 'valids' not found as member
-node: TEXT 0x61f35d0 <e356067> {ni23} "valids"

Code:

module test (input wire clk,
              input wire res_n);

     typedef struct packed {
         logic [3:0] port_num;
     } info_struct;

     info_struct myinfo;

     always_comb
         myinfo = '{default: '0,
                    valids: '1};

endmodule

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Nov 1, 2018


Original Redmine Comment
Author Name: Matt Myers
Original Date: 2018-11-01T18:38:53Z


Confirmed this happens in 4.006 as well

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Nov 1, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-11-01T23:04:53Z


Thanks for the report. Fixed in git towards 4.008.

@veripoolbot

This comment has been minimized.

Copy link
Author

@veripoolbot veripoolbot commented Dec 1, 2018


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2018-12-01T20:17:39Z


In 4.008.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.