From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 3C9853856DE2 for ; Wed, 17 May 2023 20:57:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C9853856DE2 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzOCz-0003Zm-IM; Wed, 17 May 2023 16:57:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=In-Reply-To:MIME-Version:References:Subject:To:From: Date; bh=X4Mk0cGx3vAqAUGhy9syL48IYLpxQOvS7Ok+wpTlrKI=; b=WCa+pVY2ebjyyDcLqdjK SgWKdSsI4GCkpnsqHO64iMu5LT9K6cObOX6hnr22bxl2xQR1DgICrMkSgJwacyTVB5g2E4hgKVKnx r61uVl/rmb7BCfDOvtGm5OEfpCSDqBIl/CvMsw/r9VGEe9Dpd80h8wtgfPuSgycV5kYkY/Z246nc7 EBWHaZac5CuD1JI+/EbnjqGYI4Uy7u9hkFhxa831E6pW5pztxMeCRs4+mRL4Y00OwTXP3ZUqmWjUd WdAlPSy5Rv5yvINb7JI5uHi6hkeMoq5d1N5hNMRHHqFdAuny7DnTn2lbH11bIVIXwM2Y6Xs48k3m3 v7vSc9LlICSCng==; Received: from 2a01cb008c251f00de41a9fffe47ec49.ipv6.abo.wanadoo.fr ([2a01:cb00:8c25:1f00:de41:a9ff:fe47:ec49] helo=begin.home) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzOCz-0002pU-A6; Wed, 17 May 2023 16:57:17 -0400 Received: from samy by begin.home with local (Exim 4.96) (envelope-from ) id 1pzOCy-006LMV-0k; Wed, 17 May 2023 22:57:16 +0200 Date: Wed, 17 May 2023 22:57:16 +0200 From: Samuel Thibault To: Sergey Bugaev Cc: libc-alpha@sourceware.org, bug-hurd@gnu.org Subject: Re: [PATCH 05/10] hurd: Use __mach_setup_thread_call () Message-ID: <20230517205716.7qybavmagrengolr@begin> Mail-Followup-To: Sergey Bugaev , libc-alpha@sourceware.org, bug-hurd@gnu.org References: <20230517191436.73636-1-bugaevc@gmail.com> <20230517191436.73636-6-bugaevc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230517191436.73636-6-bugaevc@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Applied, thanks! Sergey Bugaev, le mer. 17 mai 2023 22:14:31 +0300, a ecrit: > ...instead of mach_setup_thread (), which is unsuitable for setting up > function calls. > > Checked on x86_64-gnu: the signal thread no longer crashes upon trying > to process a message. > > Signed-off-by: Sergey Bugaev > --- > hurd/hurdsig.c | 10 ++++++---- > sysdeps/mach/hurd/profil.c | 5 +++-- > sysdeps/mach/hurd/setitimer.c | 11 ++++++----- > 3 files changed, 15 insertions(+), 11 deletions(-) > > diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c > index 78ea59d9..313e95ae 100644 > --- a/hurd/hurdsig.c > +++ b/hurd/hurdsig.c > @@ -22,6 +22,7 @@ > #include /* For `struct mutex'. */ > #include > #include > +#include > #include > #include > #include > @@ -1525,10 +1526,11 @@ _hurdsig_init (const int *intarray, size_t intarraysize) > assert_perror (err); > > stacksize = __vm_page_size * 8; /* Small stack for signal thread. */ > - err = __mach_setup_thread (__mach_task_self (), _hurd_msgport_thread, > - _hurd_msgport_receive, > - (vm_address_t *) &__hurd_sigthread_stack_base, > - &stacksize); > + err = __mach_setup_thread_call (__mach_task_self (), > + _hurd_msgport_thread, > + _hurd_msgport_receive, > + (vm_address_t *) &__hurd_sigthread_stack_base, > + &stacksize); > assert_perror (err); > err = __mach_setup_tls (_hurd_msgport_thread); > assert_perror (err); > diff --git a/sysdeps/mach/hurd/profil.c b/sysdeps/mach/hurd/profil.c > index 64fe76f7..8092df0a 100644 > --- a/sysdeps/mach/hurd/profil.c > +++ b/sysdeps/mach/hurd/profil.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -68,8 +69,8 @@ update_waiter (u_short *sample_buffer, size_t size, size_t offset, u_int scale) > /* Set up the profiling collector thread. */ > err = __thread_create (__mach_task_self (), &profile_thread); > if (! err) > - err = __mach_setup_thread (__mach_task_self (), profile_thread, > - &profile_waiter, NULL, NULL); > + err = __mach_setup_thread_call (__mach_task_self (), profile_thread, > + &profile_waiter, NULL, NULL); > if (! err) > err = __mach_setup_tls(profile_thread); > } > diff --git a/sysdeps/mach/hurd/setitimer.c b/sysdeps/mach/hurd/setitimer.c > index d09c59dc..03191b91 100644 > --- a/sysdeps/mach/hurd/setitimer.c > +++ b/sysdeps/mach/hurd/setitimer.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > > /* XXX Temporary cheezoid implementation of ITIMER_REAL/SIGALRM. */ > > @@ -227,11 +228,11 @@ setitimer_locked (const struct itimerval *new, struct itimerval *old, > goto out; > _hurd_itimer_thread_stack_base = 0; /* Anywhere. */ > _hurd_itimer_thread_stack_size = __vm_page_size; /* Small stack. */ > - if ((err = __mach_setup_thread (__mach_task_self (), > - _hurd_itimer_thread, > - &timer_thread, > - &_hurd_itimer_thread_stack_base, > - &_hurd_itimer_thread_stack_size)) > + if ((err = __mach_setup_thread_call (__mach_task_self (), > + _hurd_itimer_thread, > + &timer_thread, > + &_hurd_itimer_thread_stack_base, > + &_hurd_itimer_thread_stack_size)) > || (err = __mach_setup_tls(_hurd_itimer_thread))) > { > __thread_terminate (_hurd_itimer_thread); > -- > 2.40.1 > > -- Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.