From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16450 invoked by alias); 13 Jun 2009 15:26:31 -0000 Received: (qmail 16434 invoked by uid 22791); 13 Jun 2009 15:26:30 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from ugmailsc.ugent.be (HELO ugmailsc.ugent.be) (157.193.49.118) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 13 Jun 2009 15:26:25 +0000 Received: from localhost (localhost [127.0.0.1]) by ugmailsc.ugent.be (Postfix) with ESMTP id 86C621CF7C2 for ; Sat, 13 Jun 2009 17:26:22 +0200 (CEST) Received: from ugmailsc.ugent.be ([127.0.0.1]) by localhost (ugmailsc.ugent.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BduRGLnRPRNP for ; Sat, 13 Jun 2009 17:26:22 +0200 (CEST) Received: from cypress.ugent.be (cypress.ugent.be [157.193.71.48]) by ugmailsc.ugent.be (Postfix) with ESMTP id 53EDD1CF7C0 for ; Sat, 13 Jun 2009 17:26:22 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAKthM0qdwc4w/2dsb2JhbADRGYQNBQ Received: from mail.elis.ugent.be ([157.193.206.48]) by relayrec.ugent.be with ESMTP; 13 Jun 2009 17:26:22 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.elis.ugent.be (Postfix) with ESMTP id EA20B918F23 for ; Sat, 13 Jun 2009 17:26:21 +0200 (CEST) Received: from mail.elis.ugent.be ([127.0.0.1]) by localhost (mail.elis.ugent.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GaBcZtthtVvt for ; Sat, 13 Jun 2009 17:26:18 +0200 (CEST) Received: from firefly.lan (unknown [91.182.182.47]) by mail.elis.ugent.be (Postfix) with ESMTP id C78EB918F19 for ; Sat, 13 Jun 2009 17:26:18 +0200 (CEST) Message-Id: <43312B01-A06A-4144-A040-9A3B40252E69@elis.ugent.be> From: Jonas Maebe To: gdb@sourceware.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v926) Subject: Re: program does not crash when attached to gdbserver Date: Sat, 13 Jun 2009 15:26:00 -0000 References: X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-06/txt/msg00135.txt.bz2 On 13 Jun 2009, at 15:53, Dr. Rolf Jansen wrote: > Am 13.06.2009 um 05:50 schrieb Jonas Maebe: > >> >> In general, this is a feature of the compiler and/or run time, >> rather than of the debugger (the debugger cannot know how the >> memory manager of your run time works, so unless you exclusively >> use OS or OS-supplied library functions, it cannot scramble >> anything). > > I can understand this, and as a matter of fact I would have expected > that the debugger does not interact with the memory management, my > problem is that it acts somehow on mm and the runtime. It would > already be of help for me if somebody could point me to some > possible areas of interaction, which could make up for the above > mentioned different behaviour of running the same binary with and > without gdbserver being attached. I was only pointing out why gdb does not include memory scrambling functionality similar to macsbug. It is true that running a program under a debugger sometimes changes its behaviour, particularly when uninitialised memory is involved. Such problems are often called "heisenbugs". >> E.g., in case of the Free Pascal Compiler, there are the -gttt >> (scramble all local variables on function entry) and -gh (use the >> heaptrc unit, which, a.o., scrambles all freed memory) options. >> >> For GCC, you can have a look which of these work on your target >> platform: http://en.wikipedia.org/wiki/Memory_debugger > > I experimented a bit with memwatch, to no more avail than finding > some freeing-NULL occasions. I would not have bothered you with my > case, if I would still have own ideas to try. Anyway, I will have a > look to the other options mentioned at the wiki page. At least some of those should have options to fill freed and allocated memory with random data. You may also want to try this one: http://support.microsoft.com/kb/286470 Jonas