From: Jonas Maebe <jonas.maebe@elis.ugent.be>
To: navin p <navinp1281@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: SIGILL under gdb for AIX 64 bit binaries
Date: Mon, 15 Dec 2014 09:44:00 -0000 [thread overview]
Message-ID: <BFDEB7BD-6BB9-40C6-9B97-6EB46570E5C3@elis.ugent.be> (raw)
In-Reply-To: <CAKVd3pUAfRxcpVRbxoP+eWKqv9azQHzYod2qdooNG4bwPCDxVg@mail.gmail.com>
On 15 Dec 2014, at 09:12, navin p wrote:
> When i run a program on command line it runs fine. But when i
> run it gdb it gives me a SIGILL.
> I know that is a problem with the code because dbx for AIX also
> gives the SIGILL instruction.
> But i've been not able to convince people in my organization it
> is a problem with code.
Executing an instruction is a standard technique to determine whether
the cpu supports it (e.g. to detect whether an ARM cpu supports
prefetching instructions). The way this works is that the program
installs a signal handler for the SIGILL signal, executes the
potentially unsupported instruction, and sets a global variable inside
the signal handler, and then returns to the instruction after the
unsupported instruction. So by checking that variable after attempting
to execute that instruction, you can know whether the cpu supported it
or not.
> What they do is they 'c' (continue) in gdb when it hits a
> SIGILL and keep on continuing 2 times until it crashes somewhere else
> in the code.
>
> I wanted to know these 2 questions :
>
> 1) Once it hits a SIGILL can we continue and go to the next
> crash and so on ? Is this valid .
>
> 2) How does gdb allow to continue on a SIGILL ?
type
handle SIGILL
You will see something like
Signal Stop Print Pass to program Description
SIGILL Yes Yes Yes Illegal instruction
"Stop = Yes" means that gdb will stop when the program triggers a
SIGILL. "Print = Yes" means that gdb will print a message telling you
that it stopped because of a SIGILL. "Pass to program = Yes" means
that after you continue the execution, the SIGILL will be passed on to
the program itself, so that its SIGILL handler will be executed. If it
did not install a SIGILL handler, it will simply be killed.
This means that if your program keeps executing once you continue
after receiving a SIGILL, it handled the SIGILL in a signal handler
and continued normally. As a result, it's probably expected behaviour.
Jonas
prev parent reply other threads:[~2014-12-15 9:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-15 8:13 navin p
2014-12-15 9:44 ` Jonas Maebe [this message]
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=BFDEB7BD-6BB9-40C6-9B97-6EB46570E5C3@elis.ugent.be \
--to=jonas.maebe@elis.ugent.be \
--cc=gdb@sourceware.org \
--cc=navinp1281@gmail.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