From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [IPv6:2a01:4f8:1c0c:6b10::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id E28771F405 for ; Tue, 30 Jan 2024 19:29:37 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=N0Lq8Qr5; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=gDdjLHvz; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id E0DB1826B3; Tue, 30 Jan 2024 19:29:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1706642972; bh=6AzX3l6c5PRWnY5dxKJSX85UL6ZTN8EE7Puj9Dq8lrw=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=N0Lq8Qr5ujjTnYIa65Dq8UWM1eUXUweNNLGnd4LY7U7Gz2l81tb/ZsDSPOqZggZPn lGrPKPmfINZNp4D1/aqWLRduAPlMUTEQA5uLj6VpWf7V7JLwzRb+FBTU2D0oLlh13q EchErCnINTORrHR3asK1otynAAQo5pRRO4q5SgMM= Received: from wrqvtvvn.outbound-mail.sendgrid.net (wrqvtvvn.outbound-mail.sendgrid.net [149.72.120.130]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 5E58A8267C for ; Tue, 30 Jan 2024 19:29:28 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=gDdjLHvz; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:from:subject:to; s=s1; bh=A7DzRKp4Er3efpPkP5KfIImz75HWNiFwx3RfojKI71g=; b=gDdjLHvz4jb34lbtslakBeF4ryR1ZJV//muDC862PSjlOrs5Uz2lNt3wnEdBxk+0viP9 e28Y5jcBZMV3HtxY9a425+ZErno6unhE24rvLf9ph85wzqRVSRkjnbIqRyH5+zCMX/jr2c GYGV8IgLBET4b+hak8+ICP+xpQAedyr2YA7R595IIcKqWhPlsGlY6tGHyOEULgongp4Opi 2+mVCXWbM7cyYTmkHY7YoTKnAnbJUJLLq/MceT/MsXtusbKAxmkri9Bm/TqRmG7niP8ate NvOLfJ8wjWpgwLLZLvUC26HxCt0vPd7cgMdrPtxa0OBQ1SX3/7rUPAKxZhk5i38A== Received: by filterdrecv-655bd866f5-4mjl9 with SMTP id filterdrecv-655bd866f5-4mjl9-1-65B94E16-4 2024-01-30 19:29:26.106228443 +0000 UTC m=+1663952.341099850 Received: from herokuapp.com (unknown) by geopod-ismtpd-19 (SG) with ESMTP id YlJd7HvATGu09A9u_mX0Zw for ; Tue, 30 Jan 2024 19:29:26.059 +0000 (UTC) Date: Tue, 30 Jan 2024 19:29:26 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 20228 X-Redmine-Issue-Author: peterzhu2118 X-Redmine-Sender: peterzhu2118 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 93070 X-SG-EID: =?us-ascii?Q?Je5A7G63GhfECAlIirw6sGXmOX2lHebfQJh1Ny5404yZTMLDoRFxOJ=2FeRh30W+?= =?us-ascii?Q?VG3jKN3IIMvrTc6x81xc9blLAXOXOoA9wb31uxX?= =?us-ascii?Q?25tZKQQfLk6=2F1Gxv3lqQ5YirO0BXDz3b6VUOmWR?= =?us-ascii?Q?ZdBjoZpKsOJb3FUh3=2F=2Fw+WqHMpGBw3ICtEfquL1?= =?us-ascii?Q?urrCCh8=2FOPfXYi3c=2FBi+9S5ebuqyMSue5Rlfqp=2F?= =?us-ascii?Q?PNjvUch31Ffx068936jUsIZHku9rTc5ZrjqiPR9?= =?us-ascii?Q?64Yrljl7E8xgSA52XMVkw=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: 67KFTKL2A6OLQ4S4K7Q6JE2OVUUBFYPV X-Message-ID-Hash: 67KFTKL2A6OLQ4S4K7Q6JE2OVUUBFYPV X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:116514] [Ruby master Bug#20228] Memory leak in Regexp timeout List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "peterzhu2118 (Peter Zhu) via ruby-core" Cc: "peterzhu2118 (Peter Zhu)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #20228 has been reported by peterzhu2118 (Peter Zhu). ---------------------------------------- Bug #20228: Memory leak in Regexp timeout https://bugs.ruby-lang.org/issues/20228 * Author: peterzhu2118 (Peter Zhu) * Status: Open * Priority: Normal * Backport: 3.0: UNKNOWN, 3.1: DONTNEED, 3.2: REQUIRED, 3.3: REQUIRED ---------------------------------------- GitHub PR: https://github.com/ruby/ruby/pull/9765 If a Regexp::TimeoutError is raised, the `stk_base` and `OnigRegion` will leak. For example: ```ruby Regexp.timeout = 0.001 regex = /^(a*)*$/ str = "a" * 1000000 + "x" 10.times do 100.times do begin regex =~ str rescue end end puts `ps -o rss= -p #{$$}` end ``` Before: ``` 328800 632416 934368 1230448 1531088 1831248 2125072 2414384 2703440 2995664 ``` After: ``` 39280 47888 49024 56240 56496 56512 56592 56592 56720 56720 ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/