From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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: From: Ruslan Kabatsayev Date: Mon, 21 Feb 2022 20:33:53 +0300 Message-ID: Subject: Re: Does gdb initialize uninitialized variables? To: Edgar Mobile Cc: "gdb@sourceware.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 21 Feb 2022 17:34:06 -0000 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