Hi, I'm relatively new to C programming, but have been working on producing a stats program as a way to experiment and put the things I've learnt into practice.
The program I have compiles perfectly, and the complier does not detect any errors. However, everytime I run the program it crashes.
I'm debugging with GDB, but haven't done any debugging before and don't really know what I'm seeing when I run the program through the debugger. Depending of whether I use scanf or gets to get the file name, I get one of the following two error messages a) 'Program received signal sigsegv, segmentation fault, 0x780224ea in _size_of_stack_reserve__()' or b) 'sigsegv, segmentation fault 0xbff7b983 in ?? ()'.
I have no idea what this means, any help in interpreting it would be great. The source code that is failing is below.
I'm really lost at the moment so any help would be great.
Also is there a better way for me to get a file name and new file.
Bloodshed Dev C Segmentation Fault

Bloodshed Dev C Segmentation Fault Core Dumped

Segmentation
  • I am fairly certain that the coding is correct, however, if I try to use the debug feature I get a 'Segmentation Fault' just after the program enters Main if I run the debugger to the cursor. I have already tried to add the file suggested for Windows Vita problems (mingw32 3.4.2) but I could not figure out how to add the (c: dev-cpp bin ) to.
  • Examples of Segmentation Fault in C 1) Working on a dangling pointer. Well, before discussing this scenario of segmentation fault, lets understand what is dangling pointers. A pointer which holds memory address of a memory which is already freed is known as a dangling pointer.
  • Jun 27, 2008  How to change the entry point main in c langauge. C / C Forums on Bytes. Segmentation fault Can anyone tell what's the reason for the Segmentation fault. I'm using Bloodshed Dev c 4.9.9.2 with Mingw port of GCC (GNU Compiler Collection) as its compiler. Well, I wrote a simple code in C. It is given below-.
  • Mar 19, 2008  Using Dev C debugger, it prompted a window saying: 'An access violation (Segmentation fault) raised in your program'. I don't really know what that means but it points to the line where the while loop is located.
  • May 22, 2012  isn't legal C. Getline is capable of a buffer overrun (the for condition should be i c-string found, and not the actual size so your malloc(len) would be allocating an incorrect size. Should be malloc(len+1), but why are you using malloc in C?
P: n/a
Sorry, but I don't know where else to find C++ programmers who, without
a doubt, will be able to help me with this problem.
I am developing a GUI [GTKMM] under MS Window XP, and since I am not
familiar with the development aspect of MSW I am having problems with
the GDB.
The application 'crashes' or in other words, it has a segmentation
fault, to find out which method call caused the segmentation fault
[sf], I typed gdb Jaime.exe -run [the sf occurs] -bt.. then
the words ' No stack.' appear.
How can I check which f'tion or method call caused the problem?
Thanks folks, and please forgive me for the off topic thing.
PD,
here is the Makefile:
# Project: Jaime
# Makefile created by Dev-C++ 4.9.9.2
CPP = g++.exe -D__DEBUG__
CC = gcc.exe -D__DEBUG__
WINDRES = windres.exe
RES =
OBJ = main.o ./jme/exception/exception.o jaime.o combo.o contacts.o
entry.o $(RES)
LINKOBJ = main.o ./jme/exception/exception.o jaime.o combo.o
contacts.o entry.o $(RES)
LIBS = -L'C:/Dev-Cpp/lib' -user32 -Wl,-luuid -Wl,--rpath
-Wl,/home/ivan/cross/build/lib -LC:/Dev-Cpp/lib
-L/home/ivan/cross/build/lib -lgtkmm-2.4 -lgdkmm-2.4 -latkmm-1.6
-lgtk-win32-2.0 -lpangomm-1.4 -lglibmm-2.4 -lsigc-2.0 -lgdk-win32-2.0
-limm32 -lshell32 -lole32 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0
-lgdi32 -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lfontconfig -lfreetype
-lz -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl
-liconv -mwindows -lgmon -pg -g3
INCS = -I'C:/Dev-Cpp/include'
CXXINCS = -I'C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include'
-I'C:/Dev-Cpp/include/c++/3.4.2/backward'
-I'C:/Dev-Cpp/include/c++/3.4.2/mingw32'
-I'C:/Dev-Cpp/include/c++/3.4.2' -I'C:/Dev-Cpp/include'
BIN = Jaime.exe
CXXFLAGS = $(CXXINCS) -mms-bitfields -IC:/Dev-Cpp/include/gtkmm-2.4
-IC:/Dev-Cpp/lib/gtkmm-2.4/include -IC:/Dev-Cpp/include/glibmm-2.4
-IC:/Dev-Cpp/lib/glibmm-2.4/include -IC:/Dev-Cpp/include/gdkmm-2.4
-IC:/Dev-Cpp/lib/gdkmm-2.4/include -IC:/Dev-Cpp/include/pangomm-1.4
-IC:/Dev-Cpp/include/atkmm-1.6 -IC:/Dev-Cpp/include/gtk-2.0
-IC:/Dev-Cpp/include/sigc++-2.0 -IC:/Dev-Cpp/lib/sigc++-2.0/include
-IC:/Dev-Cpp/include/glib-2.0 -IC:/Dev-Cpp/lib/glib-2.0/include
-IC:/Dev-Cpp/lib/gtk-2.0/include -IC:/Dev-Cpp/include/pango-1.0
-IC:/Dev-Cpp/include/cairo -I/home/ivan/cross/build/include/freetype2
-I/home/ivan/cross/build/include -IC:/Dev-Cpp/include/atk-1.0
-fno-access-control -fexceptions -fverbose-asm -pg -g3
CFLAGS = $(INCS) -fno-access-control -fexceptions -fverbose-asm -pg
-g3
RM = rm -f
...

Bloodshed Dev C++ 5.11

Bloodshed Dev C Segmentation Fault Recursion

Sep 12, 2008 Segmentation fault can also occur under following circumstances: a) A buggy program / command, which can be only fixed by applying patch. B) It can also appear when you try to access an array beyond the end of an array under C programming. /dev-c-work-with-g-compiler.html. C) Inside a chrooted jail this can occur when critical shared libs, config file or /dev/ entry missing. Precision tune auto care fremont.