-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Hi all,
I am currently debugging an application with valgrind in a raspberry pi and I came across some "Illegal Instructions" issues on "libcoreclr.so".
Not sure if these instructions are actually being executed, however, as they are being detected by valgrind, an "Illegal Instruction" signal is being raised.
See the messages below:
The first one concerns to sub.w instruction: SP is being used in Rd position and r8 in Rn (according to the ISA, if SP is being used as Rd, SP should also be in Rn, see http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/BABFFEJF.html).
done.
0x04000a30 in _start () from /lib/ld-linux-armhf.so.3
(gdb) c
Continuing.
[New Thread 17257]
Thread 1 received signal SIGILL, Illegal instruction.
0x05f837fe in _DacGlobals::InitializeEntries(unsigned int) () from /home/pi/workspace-00032/edge/libcoreclr.so
(gdb) x/i $pc
0x5f837ff <_ZN11_DacGlobals17InitializeEntriesEj+3262>: sub.w sp, r8, #80 ; 0x50
I managed to bypass this SIGILL by patching valgrind, explicitly allowing this constraint (this probably shouldn`t be done). However, another SIGILL was raised, but this time it was located elsewhere.
(gdb) c
Continuing.
[New Thread 4291]
Thread 1 received signal SIGILL, Illegal instruction.
0x23f7d48e in ?? ()
(gdb) x/i $pc
0x23f7d48f: ldmia.w sp!, {lr}
(gdb)
Apparently, this one concerns to the use of only one register in the register list in instruction LDMIA. For more information, see: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489g/Cihcadda.html.
I wonder if these instructions are being emmited by the JIT compiler, or maybe this is a CLANG issue.
Thanks in advance!
PS:
more info about my environment:
First, I am running a container to publish my app. The app publishing process is located in build.sh.
docker run -v %ProductContainersFolder%:/product_containers --rm mcr.microsoft.com/dotnet/core/sdk:3.1 bash /product_containers/build.sh
The "dotnet publish" command is described below:
dotnet publish -c Release --framework netcoreapp3.1 -r linux-arm --self-contained yes --output .....
After publishing the app, I`m copying the whole environment (app+runtime+libs including libcoreclr.so) to my raspberry to run it there.
It's important to note that, if I don`t use valgrind, my application runs without problems on raspberry.
category:correctness
theme:codegen
skill-level:beginner
cost:small