On 05/09/2013 06:56 PM, alex alex wrote:

> vmlinux file
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: vmlinux
> Type: application/octet-stream
> Size: 11189780 bytes
> Desc: not available
> URL: 
> <http://www.xenomai.org/pipermail/xenomai/attachments/20130509/0255686a/attachment.obj>
> _______________________________________________
> Xenomai mailing list
> [email protected]
> http://www.xenomai.org/mailman/listinfo/xenomai
> 


Please try the following patch:

diff --git a/ksrc/skins/posix/syscall.c b/ksrc/skins/posix/syscall.c
index 49ed764..8ffd1ad 100644
--- a/ksrc/skins/posix/syscall.c
+++ b/ksrc/skins/posix/syscall.c
@@ -437,8 +437,10 @@ static int __pthread_set_name_np(struct pt_regs *regs)
        k_tid = __pthread_find(&hkey);
        if (k_tid) {
                p = xnthread_user_task(&k_tid->threadbase);
-               strncpy(p->comm, name, sizeof(p->comm));
-               p->comm[sizeof(p->comm) - 1] = '\0';
+               if (p) {
+                       strncpy(p->comm, name, sizeof(p->comm));
+                       p->comm[sizeof(p->comm) - 1] = '\0';
+               }
        }

        return -pthread_set_name_np(k_tid, name);


-- 
                                                                Gilles.

_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to