IPC client tool, Illegal instruction
diff mbox series

Message ID 1506445698627.22262@mentor.com
State Not Applicable
Headers show
Series
  • IPC client tool, Illegal instruction
Related show

Commit Message

Abdur Rehman Sept. 26, 2017, 5:08 p.m. UTC
Hi,

I am seeing an illegal instruction error in the ipc client when I try to do anything after the update is successful.

This is reproducible with following change in the ipc client:

The update is successful but after a couple hundred prints, the application exits with an "Illegal instruction, core dumped" message.
Has anyone else encountered this? Any suggestions on how to fix it?

Regards
Abdur

Comments

Christian Storm Sept. 27, 2017, 8:43 a.m. UTC | #1
Hi Abdur,

> I am seeing an illegal instruction error in the ipc client when I try
> to do anything after the update is successful.
> 
> This is reproducible with following change in the ipc client:
> 
> --- tools/client.c	2017-09-26 19:41:53.751626972 +0500
> +++ tools/client-ill.c	2017-09-26 22:04:19.907746650 +0500
> @@ -125,6 +125,7 @@
>  	/* End called, unlock and exit */
>  	pthread_mutex_unlock(&mymutex);
>  
> +	close(fd);
>  	return 0;
>  }
>  
> @@ -165,6 +166,10 @@
>  		}
>  	}
>  
> +	int i;
> +	for(i = 0; i < 1000; i++) printf("The current value of i is %d\n", i);

I guess you want to have the sleep inside the for loop, 
like the following, right?

+	for(int i = 0; i < 1000; i++) {
+		printf("The current value of i is %d\n", i);
+		sleep(1);
+	}

> +	sleep(1);
> +
>  	exit(0);
>  }
> 
> The update is successful but after a couple hundred prints, the
> application exits with an "Illegal instruction, core dumped"
> message.
> Has anyone else encountered this? Any suggestions on how to fix it?

I just tried to reproduce this with my modification above and aborted on
i=700 without any problems: swupdate as well as client are still running
fine. I also tried to install several times with the same client command,
also no problems.

Can you elaborate a bit more on your setup?


Kind regards,
   Christian

Patch
diff mbox series

--- tools/client.c	2017-09-26 19:41:53.751626972 +0500
+++ tools/client-ill.c	2017-09-26 22:04:19.907746650 +0500
@@ -125,6 +125,7 @@ 
 	/* End called, unlock and exit */
 	pthread_mutex_unlock(&mymutex);
 
+	close(fd);
 	return 0;
 }
 
@@ -165,6 +166,10 @@ 
 		}
 	}
 
+	int i;
+	for(i = 0; i < 1000; i++) printf("The current value of i is %d\n", i);
+	sleep(1);
+
 	exit(0);
 }