Thread: segmentation fault depending on location of file

  1. #16
    Registered User
    Join Date
    Oct 2017
    the dots are just a list of functions that get compiled in special cases, which I am not using.
    but the g option helped, thank you, I have managed to track down in which function it actually fails.
    So the script is a part of a C-based software that I have to use as my student project. I cannot upload the entire software, firstly because it is just too large, secondly even if I could, I am not the author so I suppose I am not allowed.
    The part of it that I am debugging reads files and checks their internal format and references them to each other, most of information is saved as structures.

    The main scrip that I am compiling is called scapu calls a function scapu_sub. scapu_sub calls batreffix to reference my input files a and b from the initial post. At this point both files a and b had been read in by about 50 other functions.
    So I wrote bt after gbd like suggested in previous post and from this debugging output, does it mean that I have problems in each of the #0 #1 #2 #3 or only in the first one since it is the subfunction?

    #0  0x00000000004899a3 in batreffix ()
    #1  0x000000000042d2a6 in scapu_sub ()
    #2  0x00000000004028fc in submain (argc=4, argv=0x7fffffffb6d8) at ../src/scapu.c:371
    #3  0x000000000040184f in main (argc=4, argv=0x7fffffffb6d8) at ../src/scapu.c:83
    Last edited by Layla_E; 03-07-2019 at 12:36 PM.

  2. #17
    Registered User
    Join Date
    Dec 2017
    The problem is ultimately being detected (causing a segfault?) in batreffix. But it may originate somewhere else. I don't know why it isn't giving you the line number in batreffix, though.
    The errors of great men are venerable because they are more fruitful than the truths of little men. - Nietzsche

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 10-28-2014, 10:01 PM
  2. Reading from file, segmentation fault
    By atac in forum C Programming
    Replies: 2
    Last Post: 05-08-2013, 10:34 PM
  3. Segmentation fault in Header file
    By Marc Oleson in forum C Programming
    Replies: 12
    Last Post: 04-26-2013, 05:39 PM
  4. Segmentation Fault. When trying to open file.
    By guyle in forum C Programming
    Replies: 5
    Last Post: 02-25-2013, 12:55 PM
  5. Segmentation fault with a file pointer?
    By Matt13 in forum C Programming
    Replies: 14
    Last Post: 07-31-2004, 05:53 AM

Tags for this Thread