Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program received signal SIGILL, Illegal instruction

I am using Linux x86_64 machine to build my program. I have linked a shared library to an executable. In my project I am calling a function which has declared vector<string> inside the function. My program gets killed when that function gets called. When debugging through GDB below is the output I get.

Program received signal SIGILL, Illegal instruction.
0x00002aaaac4d2be7 in OC_Catalog_c::File_ToText (this=0x611aa0) at /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_vector.h:87
87              : _Tp_alloc_type(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
(gdb) bt
0  0x00002aaaac4d2be7 in OC_Catalog_c::File_ToText (this=0x611aa0) at /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_vector.h:87

Is this issue of compilation of my shared library?? Banged my head enough on it. Please help.

-Chaks

Adding more info for your queries: Yes,function that i am calling File_ToText is a virtual function in class OC_Catalog_c. A member variable of other class has object of class OC_Catalog_c which also have virtual function File_ToText.Using that object I am calling File_ToText function of OC_Catlog_c from virtual function File_ToText. I will show a code snippet:

class Oc_Catalog_c  
{
    virtual vector<string>  File_ToText             (void) const; 
}

class B
{
    const OC_Catalog_c*         m_pCatalog;
    virtual vector<string>  File_ToText             (void) const; 
}

vector<string> B::File_ToText( void ) const
{
    vector<string> a_SubData;
    a_SubData = m_pCatalog->File_ToText();
}
like image 240
CVS Avatar asked Aug 23 '13 19:08

CVS


1 Answers

Thank you guys for all your help. I finally figured out the problem that was causing this error.
Debugging more and tracing the instruction I found that program was failing at ud2a instruction.
I was ignoring one warning "warning: cannot pass objects of non-POD type 'struct sqlrw_request_cb' through '...'; call will abort at runtime".
Resolving these warnings fixed my problem related to SIGILL.
More explanation on this link: ud2a instruction causing SIGILL

like image 100
CVS Avatar answered Sep 23 '22 14:09

CVS