Skip to contentSkip to conversation

QEMU: Illegal instruction (core dumped) when using Pthread example code

Qemu-devel junaidaslam1 1 participant 1 message Feb 15, 2016

lore
Share & tools
lore
#0 lore raw

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.