From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id DEB3F3858287 for ; Wed, 24 Jan 2024 16:14:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DEB3F3858287 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DEB3F3858287 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706112874; cv=none; b=w+LDuW85l7oadsVDVnrGtz7saBpdiI3YJui8+mxwcncD6OKTrycoGcT8x48KmJpoSjwYZDfYuxWptjKBTB6hBy8o2oAVN85vF0LswikfsQWjhrsz2CgTIF5WnaOKuSs+GS9k4gMp4jKHmx4oqhIag07XcPwQC+Hyt414lg69QmU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706112874; c=relaxed/simple; bh=WVRJTLWGDX2hs5+bEjBGdevlWvURXmhXibnpS0pw7cM=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=sO9koZjb9rMGkcPr2KGMzHK9dQ/m4iMdUkSiVLBzFA4EaAKhmxx3LPkV8kY0r9BGLyk/BmBxa7rtAZiaQnX3G/GsFwL3Op91CIBBHKNBmpU/Lx9abXD/VT4wfMb0pAASdcHK3h1yjGP0MQsH9bhKJIAjTZ4EfZlFqOlAMck1mN4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (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 smtp-out2.suse.de (Postfix) with ESMTPS id DD51F1F7F9; Wed, 24 Jan 2024 16:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706112871; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aMPAu+gaHDGegowJeUNTl6igvmS+LMSbVEXo0vjyL1M=; b=z8MIn3oSdhJAwtP8JPn2dlyXjyBEbygXGAT3iBgOLQsP0R5ukxjVE1LwgKkf16yOnF54hc ONjQd5yCPHBjS2I3qgkqtt52XgqObz6s+EOtB/M2SoZ81bJWy7d1NG21YDIzymHJLjv51H YNY65Pv9/jBKMSw/YPFDfaxSRVg19j0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706112871; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aMPAu+gaHDGegowJeUNTl6igvmS+LMSbVEXo0vjyL1M=; b=7rmnlNmCEwN7fVyRIhbP5yGOQZk0XrKIHnEgNVIHYUvcGqBD0QqZjyFKF3+7XGbBFcEpQF HmTlI8tPbA2Nq8Aw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706112870; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aMPAu+gaHDGegowJeUNTl6igvmS+LMSbVEXo0vjyL1M=; b=oXm8YHZRG5oGkVv5QgUAcc5Tk+F0kQfZXzxYsDetsEM3wUDsPYk4B/34E2Iwfvbe3ewl4k rucUHMSZQomMMIH4xSgbWnK2nZEts/GJJd9lINR9zlgB1XG4kVVDSq2IK29FjlwQbIUj7d 9TbZf8gm2FUmzE+Ez7GuLdc9iuefwEY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706112870; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aMPAu+gaHDGegowJeUNTl6igvmS+LMSbVEXo0vjyL1M=; b=ETiV3c/wZgjLme+Q0bOVF+h9zlnKqzDa8RP/cqlpF6RyaJ+O0RQBiUFBq4GdrD3+vpNlxG 4SD1g7Z9RUlIsgBQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C5C5A1333E; Wed, 24 Jan 2024 16:14:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id rvbfLmY3sWU+HwAAD6G6ig (envelope-from ); Wed, 24 Jan 2024 16:14:30 +0000 Message-ID: Date: Wed, 24 Jan 2024 17:15:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/exp] Fix printing of out of bounds struct members Content-Language: en-US To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20240122132801.31153-1-tdevries@suse.de> <87h6j5jpqh.fsf@tromey.com> From: Tom de Vries In-Reply-To: <87h6j5jpqh.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out2.suse.de; none X-Spamd-Result: default: False [-0.10 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-0.01)[46.36%]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,sourceware.org:url]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Level: X-Spam-Score: -0.10 X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 1/22/24 17:29, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries writes: > > Tom> When building gdb with -O0 -fsanitize=address, and running test-case > Tom> gdb.ada/uninitialized_vars.exp, I run into: > Tom> ... > > Thanks for looking into this. > > Tom> - when y.a happens to be set to 216, as above, gdb interprets this as the > Tom> variable having the c+d variant (which is why trying to print y.b fails). > > One thing I see here is that y.a is not one of the valid values. So I > wonder if this kind of corruption should be detected at a different > spot, like throwing an exception from compute_variant_fields_inner. > I've looked into that, but I think it requires a cleanup related to TYPE_CODE_BOOL, see this PR ( https://sourceware.org/bugzilla/show_bug.cgi?id=31282 ). Currently there's no reliable way to determine what valid bool values are. I've updated the commit message to mention this way of fixing it in the v2. > Tom> [ Given the description at the top of gdb/value.h of optimized out and > Tom> unavailable, I was not sure which one to pick for this case, so this is more > Tom> or less a random choice. > > Yeah, neither seems like precisely the right fit. OK, I've updated v2 to use an error then. V2: https://sourceware.org/pipermail/gdb-patches/2024-January/206200.html Thanks, - Tom