help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AW: AW: Segmentation Fault in yyparse() method


From: lfinsto1
Subject: Re: AW: AW: Segmentation Fault in yyparse() method
Date: Thu, 15 Nov 2007 21:30:39 +0100 (CET)
User-agent: SquirrelMail/1.4.9a

>> Try running the application under valgrind or some other memory
>> debugger.
>> If possible also try slightly different releases of gcc (4.1.1 or 4.2);
>> there's an outside chance that it's a bug in gcc.
>
> Thanks. I think this isolated the fault a bit more.
> I tried debugging under valgrind. The result was this: [...]

I still think the most likely explanation is that you're reading your
input from an invalid source.  Whether my suspicions are correct or not,
that should certainly be the first thing you check.  What is your input
source?

> What I get of this, is that the yyparse() method can't get stacked and it
> crashes at the first statement, where a new value has to get stacked. But
> GDB runs over these lines and throws segmentation fault, when reaching the
> YYLEX method call,

I will stick my neck out and say `YYLEX' is a macro, because I think I was
overly cautious before.  I don't know anything else it could be.  (Just my
opinion, but I loathe the term "method".  Why they had to invent a new
word for "function" is beyond me.)

> because when stacking another method it finally does
> not
> know what to do. I think GDB shows the wrong point, because printf's
> before
> the YYLEX call aren't done.
>
> But the big question still is, why it doesn't want to stack :-D
>
> I already tried the other ubuntu precompiled gcc versions. On version
> 3.4.6
> it runs, but I had to fix some minor bugs. I wanted to test 4.x.x versions
> but building took about an hour...is it always so slow? Tomorrow I'll try
> again, but now I'm tired and need to rest :D

Of course, it may be a bug in GCC, in Bison, in the operating system or
somewhere else.  However, in my experience, it's usually not, especially
if you're doing something normal.

Laurence







reply via email to

[Prev in Thread] Current Thread [Next in Thread]