Thread: Segmentation Fault

  1. #1

    Segmentation Fault

    My program works fine in Visual C, but when i run it in UNIX, i get a segmentation fault (core dumped) error message...why does this happen...??? I am malloc-ing memory and when I print out the contents of the 2d arrays I malloc-ed, they are where could the error be?

  2. #2
    Registered User
    Join Date
    Dec 2001
    show us a piece of code

    normally there shouldn't be an error by porting win32 to unix...

    there must be a bug in your code...
    Hope you don't mind my bad english, I'm Austrian!

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Hannover, Germany
    Does it run in VC Release Mode ? Debug Mode ( default ) initialises all your variables and pointers... maybe you left some uninitialised but didn't notice.

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  4. #4
    FOr some code, you can view my post titled
    seg fault on unix platform


  5. #5
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    A segmentation fault on UNIX is often the result of dereferencing an ininitialized pointer.

    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Re: Segmentation fault
    By turkish_van in forum C Programming
    Replies: 8
    Last Post: 01-20-2007, 05:50 PM
  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, 03:29 PM
  4. Locating A Segmentation Fault
    By Stack Overflow in forum C Programming
    Replies: 12
    Last Post: 12-14-2004, 01:33 PM
  5. Segmentation fault...
    By alvifarooq in forum C++ Programming
    Replies: 14
    Last Post: 09-26-2004, 12:53 PM