Thread: SIGSEGV hell

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    15

    SIGSEGV hell

    <THIS HAS BEEN SORTED BY RESTARTING CODE::BLOCKS, TRY IT IF IT'S RELEVENT, IF NOT WHY ARE YOU EVEN HERE?>


    Hi there all, I am new to posting problems on a forum so apologies if my way of talking doesn't fit properly...

    Am a newb c++ programmer (and to be fair I just program like I'm still talking Java with a few extra bits n bobs). I wrote this little program to calculate the surface area available for a
    gas to bind to inside a crystal structure. It reads in a couple of files, does a bit of maths based on the crystal structure then outputs a number. I got this working on my old computer in
    VS2008 (urg i know... ms, but it was just a stop gap.) I got a new beautiful computer, installed win7 n code::blocks and a whole bunch of compilers, of which I have tried all. I am getting
    SIGSEGV faults at line 13, which is the opening parenthesis to the main program, when i run it through the debugger and, unsurprisingly, it won't step any further through the program than
    that.....

    I am assuming it is a rookie mistake, thought I had made them all but there's always a better idiot, eh?

    Here's the code, which I am sure will be as helpful to you as is is for me but I see its the done thing to post ugly code and get it fixed here, enjoy:

    Code:
    UNNECESSARY CODE BLOCK
    Cheers if you help, cheers if you don't, at least you looked

    morb
    Last edited by morbidslug; 11-15-2010 at 08:45 AM. Reason: restarting code::blocks sorted it out....grrrr.

  2. #2
    Registered User
    Join Date
    Nov 2010
    Posts
    15
    Left the bug checking in there, sorry guys...

  3. #3
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    what is the backtrace? you can often still step with the debugger as long as you are remembering to use the 'step into' SHIFT+F7 at function calls, what is going on in these header files?
    #include "dataHub.h"
    #include "atomicData.h"
    #include "transformMatrix.h"
    #include <Eigen/Core>
    #include "RandomGenerator.h"
    You mean you wrote all this code and never compiled once along the way? i mean you would usually have an idea where things are going wrong based on the latest changes you made...
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  4. #4
    Registered User
    Join Date
    Nov 2010
    Posts
    15
    Ok, cheers for that, yes I tested my code, if you read my post you would have been able to tell that.

  5. #5
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    yes I tested my code, if you read my post you would have been able to tell that.
    Well maybe i would have, but nobody else will as you deleted it helpfully
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  6. #6
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Quote Originally Posted by rogster001 View Post
    Well maybe i would have, but nobody else will as you deleted it helpfully
    I find your comment strange. He took the hassle to report for people who'd search google and got to this thread that it was fixed by restarting C::B. The code was valid and it had nothing to do with the problem, so it's even better he removed it to make it easier for people to read...
    He did perfect here, in my opinion... Shows a lot of good will, explaining your own answer to people who might have the problem in the future.

  7. #7
    Registered User
    Join Date
    Nov 2010
    Posts
    15
    Sorry if I rubbed you the wrong way rogster...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Get faulting address on SIGSEGV
    By kruemelmonster in forum Linux Programming
    Replies: 12
    Last Post: 04-21-2009, 10:29 PM
  2. Causing and trapping SIGSEGV
    By ampersand11 in forum C Programming
    Replies: 2
    Last Post: 01-22-2008, 05:26 PM
  3. debugging: sigsegv, segmentation fault???
    By Gonzo in forum C Programming
    Replies: 9
    Last Post: 09-16-2003, 06:56 AM
  4. Living in the 00'S
    By mithrandir in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-21-2002, 09:31 AM
  5. Heaven, Hell, and Aetheists/Non-believers
    By Aran in forum A Brief History of Cprogramming.com
    Replies: 34
    Last Post: 09-10-2001, 02:18 PM