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 Preproc.so #527

Closed
veripoolbot opened this issue Jun 28, 2012 · 2 comments
Closed

segmentation fault in Preproc.so #527

veripoolbot opened this issue Jun 28, 2012 · 2 comments
Assignees

Comments

@veripoolbot
Copy link
Collaborator


Author Name: sorin lazarescu
Original Redmine Issue: 527 from https://www.veripool.org
Original Date: 2012-06-28
Original Assignee: Wilson Snyder (@wsnyder)


I am using Perl 5 version 16. This was compiled, installed and ran on a machine running RedHat 5.6 64 bit.

I have Verilog::Perl 3.315 installed.

The line $self->_open($filename); from the subroutine open in the file Preproc.pm causes a segmentation fault. I am attaching a valgrind trace that shows where the segmentation fault occurred. What could be causing this?

I would like to add that everything works fine if I use Perl 5.8.8 and Verilog::Perl 3.221.

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2012-07-15T15:22:59Z


Sorry for the delay. Is the version of "flex" the same in both cases?

Based on the valgrind report, try this:

diff --git a/Preproc/VPreLex.l b/Preproc/VPreLex.l
--- a/Preproc/VPreLex.l
+++ b/Preproc/VPreLex.l
@@ -505,7 +505,8 @@ void VPreLex::scanBytesBack(const string& str) {

string VPreLex::currentUnreadChars() {
// WARNING - Peeking at internals

  • if (!currentBuffer()) return "";
    ssize_t left = (yy_n_chars - (yy_c_buf_p - currentBuffer()->yy_ch_buf));
    if (left > 0) { // left may be -1 at EOS
    *(yy_c_buf_p) = (yy_hold_char);
    return string(yy_c_buf_p, left);

@veripoolbot
Copy link
Collaborator Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2013-05-30T00:36:43Z


Closing due to age / no response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants