Bug #2755
closedndnsec error: executing ndnsec key-gen id: Illegal Instruction
0%
Description
I am working with ndn on Galileo.
When executing ndnsec key-gen id
An error message occur, saying Illegal Instruction
I can't have this error because nfd-start need this.
Also, I am not sure which exactly function gave this error?
I am guessing it is KeyChain::generateKeyPair
called by keyChain.generateRsaKeyPair
Also what does this error message mean? I do have sqlite3 installed on my Galileo and is runnable.
Also, I am executing everything with root identity.
Updated by Junxiao Shi over 9 years ago
- Category changed from Management to Security
Please obtain a stacktrace with GDB, so that you can see which function throws.
Updated by Anche Kuo over 9 years ago
gdb is a monstrous thing for an embedded system @@
If I really have to guess I'll do it.
But any guess? Is this message a very common error message? It is strictly related to operation on sqlite? or any other guess?
Updated by Davide Pesavento over 9 years ago
Anche Kuo wrote:
gdb is a monstrous thing for an embedded system @@
Learn how to use gdbserver
...
In any case this is not a thrown exception. It's the SIGILL signal, meaning that the program is trying to execute an invalid instruction (e.g. garbage or an instruction not supported by the current CPU), or a privileged instruction. Most likely the cross-compilation was done incorrectly (e.g. you targeted the wrong ISA), or there was a stack overflow.
Updated by Anche Kuo over 9 years ago
Most likely the cross-compilation was done incorrectly (e.g. you targeted the wrong ISA), or there was a stack overflow.
I've checked my environment, and it is not clear where I might be wrong... After all Yocto BSP is provided by Intel specifically for their Galileo..
In any case, do you think I can cross compile the ndn-cxx libraries with local python? Because in my cross compilation environment, many python module are missing, so I decided to just use the python from my local machine (I thought it's fine, because waf is only a make tool..)
export PYTHONHOME=/usr
/usr/bin/python waf configure --with-cryptopp=$PKG_CONFIG_SYSROOT_DIR --boost-includes=$PKG_CONFIG_SYSROOT_DIR/usr/include/ --boost-libs=$PKG_CONFIG_SYSROOT_DIR/usr/lib/ --prefix=$PKG_CONFIG_SYSROOT_DIR/usr/
Could this be the cause of problem?
Updated by Anche Kuo over 9 years ago
Problem resolved
After analyzing core dump the problem is with cryptopp's Makefile.
Delete a few lines in the makefile and recompile everything worked
Updated by Anche Kuo over 9 years ago
The solution is here
http://schwannden.gitbooks.io/ndn-on-galileo/content/building_ndn.html
basically libcryptopp's makefile appends -march=native
to CXXFLAGS
, overwriting -march=i586
from environment-setup-i586-poky-linux-uclibc
. After deleting some lines, the compiled libary should work correctly.