From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS24940 94.130.0.0/16 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS, UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id C577D1F4C1 for ; Mon, 28 Nov 2022 14:31:08 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.b="ZpdIV58M"; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 06E5C7E77C; Mon, 28 Nov 2022 14:31:00 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; 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=ZpdIV58M; dkim-atps=neutral Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 571DD7E740 for ; Mon, 28 Nov 2022 14:30:55 +0000 (UTC) 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; s=s1; bh=ZcZI3b1pnoxY9CLaQLjqXoUI2lxu61UnQge2Kys16fA=; b=ZpdIV58Mmx9QeUkpJvoADOXiwJL8Ldl5FiYriv7iRHOqZBdVbR43CcZZ9w96HTrwdu9M AT3aYwAP8sPpva1Y0E8utHoZIxXIFfPLt67AM7jcNIh6QnKMrYHmun9DbHpZ7zi842Oiw8 ImmczMLAP70WCvcCVHaVofYHkCetJ8Bn3GEbfYsO2IjlpmD2mcdRj0rsKbL5WW8BlJfgTB yv0ONEgdJVKxLJAQ9/CGAS5sA7AewNP62MH8hEr4B3mTNAVSZXE5Pxba4XGtVKvZvheV2A fKmP1Yy4YRiKCnt98AaJGA4oTlHhuaoiwHUvbT56vYGOB+wfhUtwU7NgfRm49o0w== Received: by filterdrecv-69c5db5cf4-m7lt2 with SMTP id filterdrecv-69c5db5cf4-m7lt2-1-6384C61D-1CA 2022-11-28 14:30:53.766426418 +0000 UTC m=+919364.777965225 Received: from herokuapp.com (unknown) by geopod-ismtpd-3-2 (SG) with ESMTP id tN96JWGxRDyDKlNOQkpkcA for ; Mon, 28 Nov 2022 14:30:53.720 +0000 (UTC) Date: Mon, 28 Nov 2022 14:30:53 +0000 (UTC) From: mk Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 19156 X-Redmine-Issue-Author: mk X-Redmine-Sender: mk 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: 87383 X-SG-EID: =?us-ascii?Q?f0yYLXlH7VRy6fm3UiLXj7JUFayaJJuLpVxMjU+wUvVPg+ltjslq43HEXlM1Ui?= =?us-ascii?Q?jX+qAGuPS7JQYVIfyZKxJ=2FC6L=2Fq0OX07V4VJge+?= =?us-ascii?Q?UYee1QpvM=2FXxUQkTt7=2FvRdu44XehWnilA=2FdndIV?= =?us-ascii?Q?WLPT2FC7UhB3QJugyjc0RE=2FXE6ZsAPlX5lY3Jlp?= =?us-ascii?Q?ZUx8e+ZtCNtTRbk0nLFNS=2Fvm9wgzfBrgr2TMcRs?= =?us-ascii?Q?RDc6s9XS55vK5TPVtzDxNvHFKL+BuuBnEkZ5pFj?= =?us-ascii?Q?W731odit7ndKETY7lxi=2FA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: RMQQMUVO7JYVSYRZLRBJFJHKDMHWZ4HU X-Message-ID-Hash: RMQQMUVO7JYVSYRZLRBJFJHKDMHWZ4HU 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:111036] [Ruby master Bug#19156] ObjectSpace.dump_all segfault during string inspection List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Issue #19156 has been reported by mk (Matthias K=E4ppler). ---------------------------------------- Bug #19156: ObjectSpace.dump_all segfault during string inspection https://bugs.ruby-lang.org/issues/19156 * Author: mk (Matthias K=E4ppler) * Status: Open * Priority: Normal * ruby -v: ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- I am working on a feature that would allow our application to capture heap = dumps during shutdown for later inspection. These heap dumps are captured via `ObjectSpace.dump_all(output: io)`. While= walking the object space, MRI occasionally segfaults while inspect string = object in `search_nonascii` of `string.c`: ``` /usr/local/lib/ruby/3.0.0/objspace.rb:87: [BUG] Segmentation fault at 0x000= 07efee4201000 ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux] ... -- Control frame information ----------------------------------------------- c:0053 p:---- s:0312 e:000311 CFUNC :_dump_all c:0052 p:0130 s:0305 e:000304 METHOD /usr/local/lib/ruby/3.0.0/objspace.rb:= 87 c:0051 p:0023 s:0295 e:000294 METHOD /home/git/gitlab/lib/gitlab/memory/rep= orts/heap_dump.rb:26 ... -- C level backtrace information ------------------------------------------- /usr/local/lib/libruby.so.3.0(rb_print_backtrace+0x11) [0x7efee4ad0c5e] vm_= dump.c:758 /usr/local/lib/libruby.so.3.0(rb_vm_bugreport) vm_dump.c:998 /usr/local/lib/libruby.so.3.0(rb_bug_for_fatal_signal+0xf8) [0x7efee48d0b08= ] error.c:787 /usr/local/lib/libruby.so.3.0(sigsegv+0x55) [0x7efee4a23db5] signal.c:963 /lib/x86_64-linux-gnu/libpthread.so.0(__restore_rt+0x0) [0x7efee4f12140] ..= /sysdeps/pthread/funlockfile.c:28 /usr/local/lib/libruby.so.3.0(search_nonascii+0x30) [0x7efee4a3ca60] string= .c:552 /usr/local/lib/libruby.so.3.0(coderange_scan) string.c:585 /usr/local/lib/libruby.so.3.0(enc_coderange_scan+0x1b) [0x7efee4a3e28a] str= ing.c:709 /usr/local/lib/libruby.so.3.0(rb_enc_str_coderange) string.c:727 /usr/local/lib/ruby/3.0.0/x86_64-linux/objspace.so(is_broken_string+0x8) [0= x7efeced9c304] ../../internal/string.h:116 /usr/local/lib/ruby/3.0.0/x86_64-linux/objspace.so(dump_object) objspace_du= mp.c:388 /usr/local/lib/ruby/3.0.0/x86_64-linux/objspace.so(heap_i+0x39) [0x7efeced9= caa9] objspace_dump.c:521 /usr/local/lib/libruby.so.3.0(objspace_each_objects_without_setup+0xaf) [0x= 7efee48e878f] gc.c:3232 /usr/local/lib/libruby.so.3.0(objspace_each_objects_protected+0x14) [0x7efe= e48e87c4] gc.c:3242 /usr/local/lib/libruby.so.3.0(rb_ensure+0x12a) [0x7efee48d96aa] eval.c:1162 /usr/local/lib/libruby.so.3.0(objspace_each_objects+0x28) [0x7efee48fb458] = gc.c:3310 /usr/local/lib/libruby.so.3.0(rb_objspace_each_objects) gc.c:3298 /usr/local/lib/ruby/3.0.0/x86_64-linux/objspace.so(objspace_dump_all+0x88) = [0x7efeced9b068] objspace_dump.c:616 ... ``` Unfortunately I couldn't get my hands on that memory region to see which st= rings are causing this since this doesn't always happen. I suspect this is also a problem with MRI master since the code looks uncha= nged from 3.0.4. --=20 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-c= ore.ml.ruby-lang.org/