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 {
1639     /* Local Variables */
1641     Bogie *bp, *prev;
1642     int i;
1644     /* Check for expired tagets and remove them from the visable list */
1646     prev = NULL;
1647     for (bp = si->visable; bp != NULL; bp = bp->next) {
1649         /*
1650          * Remove it from the visable list if it's expired or we have
1651          * a new target with the same name.
1652          */
1654         bp->age ++;


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to