Thread: Strange execution error

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    40

    Strange execution error

    Hi all,

    I'm having a very strange execution error, even on extremely simple Hello, World programs.
    e.g.

    Code:
    #include <stdio.h>
    
    int main (int argc, const char * argv[]) {
        // insert code here...
        printf("Hello, World!\n");
        return 0;
    }
    I get a SIGSEGV (type 11) or a type 4 error (don't recall the code). I've got no idea what's going on. I wonder if I've got a physical problem with my computer? I'm downloading Apple's Tech Tool Deluxe, and running NAV just to be sure.

    Here are my computers specs, in case it's relevant

    Model Name: MacBook Pro
    Model Identifier: MacBookPro3,1
    Processor Name: Intel Core 2 Duo
    Processor Speed: 2.2 GHz
    Number Of Processors: 1
    Total Number Of Cores: 2
    L2 Cache: 4 MB
    Memory: 4 GB
    Bus Speed: 800 MHz
    Boot ROM Version: MBP31.0070.B07

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Signal 4 is SIGILL (illegal instruction). Can't say I've seen that, though. I assume you're using gcc/Xcode? I've been getting all sorts of notices about updates/downdates from Apple recently, what with all the new hardware and all, so maybe make sure you've got the version you're supposed to have?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Which version of gcc (and architecture) are you using?
    Code:
    $ gcc -dumpversion
    4.3.3
    $ gcc -dumpmachine
    i486-linux-gnu
    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.

  4. #4
    Registered User
    Join Date
    Mar 2010
    Posts
    40
    Yeah, I am using Xcode/gcc. I'm sure I had the version I was supposed to have- it's been working for months, and then this happened. I went to the command line and tried to compile a simple program by hand, and it worked just fine, which seemed to indicate there was a problem with Xcode itself. So I downloaded a fresh install of Xcode- and that seems to have done the trick.

    Anyway, the problem seems to have resolved itself with a fresh Xcode install. I'm just starting to worry that something's wrong with the hardware on this machine, cause it's starting to act strange at times. That said, I did buy AppleCare, so as long as my computer craps out on me before Apple Care is up, I won't be too upset.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  2. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  3. failure to import external C libraries in C++ project
    By nocturna_gr in forum C++ Programming
    Replies: 3
    Last Post: 12-02-2007, 03:49 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM