Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Jul 2017 05:40:22 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320570 - head/lib/libc/gen
Message-ID:  <201707020540.v625eMQZ024189@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Jul  2 05:40:22 2017
New Revision: 320570
URL: https://svnweb.freebsd.org/changeset/base/320570

Log:
  Correct signatures of several pthreads stubs.
  
  Most important, use a correct signature for the
  __pthread_cleanup_push_imp() stub, which was incorrectly generated
  with two-args variant.  The pthread_cleanup_info pointer was corrupted
  in the forwarded call to the real libthr implementation, visible on
  PowerPC and possibly ARM. [1]
  
  Found and tested by:	Mark Millard <markmi@dsl-only.net> [1]
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week

Modified:
  head/lib/libc/gen/_pthread_stubs.c

Modified: head/lib/libc/gen/_pthread_stubs.c
==============================================================================
--- head/lib/libc/gen/_pthread_stubs.c	Sun Jul  2 04:22:37 2017	(r320569)
+++ head/lib/libc/gen/_pthread_stubs.c	Sun Jul  2 05:40:22 2017	(r320570)
@@ -279,10 +279,11 @@ STUB_FUNC2(pthread_kill, PJT_KILL, int, void *, int)
 STUB_FUNC2(pthread_setcancelstate, PJT_SETCANCELSTATE, int, int, void *)
 STUB_FUNC2(pthread_setcanceltype, PJT_SETCANCELTYPE, int, int, void *)
 STUB_FUNC(pthread_testcancel, PJT_TESTCANCEL, void)
-STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, int, int)
-STUB_FUNC2(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void*, void *);
-STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, int, int)
-STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, int, int)
+STUB_FUNC1(__pthread_cleanup_pop_imp, PJT_CLEANUP_POP_IMP, void, int)
+STUB_FUNC3(__pthread_cleanup_push_imp, PJT_CLEANUP_PUSH_IMP, void, void *,
+    void *, void *);
+STUB_FUNC1(_pthread_cancel_enter, PJT_CANCEL_ENTER, void, int)
+STUB_FUNC1(_pthread_cancel_leave, PJT_CANCEL_LEAVE, void, int)
 
 static int
 stub_zero(void)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707020540.v625eMQZ024189>