Understanding cygwin debugging messages

  • Thread starter Thread starter thedude36
  • Start date Start date
  • Tags Tags
    Debugging
Click For Summary
SUMMARY

The discussion centers on troubleshooting segmentation faults in a C program using Cygwin. The user encounters a STATUS_ACCESS_VIOLATION error and a SIGSEGV signal, indicating memory access issues. Key causes identified include array indexing errors and dereferencing uninitialized pointers. Participants suggest sharing code for more precise debugging assistance.

PREREQUISITES
  • Understanding of C programming language
  • Familiarity with Cygwin environment
  • Knowledge of debugging techniques in C
  • Basic concepts of memory management in programming
NEXT STEPS
  • Learn how to interpret Cygwin debugging messages
  • Explore techniques for debugging segmentation faults in C
  • Study proper pointer initialization and memory allocation
  • Review array bounds checking in C programming
USEFUL FOR

Students learning C programming, software developers debugging applications in Cygwin, and anyone seeking to understand memory management and debugging techniques in C.

thedude36
Messages
30
Reaction score
0
I'm working on a program for my intro level c class. This program is supposed to take in some text and then tell you the number of occurances of each letter used (among other things). Initially I was getting a segmentation fault whenever I ran the program. I tried running the debugger to help pinpoint where the issue was, but i cannot make heads or tails of the information it gave me. Could anyone help/point me toward some information to help me read debugging messages??

This is the message i get:

3 [main] strings 4772 exception::handle: Exception: STATUS_ACCESS_VIOLATION
41626 [main] strings 4772 open_stackdumpfile: Dumping stack trace to strings.exe.stackdump

Program received signal SIGSEGV, Segmentation fault.
0x6114034d in __svfscanf_r () from /usr/bin/cygwin1.dll
 
Physics news on Phys.org
I don't know much about cygwin or this debugger, so I can't really tell you exactly what that message means (but Googling the text of the error message verbatim usually results in finding a site where it is explained :wink:). In general, a seg fault usually results from trying to access memory locations that don't exist or are otherwise inaccessible. For example, if your program had an array indexing problem that caused it to try to write to a location in the array that was out of bounds (outside of what was allocated that array), that would lead to a seg fault.

I am pretty familiar with C. A better approach might be for you to post your code. We might be able to pick out errors in it.
 
In addition to what cepheid said, a segmentation fault could also come from attempting to dereference a pointer that hadn't been properly initialized.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
Replies
13
Views
6K
Replies
12
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 5 ·
Replies
5
Views
5K