qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] QEMU: Illegal instruction (core dumped) when using Pthread


From: junaidaslam1
Subject: [Qemu-devel] QEMU: Illegal instruction (core dumped) when using Pthread example code
Date: Mon, 15 Feb 2016 07:23:32 -0700 (MST)

Hi, 

I am using a very simple Pthread code to be emulated through QEMU which is
cross compiled using ARM-GCC Compiler. When i run the program through QEMU
it gives illegal instruction (core dump) error. Can anyone help me or
enlighten me what is the reason of this message. My simple code is shown
below:


// Simple Multi-Threaded Application
#include <stdio.h>
#include <pthread.h>
void* test_threads(void* args);
int main(int argc, char *argv[])
{
        pthread_t mythreads[9];
        int i=0;
        //......................................................
        for(i=0;i<9;i++)
        {
                
if(pthread_create(&mythreads[i],NULL,(void*)&test_threads,(void*)NULL))
                {
                        printf("Error Creating thread no %d",i);
                }
        }
        for(i=0;i<9;i++)
        {
                pthread_join(mythreads[i],NULL);
        }
        //.......................................................*/
        return 0;
}
void* test_threads(void* args) // Write some Complex Functionality
{
        int value = (int)((float)(13) / 0.33f);
        return (void*) value;
}

I hope to have help soon.

Regards:
Junaid



--
View this message in context: 
http://qemu.11.n7.nabble.com/QEMU-Illegal-instruction-core-dumped-when-using-Pthread-example-code-tp387673.html
Sent from the Developer mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]