[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: I have some problem "Segmentation fault (core dumped)"
From: |
Tim Van Holder |
Subject: |
Re: I have some problem "Segmentation fault (core dumped)" |
Date: |
Mon, 30 Aug 2004 08:30:53 +0200 |
User-agent: |
Mozilla Thunderbird 0.7.3 (Windows/20040803) |
Jordán E. Moisés wrote:
Hi!
Before anything, I excuse for my English
I'm reading an O'REILLY's book named "lex & yacc", I'm trying to follow
exercise by exercise, but I have stuck because one of then shows me
"Segmentation fault (core dumped)" while I'm executing it, I don't know
why?, and I can't be able to discover the problem.
That's why debuggers exist - running your program under gdb should have
pinpointed the exact place where a bad pointer is used.
I attach the 3 files of the exercise [ch1-05.l, ch1-05.y and
ch1-05y(original).h, of course the real name is "ch1-05y.h"] and 2 c source
files an 1 header file generated by flex and byacc [ch1-05l.c, ch1-05y.c and
Also, if you use byacc, don't ask for help on the bison list ^^
ch1-05y(after-mv).h about its name the same as before] (I'm working in my
Windows 98 SE with cygwin).
In the lex file, you use the uninitialized pointer (word_list).
Try setting that to 0 before using it (and you may want to initialize
'state' as well - at the moment it will contain a random value which
might happen to be LOOKUP).