From unknown Fri Aug 15 20:54:02 2025 X-Loop: help-debbugs@gnu.org Subject: bug#58096: support malloc NULL return Resent-From: Aleksandar Kostadinov Original-Sender: "Debbugs-submit" Resent-CC: bug-grep@gnu.org Resent-Date: Mon, 26 Sep 2022 15:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58096 X-GNU-PR-Package: grep X-GNU-PR-Keywords: To: 58096@debbugs.gnu.org X-Debbugs-Original-To: bug-grep@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.166420706513408 (code B ref -1); Mon, 26 Sep 2022 15:45:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 Sep 2022 15:44:25 +0000 Received: from localhost ([127.0.0.1]:51406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocqHR-0003UC-Bn for submit@debbugs.gnu.org; Mon, 26 Sep 2022 11:44:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:34178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ockH1-0002lL-Ff for submit@debbugs.gnu.org; Mon, 26 Sep 2022 05:19:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ockH1-0007gB-9n for bug-grep@gnu.org; Mon, 26 Sep 2022 05:19:35 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:44981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ockGz-0006iT-KL for bug-grep@gnu.org; Mon, 26 Sep 2022 05:19:35 -0400 Received: by mail-wm1-x333.google.com with SMTP id k3-20020a05600c1c8300b003b4fa1a85f8so3352638wms.3 for ; Mon, 26 Sep 2022 02:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=A904Yjx/5h//eaxfWmSXB6H+Uq7ERIkRh9rMrMzA12w=; b=H3XxF6RK6lTgi/5yzKoQUX75UIEtrASmPPxU7nJLUwMiyK66B2Sv82pabSEd2TaSQo oK5EBKgJRG7hXasHIRO8wWY3HY5aE1V1/Pcdj638a9aLdrdsAZUPsqoWvuOFclIAvDxa a8+buC7QBdG5gAU4KjWBEmZV5Id3KxmUy52rQLGfCetFU85P5f1/JZ6glsSDbxX7Og9I EV6/bhDM4x36/TW23L7G3ODlv4/e+WQjPJvYq4wMG7vkJtnrnWRf8snXPVPI6YQv/n/F SrLx88NcgBc3jy6/4qIA2DJ8lK5S1FIU5/U7TqmaQhRJExOupNJZA9ZlIGRLnF0w3f5M 8c1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=A904Yjx/5h//eaxfWmSXB6H+Uq7ERIkRh9rMrMzA12w=; b=vV1en+oJxsRHNJG1Xw4x2eF4C1MT6IumssCuNdj5xStqRl+QF3W8fZc5rGPczUKyr9 GrkCfDickVGpS7JZvxLylO6ydQKql5aqcim2sm8uUNB89syQN8uqU/AquzxashM72hcr blbzumejXsEPVCt/054MVn4fYXI6XQUqMnCL4lTTdiCSBY1l66L7u5CHPHJ8sc7xE4RC 9dMvdRPou8FL0orRUGRadAVIsrsQACo+SIRFvs23qpI1wwS0CRrKN5oM63weugePRubb 0z/gQAecuwmvtG1GcyKS6VTCktBMRNKbid2q8mnzkcC1LWsPnn3aspUH3WvRahMnio22 d00Q== X-Gm-Message-State: ACrzQf0869IW7IsPTJH2LSF0aEeq0lNvdT+pr9Qk2ywKRqD2eQBkl3oD CyTPVS+pE7uTrs++dG0fLiL3oBV92PvOygcBYWuD4+h500U= X-Google-Smtp-Source: AMsMyM54b1F84252MvlS2rSgWYpmVk2wr55/JwUKbOiWHVE4JAFQX6GechgNXC2nVdU2v4bjMiHqnnnuZqRFqMykI6U= X-Received: by 2002:a05:600c:4f45:b0:3b4:9c9a:7077 with SMTP id m5-20020a05600c4f4500b003b49c9a7077mr14639237wmq.109.1664183971081; Mon, 26 Sep 2022 02:19:31 -0700 (PDT) MIME-Version: 1.0 From: Aleksandar Kostadinov Date: Mon, 26 Sep 2022 12:19:19 +0300 Message-ID: Content-Type: multipart/alternative; boundary="0000000000006ff26505e9910667" Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=akostadinov@gmail.com; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Mailman-Approved-At: Mon, 26 Sep 2022 11:44:24 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --0000000000006ff26505e9910667 Content-Type: text/plain; charset="UTF-8" Hello, grep fails when using a certain malloc implementation (memkind) because of its reliance on malloc returning 0 when zero size is passed to it. Memkind returns NULL instead which according to authors [1] is one of the acceptable values in malloc specification. Can grep be updated to also support a NULL return value? Thank you! [1] https://github.com/memkind/memkind/issues/853#issuecomment-1241678167 --0000000000006ff26505e9910667 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

grep fails when using= a certain malloc implementation (memkind) because of its reliance on mallo= c returning 0 when zero size is passed to it. Memkind returns NULL instead = which according to authors [1] is one of the acceptable values in malloc sp= ecification.

Can grep be updated to also support a NULL r= eturn value?

Thank you!

--0000000000006ff26505e9910667-- From unknown Fri Aug 15 20:54:02 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Aleksandar Kostadinov Subject: bug#58096: closed (Re: bug#58096: support malloc NULL return) Message-ID: References: <987f3871-7c58-e4c9-d205-1609386d57c0@cs.ucla.edu> X-Gnu-PR-Message: they-closed 58096 X-Gnu-PR-Package: grep Reply-To: 58096@debbugs.gnu.org Date: Mon, 26 Sep 2022 18:09:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1664215742-12647-1" This is a multi-part message in MIME format... ------------=_1664215742-12647-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #58096: support malloc NULL return which was filed against the grep package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 58096@debbugs.gnu.org. --=20 58096: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D58096 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1664215742-12647-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 58096-done) by debbugs.gnu.org; 26 Sep 2022 18:08:51 +0000 Received: from localhost ([127.0.0.1]:51718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocsXD-0003Hd-He for submit@debbugs.gnu.org; Mon, 26 Sep 2022 14:08:51 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocsXB-0003HK-8I for 58096-done@debbugs.gnu.org; Mon, 26 Sep 2022 14:08:50 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 152E0160052; Mon, 26 Sep 2022 11:08:42 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id CB2ysFusvhtm; Mon, 26 Sep 2022 11:08:41 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 40A1C16009F; Mon, 26 Sep 2022 11:08:41 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu 40A1C16009F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1664215721; bh=jHA+slLUjsf76ZfSLmN/6OfBi3WljaKmDsfdcn7kFUY=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type: Content-Transfer-Encoding; b=owcZE8l8W/y5NjQj+TAFD0XTmlRefl32wl+R9F9GhijzGMYsCzz9d597G1RViUaay 4UpZuCHIoIFKDxTh/TB3xq3m1eFIU4YXXMBKX7DcdrvAV0hEUhFNzxi1qgy1ldhASl M3F/ikfevRFbgIZk88Ed0bomZ8BmPsKxFb5HDSSA= X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id CRgqG8cwGInD; Mon, 26 Sep 2022 11:08:41 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 16860160052; Mon, 26 Sep 2022 11:08:41 -0700 (PDT) Message-ID: <987f3871-7c58-e4c9-d205-1609386d57c0@cs.ucla.edu> Date: Mon, 26 Sep 2022 11:08:40 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: bug#58096: support malloc NULL return Content-Language: en-US To: Aleksandar Kostadinov References: From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: 58096-done Cc: 58096-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) On 9/26/22 02:19, Aleksandar Kostadinov wrote: > Can grep be updated to also support a NULL return value? No need for an update, as grep has done that for many years. This is a configuration problem on the part of the memkind user. See: https://github.com/memkind/memkind/issues/853#issuecomment-1258417795 ------------=_1664215742-12647-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 Sep 2022 15:44:25 +0000 Received: from localhost ([127.0.0.1]:51406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocqHR-0003UC-Bn for submit@debbugs.gnu.org; Mon, 26 Sep 2022 11:44:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:34178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ockH1-0002lL-Ff for submit@debbugs.gnu.org; Mon, 26 Sep 2022 05:19:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38432) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ockH1-0007gB-9n for bug-grep@gnu.org; Mon, 26 Sep 2022 05:19:35 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:44981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ockGz-0006iT-KL for bug-grep@gnu.org; Mon, 26 Sep 2022 05:19:35 -0400 Received: by mail-wm1-x333.google.com with SMTP id k3-20020a05600c1c8300b003b4fa1a85f8so3352638wms.3 for ; Mon, 26 Sep 2022 02:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=A904Yjx/5h//eaxfWmSXB6H+Uq7ERIkRh9rMrMzA12w=; b=H3XxF6RK6lTgi/5yzKoQUX75UIEtrASmPPxU7nJLUwMiyK66B2Sv82pabSEd2TaSQo oK5EBKgJRG7hXasHIRO8wWY3HY5aE1V1/Pcdj638a9aLdrdsAZUPsqoWvuOFclIAvDxa a8+buC7QBdG5gAU4KjWBEmZV5Id3KxmUy52rQLGfCetFU85P5f1/JZ6glsSDbxX7Og9I EV6/bhDM4x36/TW23L7G3ODlv4/e+WQjPJvYq4wMG7vkJtnrnWRf8snXPVPI6YQv/n/F SrLx88NcgBc3jy6/4qIA2DJ8lK5S1FIU5/U7TqmaQhRJExOupNJZA9ZlIGRLnF0w3f5M 8c1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=A904Yjx/5h//eaxfWmSXB6H+Uq7ERIkRh9rMrMzA12w=; b=vV1en+oJxsRHNJG1Xw4x2eF4C1MT6IumssCuNdj5xStqRl+QF3W8fZc5rGPczUKyr9 GrkCfDickVGpS7JZvxLylO6ydQKql5aqcim2sm8uUNB89syQN8uqU/AquzxashM72hcr blbzumejXsEPVCt/054MVn4fYXI6XQUqMnCL4lTTdiCSBY1l66L7u5CHPHJ8sc7xE4RC 9dMvdRPou8FL0orRUGRadAVIsrsQACo+SIRFvs23qpI1wwS0CRrKN5oM63weugePRubb 0z/gQAecuwmvtG1GcyKS6VTCktBMRNKbid2q8mnzkcC1LWsPnn3aspUH3WvRahMnio22 d00Q== X-Gm-Message-State: ACrzQf0869IW7IsPTJH2LSF0aEeq0lNvdT+pr9Qk2ywKRqD2eQBkl3oD CyTPVS+pE7uTrs++dG0fLiL3oBV92PvOygcBYWuD4+h500U= X-Google-Smtp-Source: AMsMyM54b1F84252MvlS2rSgWYpmVk2wr55/JwUKbOiWHVE4JAFQX6GechgNXC2nVdU2v4bjMiHqnnnuZqRFqMykI6U= X-Received: by 2002:a05:600c:4f45:b0:3b4:9c9a:7077 with SMTP id m5-20020a05600c4f4500b003b49c9a7077mr14639237wmq.109.1664183971081; Mon, 26 Sep 2022 02:19:31 -0700 (PDT) MIME-Version: 1.0 From: Aleksandar Kostadinov Date: Mon, 26 Sep 2022 12:19:19 +0300 Message-ID: Subject: support malloc NULL return To: bug-grep@gnu.org Content-Type: multipart/alternative; boundary="0000000000006ff26505e9910667" Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=akostadinov@gmail.com; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 26 Sep 2022 11:44:24 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --0000000000006ff26505e9910667 Content-Type: text/plain; charset="UTF-8" Hello, grep fails when using a certain malloc implementation (memkind) because of its reliance on malloc returning 0 when zero size is passed to it. Memkind returns NULL instead which according to authors [1] is one of the acceptable values in malloc specification. Can grep be updated to also support a NULL return value? Thank you! [1] https://github.com/memkind/memkind/issues/853#issuecomment-1241678167 --0000000000006ff26505e9910667 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

grep fails when using= a certain malloc implementation (memkind) because of its reliance on mallo= c returning 0 when zero size is passed to it. Memkind returns NULL instead = which according to authors [1] is one of the acceptable values in malloc sp= ecification.

Can grep be updated to also support a NULL r= eturn value?

Thank you!

--0000000000006ff26505e9910667-- ------------=_1664215742-12647-1--