From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 9D642385B527 for ; Thu, 23 Feb 2023 22:39:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D642385B527 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677191978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5p0/w8pPqVcA724qmp6nCxb/RB+98RRZdhSyo4LO0Sc=; b=aOMeu34z7idN/FUEpLbXz1ElSaE6QLCiFablE2xCm8Dh+Gl8qZHNPYuwYTPDVFip8r7D8E lvvULcbdiUZtDAHA7URdr5XU2IolxiTUo2yklej71PSo3WBo2eUVrE49PN9Ucbrj8T5SmB OZIj+La9uKRGHi1yi5cs20SgfibD+4U= Received: from mail-il1-f200.google.com (mail-il1-f200.google.com [209.85.166.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-463-m3tznMLLOCixe0A1Nb9W5g-1; Thu, 23 Feb 2023 17:39:36 -0500 X-MC-Unique: m3tznMLLOCixe0A1Nb9W5g-1 Received: by mail-il1-f200.google.com with SMTP id r13-20020a92c5ad000000b00316ecbf63c9so3599443ilt.13 for ; Thu, 23 Feb 2023 14:39:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5p0/w8pPqVcA724qmp6nCxb/RB+98RRZdhSyo4LO0Sc=; b=12dW/C55FK1tUqJCjux4EXjYcyCu+4gNQkO2KmrviTNOZNXnw+z2U9OAqw6dFWqKqB VAkJSOhuOam94Q4O+pKTqjvlWORLsywWUCMrYbLg3+WFNZ7OPWKROWqKPrutnDdQPTpe UGVWgc8/FZMncb8DAaSq+nsDFsx3q+1Ic4M687o49CJOlbNzmNkIZD5kw1GiJf0/rkgj E08pm3L2TQXzdJ0+DoDykvhz73Uv7Dveh/9I0nlWynZsvLCrMath/tv2CHJhEKi2uy9A BI03a567VVTVw9/+vCN6XmeGsZ3S31N8xOcR8btNoCDoPCgYrB12DhAHkqiDxl0gJeT4 k35g== X-Gm-Message-State: AO0yUKWmkOvha7241CLA8ElzJWqEUMnZRXZuRzI/YSK9v9KbL6Hx+EUe MCvfPwdvMY0ZX4ymk/SDUX3B+fDTs59V0cmw5ruABJme87yW0yjndMiachI1LrDRZUJdwWXxE4K rMXdVSimtbMaCp7x4WnaTiOjW+g== X-Received: by 2002:a05:6e02:1a04:b0:315:3fe4:1d0a with SMTP id s4-20020a056e021a0400b003153fe41d0amr9368684ild.0.1677191975938; Thu, 23 Feb 2023 14:39:35 -0800 (PST) X-Google-Smtp-Source: AK7set+U75fMlgW6pJkQoRw1DfWrJY/VV4vpK+hZaH6AGxeX9JZeuDTFzJa9mYFggkhvCzD/CNG1DQ== X-Received: by 2002:a05:6e02:1a04:b0:315:3fe4:1d0a with SMTP id s4-20020a056e021a0400b003153fe41d0amr9368674ild.0.1677191975688; Thu, 23 Feb 2023 14:39:35 -0800 (PST) Received: from [192.168.0.241] ([198.48.244.52]) by smtp.gmail.com with ESMTPSA id o1-20020a056e02068100b00317000b5631sm774783ils.20.2023.02.23.14.39.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Feb 2023 14:39:35 -0800 (PST) Message-ID: <0f4e83b2-974f-df06-23c5-ef0750488814@redhat.com> Date: Thu, 23 Feb 2023 17:39:34 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] manual: Add note to process.texi about MT-process fork (Bug 30159) To: Florian Weimer , Carlos O'Donell via Libc-alpha References: <20230223204959.408243-1-carlos@redhat.com> <871qmg2hm6.fsf@oldenburg.str.redhat.com> From: Carlos O'Donell Organization: Red Hat In-Reply-To: <871qmg2hm6.fsf@oldenburg.str.redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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: On 2/23/23 16:32, Florian Weimer wrote: > * Carlos O'Donell via Libc-alpha: > >> The forked child of an MT-process may only call AS-safe functions. >> --- >> manual/process.texi | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/manual/process.texi b/manual/process.texi >> index 9307379194..dfdf0923b4 100644 >> --- a/manual/process.texi >> +++ b/manual/process.texi >> @@ -316,6 +316,12 @@ The child doesn't inherit alarms set by the parent process. >> The set of pending signals (@pxref{Delivery of Signal}) for the child >> process is cleared. (The child process inherits its mask of blocked >> signals and signal actions from the parent process.) >> + >> +@item >> +In the case of a multi-threaded parent, the child process may only >> +safely call asynchronous-signal-safe functions until the process is >> +replaced with a call to an @code{exec} family function. > > We support calling malloc after fork as an extension. For example, > calling opendir after fork to find file descriptors in /proc/self/fd is > fairly common. We support calling a lot of things in reality, but I didn't want to over commit with this change to the manual. I like your narrowly worded addition. > Perhaps add: > > As an extension relative to POSIX, @theglibc{} supports calling > @code{malloc} and other allocation functions after @code{fork}. This > only applies to the standard @code{malloc}. Whether this extension is > supported by replacement @code{malloc} implementations depends on the > replacement. @xref{Replacing malloc}. v2 posted: https://patchwork.sourceware.org/project/glibc/patch/20230223223728.423748-1-carlos@redhat.com/ Checked pdf/html/texi builds and the xref and macros look good. -- Cheers, Carlos.