Science Fair Projects Ideas - SIGILL

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

SIGILL


ILL_ILLOPN illegal operand
ILL_ADR illegal addressing mode
ILL_ILLTRP illegal trap
ILL_PRVOPC privileged opcode
ILL_PRVREG privileged register
ILL_COPROC coprocessor error
ILL_BADSTK internal stack error

SIGILL is the symbolic signal name for the signal sent to computer programs that attempt to execute malformed, unknown, or privileged instructions on POSIX compliant platforms. SIGILL is a symbolic constant defined in signal.h. Symbolic signal names are used as signal numbers can vary across platforms.

Contents

Etymology

SIG- is a common prefix for signal names, ILL is a Contraction of Illegal Instruction.

Description

There are many possible reasons for receiving a SIGILL, a common mistake involves accidentally overwriting stack data with a return address that points to data not meant to be executed. Other problems might involve compiler (toolchain) bugs, filesystem corruption or attempting to execute instructions that require special privileges.

Many platforms implement new instructions or provide additional registers on subsequent hardware revisions, applications compiled for more recent hardware may generate Illegal Instructions on previous revisions that do not recognise the new opcodes. An example might be attempting to use MMX instructions on an Intel 80486 processor that didn't support the feature.

SIGILL can also be generated by users with the appropriate permissions, using the kill() system call.

SIGILL can be handled, that is, programmers can specify the action they would like to occur on receiving a SIGILL, such as execute a subroutine, ignore the event, or restore the default behaviour.

Note that under certain circumstances, attempting to ignore a SIGILL can result in Nasal demons.

Example

Here is an example of an ANSI C program that should attempt to execute an Illegal Instruction on platforms where 0xffffffff is not an valid opcode.

int main()
{
   unsigned char insn[4] = { 0xff, 0xff, 0xff, 0xff };
   void (*function)() = (void (*)()) insn;
   function();
}

Compiling and running it on IA-32 with Linux produces the following:

$ gcc -o sigill sigill.c
$ ./sigill
Illegal instruction (core dumped)

Backtrace from gdb:

Program received signal SIGILL, Illegal instruction.
0xbfffede4 in ?? ()
(gdb) bt
#0  0xbfffede4 in ?? ()
#1  0x0804837f in main ()
(gdb) display /i $eip
1: x/i $eip  0xbfffede4:        (bad)  

note (bad), indicating the opcodes do not make sense, the mnemonic representing the instruction would normally be displayed here.

Compare

See Also


10-26-2009 08:16:03
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice