Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hmm the only time I've seen this was when I was using GCC to compile an app for an AMD CPU, but I chose an Intel CPU target.
This -might- be the cause of the "illegal instruction" you are getting - what happened to me whenever I tried to run the "Intel" binary on my AMD machine was that the binary tried to execute Intel specific instructions on an AMD architecture, which of course did not work.
i found the difference that one is GNU/Linux 2.0.0, the other one is GNU/Linux 2.4.3. And the former one can run in my board, but the latter produce "illegal instruction". So what's the meanning of GNU/Linux 2.0.0. it refers to what version? Thanks!!!
i have used gdb to debug my code. The reason it is crashing is a floating point divide by zero. The result should be NaN (or Infinity). It should not throw an exception. So, how to get this working.
My test code:
Code:
#include <stdio.h>
int main() {
double a, b;
a=1.0;
printf("BEFORE\n");
b=0.0;
a=a/b;
printf("Result %5.2f\n",a);
The result is:
Code:
BEFORE
Illegal instruction
The actual mistake code:
Code:
Program received signal SIGILL, Illegal instruction.
0x00099a30 in ejsCreateNumberType (ejs=0x1baf10) at ejsLib.c:8753
8753 ejs->infinityValue->value = 1.0 / zero;
(gdb) bt
#0 0x00099a30 in ejsCreateNumberType (ejs=0x1baf10) at ejsLib.c:8753
#1 0x000d5990 in createTypes (ejs=0x1baf10) at ejsLib.c:30934
#2 0x000d6050 in defineTypes (ejs=0x1baf10) at ejsLib.c:31127
#3 0x000d56e0 in ejsCreate (ctx=0x1bac60, master=0x0,
searchPath=0x1bad28 "/mnt/jffs2/appweb/src/lib/appweb/bin/modules",
flags=32) at ejsLib.c:30852
#4 0x000dd0d4 in ejsOpenWebFramework (control=0x1bab38, useMaster=1)
at ejsLib.c:33936
#5 0x00035978 in maEjsHandlerInit (http=0x1b8b80, path=0x0) at ejsAppweb.c:867
#6 0x00018658 in maLoadStaticModules (http=0x1b8b80) at link.c:38
#7 0x00010f40 in maCreateServer (http=0x1b8b80, name=0x181ff4 "default",
root=0x181f8c ".", ipAddr=0x0, port=-1) at server.c:455
#8 0x0000bcec in main (argc=1, argv=0xbefc7c64) at appweb.c:233
The error code sent from kernel has limit reason, it hasn't NaN code.
You mean my kernal cannot recognize NaN code, so NaN code is seen as Illegal instruction. How can i deal with this problem? All linux kernal cannot recognize NaN code? Can i directly change 1.0/zero to a very very max value?
Thanks!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.