Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* SIGILL under gdb for AIX 64 bit binaries
@ 2014-12-15  8:13 navin p
  2014-12-15  9:44 ` Jonas Maebe
  0 siblings, 1 reply; 2+ messages in thread
From: navin p @ 2014-12-15  8:13 UTC (permalink / raw)
  To: gdb

Hello,
       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.

       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 ?





Regards,
Navin


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: SIGILL under gdb for AIX 64 bit binaries
  2014-12-15  8:13 SIGILL under gdb for AIX 64 bit binaries navin p
@ 2014-12-15  9:44 ` Jonas Maebe
  0 siblings, 0 replies; 2+ messages in thread
From: Jonas Maebe @ 2014-12-15  9:44 UTC (permalink / raw)
  To: navin p; +Cc: gdb


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-15  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-15  8:13 SIGILL under gdb for AIX 64 bit binaries navin p
2014-12-15  9:44 ` Jonas Maebe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox