Segmentation Fault

This is a discussion on Segmentation Fault within the C++ Programming forums, part of the General Programming Boards category; I compiled a c-code in Linux enviornment . When I ran it, it gave segmentation fault on some input files. ...

  1. #1
    Registered User
    Join Date
    Jul 2006
    Posts
    3

    Segmentation Fault

    I compiled a c-code in Linux enviornment . When I ran it, it gave segmentation fault on some input files. When same code was compiled on a different machine (by some one else with no chances, not even in Makefile) and was run, it did not give any problem. Does any body know what could be the problem?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,500
    Yes, there are bugs in your code which (unluckily for you) don't show up on other machines.

    Common problems are down to running off the ends of arrays, or generally making a mess of memory allocation.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Segmentation fault problem
    By odedbobi in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2008, 02:36 AM
  2. Segmentation fault
    By bennyandthejets in forum C++ Programming
    Replies: 7
    Last Post: 09-07-2005, 05:04 PM
  3. Segmentation fault
    By NoUse in forum C Programming
    Replies: 4
    Last Post: 03-26-2005, 02:29 PM
  4. Locating A Segmentation Fault
    By Stack Overflow in forum C Programming
    Replies: 12
    Last Post: 12-14-2004, 12:33 PM
  5. Segmentation fault...
    By alvifarooq in forum C++ Programming
    Replies: 14
    Last Post: 09-26-2004, 12:53 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21