From owner-freebsd-hackers Thu Feb 3 1:56:32 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from Thingol.KryptoKom.DE (Thingol.KryptoKom.DE [194.245.91.1]) by builder.freebsd.org (Postfix) with ESMTP id E013F4335 for ; Thu, 3 Feb 2000 01:56:28 -0800 (PST) Received: (from root@localhost) by Thingol.KryptoKom.DE (8.9.1/8.9.3) id KAA32376 for ; Thu, 3 Feb 2000 10:50:56 +0100 Received: from cirdan.kryptokom.de by KryptoWall via smtpp (Version 1.2.0) id kwa32371; Thu Feb 03 10:50:47 2000 Received: from nt-notes.kryptokom.de (nt-notes.kryptokom.de [192.168.6.247]) by cirdan.kryptokom.de (8.9.3/8.9.3) with SMTP id KAA09141 for ; Thu, 3 Feb 2000 10:49:48 +0100 Received: by nt-notes.kryptokom.de(Lotus SMTP MTA v4.6.3 (733.2 10-16-1998)) id C125687A.0036AE33 ; Thu, 3 Feb 2000 10:57:15 +0100 X-Lotus-FromDomain: UTIMACO From: "Thomas Klein" To: freebsd-hackers@FreeBSD.org Message-ID: Date: Thu, 3 Feb 2000 10:57:11 +0100 Subject: Re: how to catch a wildrunning pointer Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Alfred Perlstein on 28.01.2000 11:49:34 To: Thomas Klein/Aachen/Utimaco/DE@utimaco cc: freebsd-hackers@FreeBSD.ORG Subject: Re: how to catch a wildrunning pointer > > > > Hi > > > > My Problem: > > Within a kernel timeout routine I allocate memory and fill it with data. > > After a while I lock at this data again and realize that it it was modifyted > > (but not by me). > > How can I set a kernel mode watch point to that data to see which function > > change the data. > > > > Any Ideas ???? > > Look at the vm code, you can probably write protect the pages while > you aren't accessing them, this will cause offending code to panic > the machine so you can figure out who is twiddling your bits. > > Of course you'll have to unprotect the memory when you want to access > it for legitimate reasons. > > You owe the oracle a how-to on acually doing this, a paragraph or two > would suffice. > > thanks, > -Or^H^HAlfred If I understand this correctly I have to use the pmap_protect function. For testing I integrate the following sequence within a device driver attach routine. { int i; char * t_ptr; t_ptr = (char*) malloc(1027,M_DEVBUF,M_NOWAIT); for(i=0;i<1027,i++) *t_ptr = 'x'; pmap_protect(kmem_map,t_ptr,t_prt + 1027,VM_PROT_READ); *t_ptr = 'A'; printf("I can see this\n"); } No exception ocured. What is wrong? Wy dosn't it work? Regards Thomas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message