N
Narendran Kumaraguru Nathan
Hi all,
I am fairly experianced in C. I am writing a program in which I'm
getting a segmentation fault. The problem is that it is getting the
segmentation fault when executing calloc. I tried debugging it, with
no use. I tried to figure out the common reasons (1) Using a memory
location which is not allocated. (2) Using memory which is freed. (3)
Function use before declaration.
I didn't use any other debuggers or tools other than ddd. My
platform is : RH linux 2.4.20-8 & gcc -v ouputs the following
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
I don't understand what to do. I couldn't attach the program I am
developing, hence have put that in geocities with a sample input. The
files are under
http://www.geocities.com/narenkumaraguru/vcdedit/
The files are
1. main.c.c
2. vcd_read.c.c
3. vcd_read.h.c
4. Makefile.c
5. cntr.vcd.c
Since I couldn't upload files with different names, I postfixed .c
to all of them. Once downloaded please correct the names by removing
the extra .c in them.
Procedure to run it is
1. make
2. ./vcd_read
I'm aint a C wizard. The program is to parse a file format called
the VCD. It is used in VLSI for debugging and waveform dump in
particular. I was writing a library for the format.
Thanks,
Naren.
I am fairly experianced in C. I am writing a program in which I'm
getting a segmentation fault. The problem is that it is getting the
segmentation fault when executing calloc. I tried debugging it, with
no use. I tried to figure out the common reasons (1) Using a memory
location which is not allocated. (2) Using memory which is freed. (3)
Function use before declaration.
I didn't use any other debuggers or tools other than ddd. My
platform is : RH linux 2.4.20-8 & gcc -v ouputs the following
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--host=i386-redhat-linux
Thread model: posix
gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
I don't understand what to do. I couldn't attach the program I am
developing, hence have put that in geocities with a sample input. The
files are under
http://www.geocities.com/narenkumaraguru/vcdedit/
The files are
1. main.c.c
2. vcd_read.c.c
3. vcd_read.h.c
4. Makefile.c
5. cntr.vcd.c
Since I couldn't upload files with different names, I postfixed .c
to all of them. Once downloaded please correct the names by removing
the extra .c in them.
Procedure to run it is
1. make
2. ./vcd_read
I'm aint a C wizard. The program is to parse a file format called
the VCD. It is used in VLSI for debugging and waveform dump in
particular. I was writing a library for the format.
Thanks,
Naren.