Segmentation Fault

This is a discussion on Segmentation Fault within the C Programming forums, part of the General Programming Boards category; My program works fine in Visual C, but when i run it in UNIX, i get a segmentation fault (core ...

  1. #1
    Unregistered
    Guest

    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 correct...so where could the error be?

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    88
    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
    Location
    Hannover, Germany
    Posts
    3,139
    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.
    hth
    -nv

    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
    Unregistered
    Guest
    FOr some code, you can view my post titled
    seg fault on unix platform

    Thanks

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

    -Prelude
    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, 06: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, 01:53 PM

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