From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id EA092392148D for ; Thu, 8 Dec 2022 07:25:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EA092392148D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670484333; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0q7NoQmrXRLtPSsy+mUiXyoKB4NBN7hJg8vCINka0v0=; b=hjYVhVlLc+1c2OHFz60qsQP7WnXO2QgyL98Hq0oWy/Zj8IgpM4Z9ltqs4x6EGlQHbDHVkM Hu9Gv8xK+gK04oyyxSWTz6Kz4IfS3jh2WdvGhRaoVFsAP/32UBsI08oIiCp7n2hUzYDAK9 qW3bFqhCSLKjyF6GVfbftEnbT6KajGI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-58-Lc2KbXDnO8uHcZfvLW2ivQ-1; Thu, 08 Dec 2022 02:25:32 -0500 X-MC-Unique: Lc2KbXDnO8uHcZfvLW2ivQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0999785A5A6 for ; Thu, 8 Dec 2022 07:25:32 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72A8517582; Thu, 8 Dec 2022 07:25:30 +0000 (UTC) From: Florian Weimer To: Marek Polacek via Gcc-patches Cc: Marek Polacek Subject: Re: [PATCH] docs: Suggest options to improve ASAN stack traces References: <20221207203409.104322-1-polacek@redhat.com> Date: Thu, 08 Dec 2022 08:25:26 +0100 In-Reply-To: <20221207203409.104322-1-polacek@redhat.com> (Marek Polacek via Gcc-patches's message of "Wed, 7 Dec 2022 15:34:09 -0500") Message-ID: <87fsdqjr15.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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: * Marek Polacek via Gcc-patches: > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > index 726392409b6..2de14466dd3 100644 > --- a/gcc/doc/invoke.texi > +++ b/gcc/doc/invoke.texi > @@ -16510,6 +16510,14 @@ The option cannot be combined with @option{-fsanitize=thread} or > @option{-fsanitize=hwaddress}. Note that the only target > @option{-fsanitize=hwaddress} is currently supported on is AArch64. > > +To get more accurate stack traces, it is possible to use options such as > +@option{-O} (which, for instance, prevents most function inlining), > +@option{-fno-optimize-sibling-calls} (which prevents optimizing sibling > +and tail recursive calls), or @option{-fno-ipa-icf} (which disables Identical > +Code Folding for functions and read-only variables). Since multiple runs > +of the program may yield backtraces with different addresses due to ASLR, > +it may be desirable to turn off ASLR: @samp{setarch `uname -m` -R ./prog}. What about -fasynchronous-unwind-tables? It should help if ASAN ever reports stray segmentation faults. Whether it also helps in general depends on whether ASAN maintains ABI around its instrumentation. Thanks, Florian