From: Simon Marchi <simark@simark.ca>
To: Jason Long <hack3rcon@yahoo.com>,
"gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: I'm a beginner and need help about "Segmentation fault" error.
Date: Thu, 5 Nov 2020 08:43:28 -0500 [thread overview]
Message-ID: <aa1b0c20-046f-aa65-16dd-22fadeabbf35@simark.ca> (raw)
In-Reply-To: <394886388.1091427.1604422440532@mail.yahoo.com>
On 2020-11-03 11:54 a.m., Jason Long via Gdb wrote:
> Hello,
> I'm using Debian 10.6 x86_64 and when I want to run a program then it show me "Segmentation fault" error.
> How can use gdb to find the reason of it?
> I used strace to generate an output and posted it here: https://pastebin.fun/NY4RUEmyzO
>
> I'm thankful if anyone advice me step by step.
>
> Thank you.
>
Hi Jason,
In its most simple expressioj, just load the program in GDB:
$ gdb <program>
and run it:
(gdb) run
If the program crashes (receives a SIGSEGV / segmentation fault signal),
it will stop and you'll be able to inspect the state of the program at
that moment. For example, you'll be able to use the "backtrace" command
to get an idea of wherwe the program was.
Simon
next prev parent reply other threads:[~2020-11-05 13:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <394886388.1091427.1604422440532.ref@mail.yahoo.com>
2020-11-03 16:54 ` Jason Long
2020-11-05 13:43 ` Simon Marchi [this message]
2020-11-06 18:10 ` Jason Long
2020-11-07 1:16 ` Simon Marchi
2020-11-09 11:55 ` Anton.Krug
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa1b0c20-046f-aa65-16dd-22fadeabbf35@simark.ca \
--to=simark@simark.ca \
--cc=gdb@sourceware.org \
--cc=hack3rcon@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).