* SegFault @ 2009-01-08 14:59 Kolpur Srinivasa Chary 2009-01-08 15:00 ` SegFault Tom St Denis 0 siblings, 1 reply; 11+ messages in thread From: Kolpur Srinivasa Chary @ 2009-01-08 14:59 UTC (permalink / raw) To: gcc-help Hi, I got segmentation fault when I compiled a program with gcc, so I have run the executable file to gdb. When I tried running the program through gdb, it displayed the following message Program received signal SIGSEGV, Segmentation fault. 0x08048ccb in main () But why is it not telling me the line number at which segfault occured? Please help me regarding this issue. Regards, cnu ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: SegFault 2009-01-08 14:59 SegFault Kolpur Srinivasa Chary @ 2009-01-08 15:00 ` Tom St Denis 2009-01-08 15:03 ` SegFault Kolpur Srinivasa Chary 0 siblings, 1 reply; 11+ messages in thread From: Tom St Denis @ 2009-01-08 15:00 UTC (permalink / raw) To: Kolpur Srinivasa Chary; +Cc: gcc-help Kolpur Srinivasa Chary wrote: > Hi, > > I got segmentation fault when I compiled a program with gcc, so I have > run the executable file to gdb. > When I tried running the program through gdb, it displayed the following message > > Program received signal SIGSEGV, Segmentation fault. > 0x08048ccb in main () > > But why is it not telling me the line number at which segfault > occured? Please help me regarding this issue. > You have to compile with debug information turned on, try adding "-g3" to your build, also avoid adding strip or "-s" to your build. Tom ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: SegFault 2009-01-08 15:00 ` SegFault Tom St Denis @ 2009-01-08 15:03 ` Kolpur Srinivasa Chary [not found] ` <496616C3.6090802@ellipticsemi.com> 0 siblings, 1 reply; 11+ messages in thread From: Kolpur Srinivasa Chary @ 2009-01-08 15:03 UTC (permalink / raw) To: Tom St Denis; +Cc: gcc-help Hi Tom, I didn't get you ... can you please elaborate it.. please .. I am new to gdb .. Regards cnu On Thu, Jan 8, 2009 at 8:31 PM, Tom St Denis <tstdenis@ellipticsemi.com> wrote: > Kolpur Srinivasa Chary wrote: >> >> Hi, >> >> I got segmentation fault when I compiled a program with gcc, so I have >> run the executable file to gdb. >> When I tried running the program through gdb, it displayed the following >> message >> >> Program received signal SIGSEGV, Segmentation fault. >> 0x08048ccb in main () >> >> But why is it not telling me the line number at which segfault >> occured? Please help me regarding this issue. >> > > You have to compile with debug information turned on, try adding "-g3" to > your build, also avoid adding strip or "-s" to your build. > > Tom > ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <496616C3.6090802@ellipticsemi.com>]
* Re: SegFault [not found] ` <496616C3.6090802@ellipticsemi.com> @ 2009-01-08 15:19 ` Kolpur Srinivasa Chary 2009-01-08 15:27 ` SegFault Sven Eschenberg 0 siblings, 1 reply; 11+ messages in thread From: Kolpur Srinivasa Chary @ 2009-01-08 15:19 UTC (permalink / raw) To: Tom St Denis; +Cc: gcc-help Thanks for that information Tom, but what is the effect of -g3 option in gcc. Is it to get the line number where the error occcured when gdb was debugging ? Regards cnu On Thu, 2009-01-08 at 10:07 -0500, Tom St Denis wrote: > Kolpur Srinivasa Chary wrote: > > Hi Tom, > > I didn't get you ... can you please elaborate it.. please .. I am new to gdb .. > > > > When you compile your source, add -g3, e.g. > > gcc -g3 myfile.c -o myprog > gdb myprog > > Tom > > > > > Regards > > cnu > > > > On Thu, Jan 8, 2009 at 8:31 PM, Tom St Denis <tstdenis@ellipticsemi.com> wrote: > > > > > Kolpur Srinivasa Chary wrote: > > > > > > > Hi, > > > > > > > > I got segmentation fault when I compiled a program with gcc, so I have > > > > run the executable file to gdb. > > > > When I tried running the program through gdb, it displayed the following > > > > message > > > > > > > > Program received signal SIGSEGV, Segmentation fault. > > > > 0x08048ccb in main () > > > > > > > > But why is it not telling me the line number at which segfault > > > > occured? Please help me regarding this issue. > > > > > > > > > > > You have to compile with debug information turned on, try adding "-g3" to > > > your build, also avoid adding strip or "-s" to your build. > > > > > > Tom > > > > > > > > > > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: SegFault 2009-01-08 15:19 ` SegFault Kolpur Srinivasa Chary @ 2009-01-08 15:27 ` Sven Eschenberg 0 siblings, 0 replies; 11+ messages in thread From: Sven Eschenberg @ 2009-01-08 15:27 UTC (permalink / raw) To: gcc-help The effect is (as Tom said) that specific debug symbols will be added, which are not needed for execution, but help the debugger during the debugging process, as well as the human trying to understand the debuggers output. Regards -Sven P.S.: Yes, this might include line numbers and/or function names etc. Kolpur Srinivasa Chary schrieb: > Thanks for that information Tom, but what is the effect of -g3 option in > gcc. Is it to get the line number where the error occcured when gdb was > debugging ? > > Regards > cnu > > On Thu, 2009-01-08 at 10:07 -0500, Tom St Denis wrote: >> Kolpur Srinivasa Chary wrote: >>> Hi Tom, >>> I didn't get you ... can you please elaborate it.. please .. I am new to gdb .. >>> >> When you compile your source, add -g3, e.g. >> >> gcc -g3 myfile.c -o myprog >> gdb myprog >> >> Tom >> >> >> >>> Regards >>> cnu >>> >>> On Thu, Jan 8, 2009 at 8:31 PM, Tom St Denis <tstdenis@ellipticsemi.com> wrote: >>> >>>> Kolpur Srinivasa Chary wrote: >>>> >>>>> Hi, >>>>> >>>>> I got segmentation fault when I compiled a program with gcc, so I have >>>>> run the executable file to gdb. >>>>> When I tried running the program through gdb, it displayed the following >>>>> message >>>>> >>>>> Program received signal SIGSEGV, Segmentation fault. >>>>> 0x08048ccb in main () >>>>> >>>>> But why is it not telling me the line number at which segfault >>>>> occured? Please help me regarding this issue. >>>>> >>>>> >>>> You have to compile with debug information turned on, try adding "-g3" to >>>> your build, also avoid adding strip or "-s" to your build. >>>> >>>> Tom >>>> >>>> >>> ^ permalink raw reply [flat|nested] 11+ messages in thread
[parent not found: <9ab7eeeb0812090635ndc60ecfl5fe2e3bcd25e20ef@mail.gmail.com>]
[parent not found: <C563E3CB.36815%eljay@adobe.com>]
* Re: segfault [not found] ` <C563E3CB.36815%eljay@adobe.com> @ 2008-12-09 15:15 ` Leonardo Santagostini 2008-12-09 17:04 ` segfault John Fine 0 siblings, 1 reply; 11+ messages in thread From: Leonardo Santagostini @ 2008-12-09 15:15 UTC (permalink / raw) To: John (Eljay) Love-Jensen, gcc-help Well well well. Thanks for the answers, i will do the following things: 1) To read and learn how to use the GDB :D !! 2) Compile -g3 RGPVISAServer 3) Attach gdb to a runnig RGPVISAServer process to see what is doing wrong. Well, after finish i will publish my error, thanks for support me !!!! Yours Leonardo 2008/12/9 John (Eljay) Love-Jensen <eljay@adobe.com>: > Hi Leonardo, > >> So, i must review the entire code to view where the error is ? > > You can use a debugger, such as gdb. From there you should be able to get some interesting information either using gdb with the running RGPVISAServer application, or by using gdb on the core dump (if there was a core dump). > >> RGPVISAServer[4299] general protection rip:4082f2 rsp:413fca08 error:0 > > RGPVISAServer is the application that crashed. > 4299 is the PID of the application that crashed. > general protection is why the application crashed. > rip:4082f2 is the instruction pointer when the crash happened. > rsp:413fca08 is the stack pointer when the crash happened. > error:0 is the errno value when the crash happened. > > Sincerely, > -Eljay > > On 12/9/08 8:35 AM, "Leonardo Santagostini" <lsantagostini@gmail.com> wrote: > > Hello John (Eljay): > > So, i must review the entire code to view where the error is ? > I was viewing my messages and i found this: > > RGPVISAServer[4299] general protection rip:4082f2 rsp:413fca08 error:0 > > Its very dificult to me to understang this error codes, mmmm i think > im needing some king of enlightenment. > > Thanks for the response, > Yours Leonardo > > 2008/12/9 John (Eljay) Love-Jensen <eljay@adobe.com>: >> Hi Leonardo, >> >>> Anybody can give me a clue about this ? >> >> It appears that your RGPVISAServer application has a NULL pointer somewhere, and it is dereferencing that NULL pointer, causing a segfault (and program termination). >> >>> Maybe i must compile without optimization ?? >> >> Maybe. >> >> But more efficacious would be to remove the bug from the code. >> >> Sincerely, >> -Eljay >> > > > > -- > Saludos.- > Leonardo Santagostini > > -- Saludos.- Leonardo Santagostini ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: segfault 2008-12-09 15:15 ` segfault Leonardo Santagostini @ 2008-12-09 17:04 ` John Fine 2008-12-09 19:15 ` segfault Leonardo Santagostini 0 siblings, 1 reply; 11+ messages in thread From: John Fine @ 2008-12-09 17:04 UTC (permalink / raw) To: Leonardo Santagostini; +Cc: John (Eljay) Love-Jensen, gcc-help For most segfaults, I find it easier to use ulimit to make coredumps temporarily unlimited, then rerun the original program to fail again, but now that will generate a core file. Then open the image and core file together in gdb. You don't need much gdb knowledge (more than I remember right now, but still not much) to get a backtrace (call stack from the failure point up through main). Usually that is enough to identify the exact bug. If it isn't, then you build with more debug info and use gdb in more challenging ways. Leonardo Santagostini wrote: > Thanks for the answers, i will do the following things: > > 1) To read and learn how to use the GDB :D !! > 2) Compile -g3 RGPVISAServer > 3) Attach gdb to a runnig RGPVISAServer process to see what is doing wrong. > > Well, after finish i will publish my error, thanks for support me !!!! > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: segfault 2008-12-09 17:04 ` segfault John Fine @ 2008-12-09 19:15 ` Leonardo Santagostini 0 siblings, 0 replies; 11+ messages in thread From: Leonardo Santagostini @ 2008-12-09 19:15 UTC (permalink / raw) To: John Fine; +Cc: John (Eljay) Love-Jensen, gcc-help Hello Folks !!! I have my mind broken in pieces, but i must assume i dont have enough skill. Sorry for bother you. Sincerelly Leonardo If someone wants to help me i will really appreciate 2008/12/9 John Fine <johnsfine@verizon.net>: > For most segfaults, I find it easier to use ulimit to make coredumps > temporarily unlimited, then rerun the original program to fail again, but > now that will generate a core file. > > Then open the image and core file together in gdb. You don't need much gdb > knowledge (more than I remember right now, but still not much) to get a > backtrace (call stack from the failure point up through main). Usually that > is enough to identify the exact bug. > > If it isn't, then you build with more debug info and use gdb in more > challenging ways. > > > Leonardo Santagostini wrote: >> >> Thanks for the answers, i will do the following things: >> >> 1) To read and learn how to use the GDB :D !! >> 2) Compile -g3 RGPVISAServer >> 3) Attach gdb to a runnig RGPVISAServer process to see what is doing >> wrong. >> >> Well, after finish i will publish my error, thanks for support me !!!! >> >> > > -- Saludos.- Leonardo Santagostini ^ permalink raw reply [flat|nested] 11+ messages in thread
* segfault @ 2008-12-09 13:59 Leonardo Santagostini 2008-12-09 14:22 ` segfault Tom St Denis 2008-12-09 14:26 ` segfault John (Eljay) Love-Jensen 0 siblings, 2 replies; 11+ messages in thread From: Leonardo Santagostini @ 2008-12-09 13:59 UTC (permalink / raw) To: gcc-help Hello all I have the following problem: kernel: RGPVISAServer[15121]: segfault at 0000000000000000 rip 000000394dd2a089 rsp 0000000048c089f0 error 4 Im using Linux localhost 2.6.9-67.ELsmp #1 SMP Fri Nov 16 12:49:06 EST 2007 x86_64 x86_64 x86_64 GNU/Linux with gcc --version gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-9) Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. CentOS release 4.6 (Final) on a dual quad core with 3 Gb RAM Anybody can give me a clue about this ? Im compiling from a make with these lines inside makefile: COMPILER=gcc -g -Wall -O3 -I/usr/include/libxml2/ LIBS=-lpq -lpthread -lssl -lcrypto -lxml2 Maybe i must compile without optimization ?? Thanks -- Saludos.- Leonardo Santagostini ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: segfault 2008-12-09 13:59 segfault Leonardo Santagostini @ 2008-12-09 14:22 ` Tom St Denis 2008-12-09 14:26 ` segfault John (Eljay) Love-Jensen 1 sibling, 0 replies; 11+ messages in thread From: Tom St Denis @ 2008-12-09 14:22 UTC (permalink / raw) To: Leonardo Santagostini; +Cc: gcc-help Leonardo Santagostini wrote: > Hello all > > I have the following problem: > > kernel: RGPVISAServer[15121]: segfault at 0000000000000000 rip > 000000394dd2a089 rsp 0000000048c089f0 error 4 > I assume RGPVISAServer is some sort of application you are trying to build? This isn't strictly a gcc-help question (unless you know for a fact that the program shouldn't segfault). Have you tried running it under a debugger? Usually changing the optimization level just serves to expose/hide bugs in your code rather than the compiler itself. Tom ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: segfault 2008-12-09 13:59 segfault Leonardo Santagostini 2008-12-09 14:22 ` segfault Tom St Denis @ 2008-12-09 14:26 ` John (Eljay) Love-Jensen 1 sibling, 0 replies; 11+ messages in thread From: John (Eljay) Love-Jensen @ 2008-12-09 14:26 UTC (permalink / raw) To: Leonardo Santagostini, GCC-help Hi Leonardo, > Anybody can give me a clue about this ? It appears that your RGPVISAServer application has a NULL pointer somewhere, and it is dereferencing that NULL pointer, causing a segfault (and program termination). > Maybe i must compile without optimization ?? Maybe. But more efficacious would be to remove the bug from the code. Sincerely, -Eljay ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2009-01-08 15:27 UTC | newest] Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-01-08 14:59 SegFault Kolpur Srinivasa Chary 2009-01-08 15:00 ` SegFault Tom St Denis 2009-01-08 15:03 ` SegFault Kolpur Srinivasa Chary [not found] ` <496616C3.6090802@ellipticsemi.com> 2009-01-08 15:19 ` SegFault Kolpur Srinivasa Chary 2009-01-08 15:27 ` SegFault Sven Eschenberg [not found] <9ab7eeeb0812090635ndc60ecfl5fe2e3bcd25e20ef@mail.gmail.com> [not found] ` <C563E3CB.36815%eljay@adobe.com> 2008-12-09 15:15 ` segfault Leonardo Santagostini 2008-12-09 17:04 ` segfault John Fine 2008-12-09 19:15 ` segfault Leonardo Santagostini -- strict thread matches above, loose matches on Subject: below -- 2008-12-09 13:59 segfault Leonardo Santagostini 2008-12-09 14:22 ` segfault Tom St Denis 2008-12-09 14:26 ` segfault John (Eljay) Love-Jensen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).