Я проверяю мою в Valgrind-анкету я не могу понять, почему он выдает ошибку на непризнанном инструкции в этом здесь:Valgrind unrecognizes memcmp обучения в Raspberry Pi
unsigned char *temp=SearchStartPtr;
unsigned char *NrStartPos=NULL;
unsigned char *Param=(unsigned char*)ParamName; //this is originally *char with "PAR#" inside
if(0==memcmp(temp,Param,4))
{
NrStartPos=temp;
break;
}
Valgrind бросает это и выходит из моего приложения.
disInstr(arm): unhandled instruction: 0xF1010200
cond=15(0xF) 27:20=16(0x10) 4:4=0 3:0=0(0x0)
==7679== valgrind: Unrecognised instruction at address 0x4843588.
==7679== at 0x4843588: ??? (in /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so)
Your program just tried to execute an instruction that Valgrind
==7679== did not recognise. There are two possible reasons for this.
==7679== 1. Your program has a bug and erroneously jumped to a non-code
==7679== location. If you are running Memcheck and you just saw a
==7679== warning about a bad jump, it's probably your program's fault.
==7679== 2. The instruction is legitimate but Valgrind doesn't handle it,
==7679== i.e. it's Valgrind's fault. If you think this is the case or
==7679== you are not sure, please let us know and we'll try to fix it.
==7679== Either way, Valgrind will now raise a SIGILL signal which will
==7679== probably kill your program.
==7679==
==7679== Process terminating with default action of signal 4 (SIGILL)
==7679== Illegal opcode at address 0x4843588
==7679== at 0x4843588: ??? (in /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so)
Обычно код работает нормально (однако я не знаю, есть ли у него какие-либо утечки памяти).
Я точно знаю, что проблема - инструкция memcmp, но я не понимаю, что не так.
Ранее в коде у меня есть другая инструкция, которая делала то же самое, но я мог бы просто прокомментировать его прочь перед проверкой:
memcmp(ReadPtr,ToWritePtr,sizeof(struct termios)
Если вы прочтете сообщение более внимательно, он скажет, что обнаружил незаконную инструкцию (например, инструкцию по сборке). 'memcmp' - это функция, а не инструкция. Кроме того, Valgrind утверждает, что эта незаконная инструкция была найдена в '/ usr/lib/arm-linux-gnueabihf/libcofi_rpi.so', вряд ли файл, который вы создали, я бы рискнул. –