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 in SpTraceVcd::dumpFull #67

Closed
veripoolbot opened this issue Feb 19, 2009 · 4 comments
Closed

Segmentation fault in SpTraceVcd::dumpFull #67

veripoolbot opened this issue Feb 19, 2009 · 4 comments
Assignees
Labels
area: wrong runtime result Issue involves an incorrect runtine result from Verilated model resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Ralf Karge
Original Redmine Issue: 67 from https://www.veripool.org
Original Date: 2009-02-18
Original Assignee: Wilson Snyder (@wsnyder)


I have over time added modules to our verilated design. It still runs functionally OK but when I try to build for and dump a vcd trace output my simulator crashes with a segmentation fault during the first invocation of SpTraceVcd::dumpFull when the callback is being called "(cip->m_fullcb) (this, cip->m_userthis, cip->m_code);"

   4 [main] Sim3285 308 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)

Segmentation fault (core dumped)

Is it possible that the design is simply too big? When I comment out a few (tricky) modules the trace works fine. I am using SystemPerl-1.310 but had the same problem with SystemPerl-1.161. Any suggestions on how to debug this?

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2009-02-19T01:32:44Z


That's a new one. I'd first see if the callback pointer is getting trashed by something. I'd suggest adding in SpTraceVcdC.cpp ::addCallback a printf("%p",fullcb) statement to then likewise in ::dumpFull on cip and cip->m_fullCb right before calling the callback. If the value changes something is trashing it, and you can try a GDB watchpoint on that address.

If there's multiple callbacks that get added, you can try commenting out the various calls into addCallback in the Verilated code to see if it's a specific one.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Ralf Karge
Original Date: 2009-02-19T04:56:30Z


It seems that there is only one callback installed and that callback pointer appears correct.

SpTraceVcd::addCallback fullcb: 0x5f1212
SpTraceVcd::dump enter
SpTraceVcd::dumpFull enter
SpTraceVcd::dumpFull prep done. m_callbacks.size()=1
SpTraceVcd::dumpFull before callback - cip: 0x6fb20e0
(cip->m_fullcb) (this, cip->m_userthis, cip->m_code): (0x5f1212)(0x6fb4c80, 6fb1ed0, 1)
4 [main] Sim3285 3804 _cygtls::handle_exceptions: Error while dumping state (probably corrupted stack)
Segmentation fault (core dumped)

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2009-02-19T14:19:26Z


Hmm, are you close to out of memory?

I assume the callback is getting correctly invoked then, and you did build with '-O0 -ggdb'. Edit the traceFull callback to comment out a big block of code, and play the bisection game.

It might just be whatever first signal that calls vcdp->full..., so try commenting all but that first full call first.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2009-05-08T18:50:21Z


I assume you got this figured out; if not please reopen.

@veripoolbot veripoolbot added area: wrong runtime result Issue involves an incorrect runtine result from Verilated model resolution: fixed Closed; fixed labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: wrong runtime result Issue involves an incorrect runtine result from Verilated model resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants