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
Labels

Comments

@veripoolbot
Copy link
Collaborator

@veripoolbot veripoolbot commented Jun 28, 2012


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

This comment has been minimized.

Copy link
Collaborator Author

@veripoolbot veripoolbot commented Jul 15, 2012


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

This comment has been minimized.

Copy link
Collaborator Author

@veripoolbot veripoolbot commented May 30, 2013


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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.