Sysprogs forums › Forums › VisualGDB › VisualGDB Android SIGILL When Starting to Debug
- This topic has 5 replies, 3 voices, and was last updated 10 years, 11 months ago by Wartortle.
-
AuthorPosts
-
December 20, 2013 at 17:13 #705WartortleParticipant
Hi,
I’m trying to run VisualGDB from VS2010 with HTC Desire HD running 2.3.5 but it fails to start and aborts with a SIGILL Illegal Instruction at the point where it tries to load the native library (so) for my app:
< 12-20 16:55:40.086 22471 22471 ActivityThread Application com.inspyra.qpix is waiting for the debugger on port 8100...
12-20 16:55:40.096 22471 22471 System.out Sending WAIT chunk
12-20 16:55:45.471 22471 22475 dalvikvm Debugger is active
12-20 16:55:45.561 22471 22471 System.out Debugger has connected
12-20 16:55:45.561 22471 22471 System.out waiting for debugger to settle…
12-20 16:55:45.751 22471 22471 System.out waiting for debugger to settle…
12-20 16:55:45.952 22471 22471 System.out waiting for debugger to settle…
12-20 16:55:46.152 22471 22471 System.out waiting for debugger to settle…
12-20 16:55:46.352 22471 22471 System.out waiting for debugger to settle…
12-20 16:55:46.552 22471 22471 System.out waiting for debugger to settle…
12-20 16:55:46.752 22471 22471 System.out waiting for debugger to settle…
12-20 16:55:46.952 22471 22471 System.out waiting for debugger to settle…
12-20 16:55:47.153 22471 22471 System.out waiting for debugger to settle…
12-20 16:55:47.353 22471 22471 System.out waiting for debugger to settle…
12-20 16:55:47.393 22471 22475 dalvikvm Debugger has detached; object registry had 24 entries
12-20 16:55:47.563 22471 22471 jdwp dvmJdwpLastDebuggerActivity: no active debugger
12-20 16:55:47.563 22471 22471 System.out debugger detached?
12-20 16:55:47.613 22471 22476 dalvikvm Total arena pages for JIT: 11
12-20 16:55:47.703 22471 22471 dalvikvm Trying to load lib /data/data/com.inspyra.qpix/lib/libqpixandroid.so 0x4051e768
<
The app runs just fine if I run it directly on the device i.e. not through the debugger.As far as I can tell, everything in terms of how the machine is set up is okay. For example, if I connect a Samsung Galaxy S2 running Android 4.1 the debugger works just fine.
I’ve not been able to find any help/info on the Web so anything you can offer would be most appreciated.
Regards,
RocDecember 20, 2013 at 20:06 #2851ketParticipantHi,
Does your library use NEON instructions and the device does not support them? Sometimes libraries test the CPU instruction set when loaded and will determine which instruction set to use based on the SIGILL signal.
Have you tried ignoring the signal and continuing?
GDB will by default stop at all such signals. You can try adding the following to the GDB startup command page in VisualGDB Project Properties:
handle SIGILL nostop pass
You can find more information on handling signals in GDB here:
https://sourceware.org/gdb/onlinedocs/gdb/Signals.html
Please note that an issue was recently fixed with the GDB startup command page in VisualGDB, so please make sure you are using at least version 4.1.r8 before using GDB startup.You can also try understanding what gives the SIGILL signal, when the signal happens instead of continuing break and look at the call stack and disassembly to understand what function gives it.
January 7, 2014 at 15:02 #2855WartortleParticipantHi and sorry for the delay in responding.
I’ve tried the suggestions and nothing has worked.
Currently, VisualGDB v4.1.r9 is installed. I’ve tried the adding handle SIGILL nostop pass to the startup page but it only manages to limp on for a little while and then dies with a SIGSTOP followed by a SIGCONT.
In terms of the instructions, I don’t believe I’m using anything involving Neon as I’m not defining anything to be compiled with Neon support.
I’ve attached a screenshot from within VS2010 that shows the instruction and callstack it’s failing on. Alas, I’m none the wiser as I can’t really see much of what is going on here.
As I said in the first instance, the app manages to run just fine if I launch it manually on the device itself by clicking on the App’s Icon rather than running through the debugger.
It’s all quite strange, really.
Roc
January 8, 2014 at 20:05 #2854ketParticipantHi,
Firstly, please try deleting the folder “C:/Users/Steve/AppData/Local/VisualGDB/AndroidBinaryCache/HT0B2RX05487” with all its contents and then try debugging again.
If this does not work, then please remove all handle signal commands from the startup page. Please enable gdb logging on the GDB settings page and start debugging. Let the SIGILL happen, make a screenshot like you made before (showing the disassembly and call stack) and stop debugging. Then please give us the gdb log from your project directory and the screenshot.
January 22, 2014 at 21:25 #2852FireyTeeJParticipantI have been having the same problem trying to build an snmp agentx subagent on a Raspberry Pi. Even the basic HelloWorld project causes a SIGILL fault as soon as the net-snmp libraries are included in the link without any attempt to call any snmp functions, and before the main() function entry point is reached.
Because this is on an XP machine I presume the above advice to clear local application data refers to C:Documents and SettingstjLocal SettingsApplication DataVisualGDBRemoteSourceCache192.168.44.50 which had a collection of numbered subdirectories created from an earlier project.
I have deleted all of these and now – although I still get the SIGILL – the program does actually ‘continue’ into the main() function.
The SIGILL occurs in the crypto.so library.
There is no sign of any error if the program is run directly on the PiJanuary 22, 2014 at 22:05 #2853ketParticipantHi,
The crypto.so library could be running some initialization code when it is loaded even if you are not calling any functions from it. It is common for libraries to test instruction set availabilities when initializing.
By default gdb will stop at any signals such as SIGILL. When you are just running the program the SIGILL signal happens as well, but the library handles it silently and remembers that this instruction is not available. -
AuthorPosts
- You must be logged in to reply to this topic.