From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26456 invoked by alias); 11 Apr 2018 19:49:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 26372 invoked by uid 89); 11 Apr 2018 19:49:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Still X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.46.109) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Apr 2018 19:49:14 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway21.websitewelcome.com (Postfix) with ESMTP id DE900400CBE7B for ; Wed, 11 Apr 2018 14:49:12 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 6Lk0fUEUc6il36Lk0fXsV0; Wed, 11 Apr 2018 14:49:12 -0500 Received: from 75-166-37-45.hlrn.qwest.net ([75.166.37.45]:46412 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1f6Lk0-001q38-LG; Wed, 11 Apr 2018 14:49:12 -0500 From: Tom Tromey To: Jan Kratochvil Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: -readnow crash Rust regression [Re: [RFA v2 3/4] Convert Rust to use discriminated unions] References: <20180222203018.23551-1-tom@tromey.com> <20180222203018.23551-4-tom@tromey.com> <20180410203650.GA2496@host1.jankratochvil.net> <87lgduo3om.fsf@tromey.com> <20180411070402.GA16230@host1.jankratochvil.net> Date: Wed, 11 Apr 2018 19:49:00 -0000 In-Reply-To: <20180411070402.GA16230@host1.jankratochvil.net> (Jan Kratochvil's message of "Wed, 11 Apr 2018 09:04:02 +0200") Message-ID: <87vacxle14.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Source-L: No X-Exim-ID: 1f6Lk0-001q38-LG X-Source-Sender: 75-166-37-45.hlrn.qwest.net (pokyo) [75.166.37.45]:46412 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-SW-Source: 2018-04/txt/msg00225.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Jan> On Wed, 11 Apr 2018 04:52:09 +0200, Tom Tromey wrote: >> >>>>> "Jan" == Jan Kratochvil writes: Jan> ./gdb/gdb -batch -readnow /tmp/rustgdbbug/a/b/rustdoc-1.24.0-2.fc27.x86_64.debug Jan> Segmentation fault >> >> Try this: >> >> https://sourceware.org/ml/gdb-patches/2018-03/msg00600.html Jan> Still crashing: Jan> #0 __strrchr_avx2 () at ../sysdeps/x86_64/multiarch/strrchr-avx2.S:54 Jan> #1 0x0000000000aaff44 in rust_last_path_segment (path=0x0) at rust-lang.c:44 Jan> #2 0x00000000008ca07d in quirk_rust_enum (type=0x4c53b80, objfile=0x3089a00) at dwarf2read.c:10076 Jan> #3 0x00000000008ca3cd in rust_union_quirks (cu=0x30fc820) at dwarf2read.c:10101 Jan> #4 0x00000000008cab85 in process_full_comp_unit (per_cu=0x3149f10, I think this another variant of https://sourceware.org/bugzilla/show_bug.cgi?id=23010 The immediate bug here is that the (rust) enum member is being read from a partial unit, but it is being read as language_minimal, not language_rust. This causes it to have a TYPE_NAME==NULL, whereas language_rust would have set it to follow TYPE_TAG_NAME. I have a hack to fix that but it reveals another problem, which is that some of the type rewriting can be done multiple times, causing other bugs. I hadn't considered this possibility. I'm looking into a good way to fix it. Tom