We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am using DS-5 version 5.14 to debug a Linux application on an Altera Cyclone 5 SoC (Cortex-A9 SMP) and am seeing the above error in the GDB window.
Here is my code (yes, this is all of it).
#include <unistd.h>
#include <stdio.h>
#include <pthread.h>
#include <semaphore.h>
void * myThread()
{
sem_t mysem;
sem_init(&mysem, 0, 0);
while (1)
sem_wait(&mysem);
pthread_testcancel();
}
int main()
pthread_t tid;
void *pret;
if (0 != pthread_create(&tid, 0, myThread, 0))
printf("pthread_create error\r\n");
sleep(2);
if (0 != pthread_cancel(tid))
printf("pthread_cancel error\r\n");
if (0 != pthread_join(tid, &pret))
printf("pthread_join error\r\n");
return 0;
The error is seen when the call to pthread_cancel() is made from main(). If I comment out the call to sem_wait() (which blocks the thread), the code works as expected. As you may have guessed this is a much simplified version of my real code, but it exhibits the error every time, so is good from that viewpoint.
Can anyone shed any light on what might the cause of this problem.
Hello,
This issue should be fixed in the upcoming version of DS-5 5.20, expected to be available in a few weeks.
Please let us know if you continue to see problems.
Best regards,Marcelo