Article 42156 of ucam.chat: Path: ewrotcd!feed-ewrotcd!pegasus.csx.cam.ac.uk!not-for-mail From: pbm1001@cl.cam.ac.uk (Paul Menage) Newsgroups: ucam.chat Subject: Re: Debugging (was Re: Kinds of spoiler space) Date: 08 Jan 2000 11:31:15 +0000 (GMT) Organization: University of Cambridge, England Lines: 38 Sender: pbm1001@saracen.cl.cam.ac.uk (Paul Menage) Message-ID: References: <0Ou*Nwzfo@news.chiark.greenend.org.uk> <4oA*iozho@news.chiark.greenend.org.uk> <2cE*qxzho@news.chiark.greenend.org.uk> NNTP-Posting-Host: saracen.cl.cam.ac.uk X-Newsreader: xrn 8.03-beta-26 Xref: news.chiark.greenend.org.uk ucam.chat:42156 In article , John Sullivan writes: >Paul Menage wrote: >>In which case the delays caused by doing printf logging could cause the >>same problems ... > >Agreed. Been there, done that, eaten the desk in frustration. I've heard the term "Heisenbug" used for bugs that go away when you try to closely observe them. >Actually, one technique I used once was very effective at tackling >this form of bug. We used a similar method to track down a nasty scheduling bug in an (extreme micro-kernel) OS being developed in the Computer Lab - changing the scheduling class of a process and then restoring it to its original state was causing the process to stop being scheduled for a substantial amount of time. Since the system wasn't actually crashing, just using a few character cells as debugging information wouldn't have helped much. The solution was to provide a "debugging pointer" in the scheduler state that would be stamped with an event value and incremented. This started NULL and thus was ignored by the scheduler, but once the video device driver process started, it stuffed the base address of the graphics screen into this pointer, at which point streams of coloured pixels started marching across and down the screen. "Hmm, so we've got green-yellow-green-yellow here, that's OK, but why've does it go green-red-purple here? ..." Paul -- Paul Menage Paul.Menage@cl.cam.ac.uk http://www.cl.cam.ac.uk/~pbm1001/ Magdalene College, Cambridge: (01223) 768063 Atlas Room, University of Cambridge Computer Laboratory: (01223) 331859