Professional Web Applications Themes

Segmentation fault need help - UNIX Programming

Hi, I am trying to run a program except I get the following segmentation fault. I don't know how to solve it. Please if you know could you please help. Thanks, Marcia Program received signal SIGSEGV, Segmentation fault. 0x0a6e6962 in ?? () (gdb) bt #0 0x0a6e6962 in ?? () Cannot access memory at address 0xa6d6461 (gdb)...

  1. #1

    Default Segmentation fault need help

    Hi,

    I am trying to run a program except I get the following segmentation fault.
    I don't know how to solve it. Please if you know could you please help.

    Thanks, Marcia



    Program received signal SIGSEGV, Segmentation fault.

    0x0a6e6962 in ?? ()

    (gdb) bt

    #0 0x0a6e6962 in ?? ()

    Cannot access memory at address 0xa6d6461

    (gdb)


    Marcia Guest

  2. #2

    Default Re: Segmentation fault need help

    "Marcia Hon" <com> writes:
     

    You have a corrupted stack. Look for buffer overflows in
    automatically allocated memory. Another typical cause is freeing
    automatic memory. It could also be caused by using an uninitialized
    pointer. A memory debugger like Electric Fence or (for PC) valgrind
    is useful for finding such bugs.

    --
    Måns Rullgård
    se
    Måns Guest

  3. #3

    Default Re: Segmentation fault need help

    Thanks.

    I don't know how to solve it your way. I would like to learn. I, however,
    solved it by sequentially putting printfs throughout the program!

    Thanks again for your help.
    Marcia


    Marcia Guest

  4. #4

    Default Re: Segmentation fault need help

    se (Måns Rullgård) writes:
     
     [/ref]

    Note that this is ASCII: "\nnib", doing "x/s $esp" may reveal the
    rest of the string which overflowed its buffer.
     

    Most definitely.
     

    Yes. I would bet 10:1 that this is a simple strcpy() into an
    automatic char array that is too small.
     

    That would cause a SIGSEGV *in* malloc/free, not a jump to ASCII.
     

    Or it could be that.
     

    EFence will not help with this kind of bug at all, valgrind might
    (if this is an uninitialized pointer, but not otherwize).

    Cheers,
    --
    In order to understand recursion you must first understand recursion.
    Remove /-nsp/ for email.
    Paul Guest

  5. #5

    Default Re: Segmentation fault need help

    Marcia Hon wrote: 

    You are getting out of hand. Please STOP the excessive
    cross-posting, and STOP posting OT matter, and START posting
    cut-down compilable complete programs not exceeding 100 lines when
    you need help. Failing this I suggest wholesale PLONKING, after
    which you will not be able to get help anywhere.

    For you, anything over one newsgroup is excessive crossposting.

    --
    Chuck F (com) (att.net)
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net> USE worldnet address!


    CBFalconer Guest

Similar Threads

  1. segmentation fault
    By marcelo in forum PostgreSQL / PGSQL
    Replies: 6
    Last Post: March 9th, 08:18 PM
  2. segmentation fault
    By jbadia in forum Sun Solaris
    Replies: 3
    Last Post: October 7th, 07:04 PM
  3. [PHP] Segmentation Fault
    By Jay Blanchard in forum PHP Development
    Replies: 0
    Last Post: August 15th, 06:21 PM
  4. 1.8.0 Segmentation fault
    By Graham Brooks in forum Ruby
    Replies: 0
    Last Post: July 28th, 08:07 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139