Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 10387 - 'distort' dumps core (With bugfix attached)
'distort' dumps core (With bugfix attached)
Product: Red Hat Linux
Classification: Retired
Component: xscreensaver (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ray Strode [halfline]
Depends On:
  Show dependency treegraph
Reported: 2000-03-28 10:12 EST by Brian Ryner
Modified: 2007-04-18 12:26 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-06-15 10:55:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
coredump from distort suplied with xscreensaver-4.05-2 from rawhide (8.34 MB, application/octet-stream)
2002-08-10 12:07 EDT, David Juran
no flags Details

  None (edit)
Description Brian Ryner 2000-03-28 10:12:54 EST
After letting the screensaver run overnight (set to Random), I noticed
there was a core file in my home directory, which was dumped by 'distort
-root'.  I am running the SVGA X server, on a Riva128 card.  I just ran
"distort" manually and did not see the coredump, so I'm wondering if this
is something that can happen after it's been running for awhile.
Comment 1 Bill Nottingham 2000-03-28 15:22:59 EST
It's been running for about 5 hours here with no segfaults so far.
Comment 2 Brian Ryner 2000-03-28 15:32:59 EST
I'll run it some more on my machine and see what happens.  Unfortunately, I
deleted the core file, otherwise I would at least have a backtrace.
Comment 3 Brian Ryner 2000-03-28 18:30:59 EST
The coredump happened again, here is a backtrace:

#0  0x400b8ffa in _XGetPixel32 () from /usr/X11R6/lib/libX11.so.6
#1  0x804ada7 in XMapRaised ()
#2  0x804b360 in XMapRaised ()
#3  0x804c239 in XMapRaised ()
#4  0x4017e9cb in __libc_start_main (main=0x804ba90 <XMapRaised+8148>, argc=2,
    argv=0xbffffa04, init=0x80494bc <_init>, fini=0x804fcac <_fini>,
    rtld_fini=0x4000ae60 <_dl_fini>, stack_end=0xbffff9fc)
    at ../sysdeps/generic/libc-start.c:92

I'll admit this probably isn't all that helpful.  Maybe I'll compile an
xscreensaver RPM with debugging symbols.
Comment 4 Bill Nottingham 2000-04-10 14:36:59 EDT
Yeah, unfortunately, unless we know where in distort
it core dumped, it's *really* hard to track down.
Comment 5 Brian Ryner 2000-04-11 11:45:59 EDT
Ok, here's the backtrace gdb gives me with a debug version of xscreensaver:

(gdb) bt
#0  0x400b8ffa in _XGetPixel32 () from /usr/X11R6/lib/libX11.so.6
#1  0x804add7 in reflect_draw (k=3) at distort.c:584
#2  0x804b2a0 in screenhack (dpy=0x8058ad0, window=79691784) at distort.c:739
#3  0x804c0b5 in main (argc=1, argv=0xbffff9c4) at screenhack.c:574

Does this help at all?
Comment 6 Bill Nottingham 2000-04-11 11:50:59 EDT
Hm, will check ; you're running at 32bpp, correct?
Comment 7 Brian Ryner 2000-04-11 11:55:59 EDT
Yes, and 800x600.
Comment 8 Bill Nottingham 2000-04-11 11:56:59 EDT
What does xdpyinfo say under 'supported pixmap formats'?
Comment 9 Brian Ryner 2000-04-11 11:57:59 EDT
supported pixmap formats:
    depth 1, bits_per_pixel 1, scanline_pad 32
    depth 24, bits_per_pixel 32, scanline_pad 32
Comment 10 Brian Brock 2000-10-04 12:10:08 EDT
I'm experiencing an identical problem with distort, I've not traced it yet. 
Please let me know if I can supply additional details.
Comment 11 Jamie Zawinski 2002-07-27 01:57:39 EDT
Does this still happen with the version of distort included with xscreensaver 4.05?

If so:

Does it happen every time?

When it does happen, what are the values of these variables:
radius, number, speed, vortex, magnify, blackhole, effect;

What are all the local vars inside the function (reflect_draw, probably)
where it crashed?

What are the contents of the orig_map structure?

Comment 12 David Juran 2002-08-10 11:58:07 EDT
Yes, distort that comes with xscreensaver-4.0.5 crashes as well )-:
and yes, I think it happens every time (at least when you run it with the -root
option) although it might take a while...

let's see here, the variables...
effect=(void (*)()) 0x804b630 <move_lense>

yes, It did crash in reflect_draw, on hte line 

XPutPixel( buffer_map, j, i,XGetPixel( orig_map, xy_coo[k].x + j, ny ));

to be specific

Why don't I just attach the core file from the crash of the debug-build I've done

Tell me if you need any more info (-:
Comment 13 David Juran 2002-08-10 12:07:10 EDT
Created attachment 69850 [details]
coredump from distort suplied with xscreensaver-4.05-2 from rawhide
Comment 14 Jamie Zawinski 2002-09-22 20:32:34 EDT
I think I've fixed it -- can you try this patch and let me know how it works for

diff -u -2 -r1.15 distort.c
--- distort.c	24 Nov 2001 03:38:08 -0000	1.15
+++ distort.c	23 Sep 2002 00:31:41 -0000
@@ -569,4 +569,5 @@
 		lysq = ly * ly;
 		ny = xy_coo[k].y + i;
+		if (ny >= orig_map->height) ny = orig_map->height-1;
 		for(j = 0 ; j < 2*radius+speed+2 ; j++) {
 			lx = j - cx;
Comment 15 David Juran 2002-10-13 04:44:10 EDT
Seems to work now (-:

Note You need to log in before you can comment on or make changes to this bug.