From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id NXzpKSfNE2K3IQAAWB0awg (envelope-from ) for ; Mon, 21 Feb 2022 12:34:31 -0500 Received: by simark.ca (Postfix, from userid 112) id 9A3491F3CB; Mon, 21 Feb 2022 12:34:31 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_REPLYTO_END_DIGIT,MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 272C81F3C9 for ; Mon, 21 Feb 2022 12:34:31 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7C670385C41D for ; Mon, 21 Feb 2022 17:34:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C670385C41D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1645464870; bh=DbBA1aMhRnsmT4tFXqg1+5dawokrPOf+PuEAQvSlnXA=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=XZTgrsIV8q+nZ0JAFQ5cuTwHU5aD5mfmge6JwgX7C6Q2Quiow7CIhsAX0cw84gTLK PRuZFrcbVLsf0YUzau6W4yh1Ry53v93M3gL+4bX2d+CSfl5dYTonVKiI2wglADTiD8 lLuhHb8jD+HffaBOULXMAnob0WgJZyIo/6RacLV0= Received: from mail-yw1-x112d.google.com (mail-yw1-x112d.google.com [IPv6:2607:f8b0:4864:20::112d]) by sourceware.org (Postfix) with ESMTPS id 53780385DC3D for ; Mon, 21 Feb 2022 17:34:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 53780385DC3D Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-2d310db3812so146108007b3.3 for ; Mon, 21 Feb 2022 09:34:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DbBA1aMhRnsmT4tFXqg1+5dawokrPOf+PuEAQvSlnXA=; b=Fx0O0fVJAWZhqwFhv1vich2xnLFq5+/98WJVk2d5SANFfopX54ZqqGfeaAwbk8UJOe YSuKZe3XgzhidQ+AQrOvG1iFokGfuHsWNwvvVAgNq/u2Hz3FmzlW/vPwo1o6T0eWEX/W 1dYTwldWFE7ICFJBTnQF2J3mL53HAghiMKsWRdSFvlt2qtr2dgJJ7K+FV0qzIh8g6jNd H27BtPCfwvRGjfOQDzL32GAPoviYVCccTl83TBTkxNF83MoqQAi84EVPujqROJVBOT3M bx+cRn7CHwWfn4wkGOrOlNA3qrdfDlV0xWeiifAOBzTYRUPUQf0L8tuW760OFDQlyOZM /fIg== X-Gm-Message-State: AOAM531Lrl6K/SbiKkG1xvM1bZDFKrjN77NYMaIgpG+LCrLdc8IO+t4m IW/rWDIuBHYreYpy1jwPPNmKlHdlweps2iweSesMVm9NW1s= X-Google-Smtp-Source: ABdhPJyXU8eMowx9DZnwCCSRUK3M4SMf+tFCRThn7zmhT4E5iPkjjFBS5Vc9bWhVFKk32ooog0AXMnf3e8/EYu52Xik= X-Received: by 2002:a81:14cc:0:b0:2d0:3a5e:f734 with SMTP id 195-20020a8114cc000000b002d03a5ef734mr19603055ywu.319.1645464843823; Mon, 21 Feb 2022 09:34:03 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 21 Feb 2022 20:33:53 +0300 Message-ID: Subject: Re: Does gdb initialize uninitialized variables? To: Edgar Mobile Content-Type: text/plain; charset="UTF-8" X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Ruslan Kabatsayev via Gdb Reply-To: Ruslan Kabatsayev Cc: "gdb@sourceware.org" Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" Hi, On Mon, 21 Feb 2022 at 12:45, Edgar Mobile via Gdb wrote: > > Greetings, > > I currently try to find a bug that might be caused by uninitialized variables/memory. But it never appears when I use gdb. Does gdb change how memory is initialized in any way, be it on stack or via new/malloc? Memory-related bugs that don't happen when using GDB but do without GDB are often caused by GDB disabling ASLR. This is usually useful for reproducibility of debugging sessions, but may indeed make address space layout too predictable and fail to reproduce a bug. Try using the GDB command "set disable-randomization off" (without quotes) to undo this behavior and thus start your program in a normal, randomized, environment. Besides, if your problem is indeed with uninitialized variables, you might find Valgrind memory checker more useful than a debugger. > > Regards Regards, Ruslan