From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id 28CB5385703A for ; Fri, 3 Mar 2023 12:00:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 28CB5385703A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x229.google.com with SMTP id bp19so1581571oib.4 for ; Fri, 03 Mar 2023 04:00:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1677844851; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=nFFNgDGEF1BhDC2KcBgQIR4kPecrOraJx2blOPbcXK4=; b=gZHpZFIvle0DrGo/GUJxi72Pgiyie4Rs6aL8vl97ZI2NLHcvscX57pVhazADzY2yaY vuCO3xyV20QaGJwGsFM3iyI+slA+gckWR3xtHSwpQCNUlWApa5pMz5hT7xGsX6u5gSj1 bOQ9eC6qSINjebNr50qSE/YXfU8szekL17qRQnPD2voAJMmTXNFK4IU6E4Y4MPuWk3Jj tnsh3mJSIx6UOZVcFpSqmR6+zpUk6vR/DKWLThjZweFkpHRXF97f9bmOToX9Cm5aC/l/ ecN2OSFjbLZNg3MHcUXWKYr7NB1nPdusRUsi9opqfJtk0GVzbWfNhmziKu48tTBF1IKZ Tedg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677844851; h=content-transfer-encoding:in-reply-to:organization:from:references :cc: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=nFFNgDGEF1BhDC2KcBgQIR4kPecrOraJx2blOPbcXK4=; b=w0cVpKMWjd61/zB3r2OVhnfMNIWJiZf5S+mlQPge4Soe+tbhTERvZntpjsD/zPYmYN jN5nnW0KyleOIYYbP+R4pNd/2D5PNmxPFe/zhoKu8oULTIWlvsU63aAf5tjowM+4fLsz oDtqF38iwqpVjk/SjUuvbYWsKmdGJ/Z2hUSg+ZRdNlCLxHhB+VTMkK313q+3p1IfFZBG KETor2g8fzMsywtfs9J8GTXRlQ4xo4TUrZSH4CTLge3wfhfYfDdjdmbe9o8jc76I8N9s fPSVyWE7eoq72y2Qhocrrv/K4i7qhZozyk4eW127dITvAKhjChzxE01E/8nNnrWM6BnS 9TbA== X-Gm-Message-State: AO0yUKVGXIiVlIWIuE8Qp6Rgz4yjujS9h042UGHKv1MwPu8x10Mr1cUd CnYLbnyfrmYXzvwY4mYdug0zUQ== X-Google-Smtp-Source: AK7set+onhSKPv8o+28gZ/vvv4KenVa7h9jub2qWxc6TQNe5KFa6/1/eWGuEnNWYALo7pdR3nCbFjw== X-Received: by 2002:a05:6808:a1b:b0:384:3e65:d0fe with SMTP id n27-20020a0568080a1b00b003843e65d0femr581568oij.55.1677844851177; Fri, 03 Mar 2023 04:00:51 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c3:d849:65ac:94e7:b706:d532? ([2804:1b3:a7c3:d849:65ac:94e7:b706:d532]) by smtp.gmail.com with ESMTPSA id y205-20020aca32d6000000b00383eaf88e75sm778445oiy.39.2023.03.03.04.00.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Mar 2023 04:00:50 -0800 (PST) Message-ID: <96bd4e65-9b53-2392-26f7-aef7dbb984a5@linaro.org> Date: Fri, 3 Mar 2023 09:00:48 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v3] posix: Fix system blocks SIGCHLD erroneously [BZ #30163] Content-Language: en-US To: Adam Yi Cc: libc-alpha@sourceware.org, i@adamyi.com References: <588df669-00d8-ba15-8651-2a517d8cf922@linaro.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 03/03/23 02:11, Adam Yi wrote: > Thanks for reviewing! > > Add some parsing check here: > >    TEST_VERIFY_EXIT  (argv[0] != NULL); >    char *endptr = NULL; >    double sec = strtod (argv[0], &endptr); >    TEST_VERIFY_EXIT (endptr != argv[0] && errno != ERANGE); >    /* No suffix support and only positive values.  */ >    TEST_VERIFY_EXIT (sec >= 0.0); > > > I'm not sure if TEST_VERIFY_EXIT is the correct thing to do here, since it's the mocked /bin/sh, > not directly part of the test. It's weird that providing invalid argument to `sleep` would crash the shell. > Would it make more sense to print an error to stderr and return 1? FWIW, I didn't add parsing check > here because I saw that other functions here do not have any sanity checks. exit and kill are just > calling atoi without checking for errors and they don't check return values either. There are some > checks in copy_func but it doesn't even check that there are two arguments before referencing them. Printing an error to stderr is fine, and indeed it follow better the mock shell way. I want to add some sanity check to avoid issuing invalid argument to sleep that returns immediately or setup an unexpected timer, which might be tricky to debug (specially in the container environment). Failing early with a message catch possible tests issues.