From owner-freebsd-current Fri Jan 12 21:12: 5 2001 Delivered-To: freebsd-current@freebsd.org Received: from mta01.mail.mel.aone.net.au (mta01.mail.au.uu.net [203.2.192.81]) by hub.freebsd.org (Postfix) with ESMTP id F171B37B404; Fri, 12 Jan 2001 21:11:42 -0800 (PST) Received: from camtech.net.au ([203.55.242.195]) by mta01.mail.mel.aone.net.au with ESMTP id <20010113051139.PEUZ26418.mta01.mail.mel.aone.net.au@camtech.net.au>; Sat, 13 Jan 2001 16:11:39 +1100 Message-ID: <3A5FE415.514893C7@camtech.net.au> Date: Sat, 13 Jan 2001 15:43:57 +1030 From: Matthew Thyer X-Mailer: Mozilla 4.76 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: current@FreeBSD.org Cc: ports@FreeBSD.org, jwz@jwz.org, jseger@FreeBSD.org Subject: Data corruption whilst debugging sonar module of ports/graphics/xscreensaver-gtk-3.26 ? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Both of my main FreeBSD-CURRENT machines cant seem to run the sonar module from xscreensaver-gtk-3.26 for very long. It crashes with a SIGBUS on line 1654 of xscreensaver-3.26/hacks/sonar.c when the sonar sweep gets back around to the first bogie that was ever displayed. Since my home box is XFree 3.3.6 and work is XFree 4.0.2, I assume this is a bug with the screensaver itself. Note both machines are recent -CURRENT (within 1 week of today). Today I had some spare time (wife and kids out of my hair) so I installed ports/devel/ddd to have a look at whats going on. To reproduce what I'm doing: - Install ports/devel/ddd - Set "CFLAGS=-g -pipe" in /etc/make.conf - cd /usr/ports/x11/xscreensaver ; sudo make install - Set your CFLAGS back to what they were - cd /usr/ports/x11/xscreensaver/work/xscreensaver-3.26/hacks - ddd & - File->Open Program... and choose "sonar" - Run until it dies with the SIGBUS on line 1654 (subroutine "Sonar") - Display "si", "*si", "*si->visable", all the "*si->visable{->next}*" (e.g. "*si->visable->next", "*si->visable->next->next" etc) and the local variables. I'm seeing the local variable "bp" with a value of 0xd0d0d0d0. I cant see how this happens when "bp" is initialised from si->visable in the for loop at line 1647 and thereafter follows the list (via ->next) where no members have an address of 0xd0d0d0d0. It seems that something in sonar.c is overwriting memory it shouldn't. I haven't done much debugging since Uni, so I was wonderring if others can reproduce this and does someone have some ideas how I can easily detect this data corruption with ddd or is it a compiler bug ? (I suspect not as it always happens when the sweep gets back around to the first bogie ever displayed). Does anyone recognise where 0xd0d0d0d0 may have come from ? 1635 static void 1636 Sonar(sonar_info *si, Bogie *bl) 1637 { 1638 1639 /* Local Variables */ 1640 1641 Bogie *bp, *prev; 1642 int i; 1643 1644 /* Check for expired tagets and remove them from the visable list */ 1645 1646 prev = NULL; 1647 for (bp = si->visable; bp != NULL; bp = bp->next) { 1648 1649 /* 1650 * Remove it from the visable list if it's expired or we have 1651 * a new target with the same name. 1652 */ 1653 1654 bp->age ++; 1655 Thanks To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message