AlEmerich
AlEmerich

Reputation: 440

Illegal Instruction in exe_common.inl

This is about a week I am trying to solve my problem and I really need help. I hope someone will find what is wrong with my setup.

(I am french so I apologize for any English mistakes)

CONTEXT

I have a Visual Studio Project which has been developed from OpenFace, a free open-source library, downloaded at that address:https://github.com/TadasBaltrusaitis/OpenFace . "Developed from" because the project just uses the code of OpenFace. I precise that the project was not made by me, I checked out from a private repository.

PROBLEM

My project build an executable but not run, stopped by an illegal instruction at the file exe_common.inl (don't know what this file is) at the line 223, before getting into in the entry point of my programm (cout << " " << endl at the very beggining of the main() function is not executed).

Here is the guilty line:

__scrt_current_native_startup_state = __scrt_native_startup_state::initialized;

Here the stack trace at that breakpoint:

CamFeaturesExtractor_Affich.exe!dlib::get_global_clock(void)
CamFeaturesExtractor_Affich.exe!00007ff63493114e()
ucrtbase.dll!_initterm()
CamFeaturesExtractor_Affich.exe!__scrt_common_main_seh() line 223
kernel32.dll!BaseThreadInitThunk()
ntdll.dll!RtlUserThreadStart()

Here the exact message exception:

Unhandled exception at 0x00007FF63499C5B7 in CamFeaturesExtractor_Affich.exe: 0xC000001D: Illegal Instruction.

WHAT I TRIED

That problem doesn't appear on some more recent computer (check below for my spec) so my first guess is to say that is a hardware problem. The exception is not triggered on Intel Cord Duo I5 (with same model of computer than mine). Here is my specs:

Edition : Windows 10 Professionel
Version : 1511
OS Version : 10586.679
Processor : Intel(R) Celeron(R) CPU 2950M @ 2.00 GHz 2.00 GHz
RAM : 4G
System type : OS 64 bits, processeur x64

If the problem comes from my poor processor doesn't have the instruction, is there a workaround or I need to change my computer ? Let me know if you need some informations I forgot to provide and thanks in advance if you try to help me...

EDIT

The part of disassembly where the code stop as requested:

00007FF6D635B5BD  mov         eax,0FFh  
00007FF6D635B5C2  jmp         __scrt_common_main_seh+167h (07FF6D635B6B3h)  

            _initterm(__xc_a, __xc_z);
00007FF6D635B5C7  lea         rdx,[__xc_z (07FF6D639ED98h)]  
00007FF6D635B5CE  lea         rcx,[__xc_a (07FF6D639EC10h)]  
00007FF6D635B5D5  call        _initterm (07FF6D635C4B0h)  

            __scrt_current_native_startup_state = __scrt_native_startup_state::initialized;
00007FF6D635B5DA  mov         dword ptr [__scrt_current_native_startup_state (07FF6D64162E0h)],2  
        }
        else
00007FF6D635B5E4  jmp         __scrt_common_main_seh+0A2h (07FF6D635B5EEh)  
        {
            has_cctor = true;
00007FF6D635B5E6  mov         sil,1  
00007FF6D635B5E9  mov         byte ptr [has_cctor],sil  
        }

        __scrt_release_startup_lock(is_nested);
00007FF6D635B5EE  mov         cl,bl  
00007FF6D635B5F0  call        __scrt_release_startup_lock (07FF6D635B368h) 

Note that exe_common.inl, as said in comment, is a Read-Only Visual Studio file located in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\crt\src\vcruntime\exe_common.inl. I made a gist if you want to see it: https://gist.github.com/AlEmerich/281994ebbcde7d3bac88f21a85de96e2

LAST EDIT: I don't know if it is the right way to do but I let know the audience that I give up on that problem by trying to change my computer. I have now a more recent hardware and it throws any errors. Thanks anyway for your help !

Upvotes: 5

Views: 4052

Answers (1)

niek tuytel
niek tuytel

Reputation: 1179

For me, remove _CRT_SECURE_NO_WARNINGS from Release Mode and try to build in Release Mode. It should contain some errors, fix them and than it should be fine.

Upvotes: 1

Related Questions