Report forwarded to debian-bugs-dist@lists.debian.org, Herbert Xu <herbert@debian.org>:
Bug#35425; Package xlockmore.
debian-bugs-dist@lists.debian.orgHerbert Xu
Subject: Bug#35425: xlock core dumps at exit when I compile it
Reply-To: raj@colsa.com (Raj Manandhar), 35425@bugs.debian.org
Resent-From: raj@colsa.com (Raj Manandhar)
Orignal-Sender: raj@colsa.com (Raj Manandhar)
Resent-To: debian-bugs-dist@lists.debian.org
Resent-CC: Herbert Xu
Resent-Date: Thu, 01 Apr 1999 18:18:04 GMT
Resent-Message-ID:
Resent-Sender: iwj@debian.org
X-Debian-PR-Message: report 35425
X-Debian-PR-Package: xlockmore
X-Debian-PR-Keywords:
X-Loop: owner@bugs.debian.org
Received: via spool by bugs@bugs.debian.org id=B.9229898812025
(code B ref -1); Thu, 01 Apr 1999 18:18:04 GMT
From: raj@colsa.com (Raj Manandhar)
Message-ID:
Sender: raj@colsa.com (Raj Manandhar)
Date: Thu, 1 Apr 1999 12:04:39 -0600 (CST)
To: submit@bugs.debian.org
Package: xlockmore
Version 4.12-4
When I compile it from source under Debian 2.1, egcc 2.91.60, libc-2.0.7,
and run it as follows:
xlock -nolock -mode flag -bitmap pixmaps/l-linux.xpm
and then hit any key (to quit), it gives a seg fault.
The following patch fixes it:
cd /data/raj/xlockmore-4.12/modes/
diff -u /data/raj/xlockmore-4.12/modes/flag.c\~ /data/raj/xlockmore-4.12/modes/flag.c
--- /data/raj/xlockmore-4.12/modes/flag.c~ Mon Sep 28 10:26:11 1998
+++ /data/raj/xlockmore-4.12/modes/flag.c Thu Apr 1 11:35:06 1999
@@ -146,7 +146,7 @@
#define MAXINITSIZE 6
#define MININITSIZE 2
#define MINAMP 5
-#define MAXAMP 20
+#define MAXAMP 5
#define MAXW(fp) (MAXSCALE * (fp)->image->width + 2 * MAXAMP + (fp)->pointsize + 2 * (fp)->sofs)
#define MAXH(fp) (MAXSCALE * (fp)->image->height+ 2 * MAXAMP + (fp)->pointsize + 2 * (fp)->sofs)
#define MINW(fp) (MINSCALE * (fp)->image->width + 2 * MINAMP + (fp)->pointsize)
@@ -558,8 +558,10 @@
if (fp->choice == IMAGE_FLAG && (fp->graphics_format == IS_XBM ||
fp->graphics_format == IS_XBMDONE))
XFree((caddr_t) fp->image); /* Do not destroy data */
- else
+ else {
(void) XDestroyImage(fp->image);
+ }
+ fp->logo = NULL;
}
free_stuff(display, fp);
}
And it also reduces the flag amplitude (the original looks ugly, I think).
Both source and binary versions die with a seg fault if they are run with
a bitmap
xlock -nolock -mode flag -bitmap bitmaps/l-linux.xbm
(the binary version doesn't die with an xpm I presume because xpm wasn't
compiled into the binary, so it doesn't follow the same code path).
I think what is happening is the XImages with the pixmap or bitmap are
being freed twice in flag.c: once through fp->image, once through fp->logo.
I'm no expert on this, but my read of the XDestroyImage man page says that
the image data will be freed:
The XDestroyImage function deallocates the memory associated with the XImage structure.
The patch above doesn't fix the core dump with the bitmap because the bitmap
uses a static blogo structure in iostuff.c which I am too confused by to
touch.
Raj (raj@colsa.com)
Acknowledgement sent to raj@colsa.com (Raj Manandhar):
New bug report received and forwarded. Copy sent to Herbert Xu <herbert@debian.org>.
-t
From: owner@bugs.debian.org (Debian Bug Tracking System)
To: raj@colsa.com (Raj Manandhar)
Subject: Bug#35425: Acknowledgement (xlock core dumps at exit when I compile it)
Message-ID:
In-Reply-To:
References:
X-Debian-PR-Message: ack 35425
Thank you for the problem report you have sent regarding Debian.
This is an automatically generated reply, to let you know your message has
been received. It is being forwarded to the developers' mailing list for
their attention; they will reply in due course.
Your message has been sent to the package maintainer(s):
Herbert Xu
If you wish to submit further information on your problem, please send
it to 35425@bugs.debian.org (and *not* to
bugs@bugs.debian.org).
Please do not reply to the address at the top of this message,
unless you wish to report a problem with the bug-tracking system.
Ian Jackson
(administrator, Debian bugs database)
Received: (at submit) by bugs.debian.org; 1 Apr 1999 18:04:41 +0000
Received: (qmail 2019 invoked from network); 1 Apr 1999 18:04:40 -0000
Received: from pluto.colsa.com (HELO droid.colsa.com) (12.13.161.3)
by master.debian.org with SMTP; 1 Apr 1999 18:04:40 -0000
From: raj@colsa.com (Raj Manandhar)
Message-ID:
Sender: raj@colsa.com (Raj Manandhar)
Received: by droid.colsa.com
id m10SlpX-00026UC
(Debian Smail-3.2.0.102 1998-Aug-2 #2); Thu, 1 Apr 1999 12:04:39 -0600 (CST)
Date: Thu, 1 Apr 1999 12:04:39 -0600 (CST)
To: submit@bugs.debian.org
Subject: xlock core dumps at exit when I compile it
Package: xlockmore
Version 4.12-4
When I compile it from source under Debian 2.1, egcc 2.91.60, libc-2.0.7,
and run it as follows:
xlock -nolock -mode flag -bitmap pixmaps/l-linux.xpm
and then hit any key (to quit), it gives a seg fault.
The following patch fixes it:
cd /data/raj/xlockmore-4.12/modes/
diff -u /data/raj/xlockmore-4.12/modes/flag.c\~ /data/raj/xlockmore-4.12/modes/flag.c
--- /data/raj/xlockmore-4.12/modes/flag.c~ Mon Sep 28 10:26:11 1998
+++ /data/raj/xlockmore-4.12/modes/flag.c Thu Apr 1 11:35:06 1999
@@ -146,7 +146,7 @@
#define MAXINITSIZE 6
#define MININITSIZE 2
#define MINAMP 5
-#define MAXAMP 20
+#define MAXAMP 5
#define MAXW(fp) (MAXSCALE * (fp)->image->width + 2 * MAXAMP + (fp)->pointsize + 2 * (fp)->sofs)
#define MAXH(fp) (MAXSCALE * (fp)->image->height+ 2 * MAXAMP + (fp)->pointsize + 2 * (fp)->sofs)
#define MINW(fp) (MINSCALE * (fp)->image->width + 2 * MINAMP + (fp)->pointsize)
@@ -558,8 +558,10 @@
if (fp->choice == IMAGE_FLAG && (fp->graphics_format == IS_XBM ||
fp->graphics_format == IS_XBMDONE))
XFree((caddr_t) fp->image); /* Do not destroy data */
- else
+ else {
(void) XDestroyImage(fp->image);
+ }
+ fp->logo = NULL;
}
free_stuff(display, fp);
}
And it also reduces the flag amplitude (the original looks ugly, I think).
Both source and binary versions die with a seg fault if they are run with
a bitmap
xlock -nolock -mode flag -bitmap bitmaps/l-linux.xbm
(the binary version doesn't die with an xpm I presume because xpm wasn't
compiled into the binary, so it doesn't follow the same code path).
I think what is happening is the XImages with the pixmap or bitmap are
being freed twice in flag.c: once through fp->image, once through fp->logo.
I'm no expert on this, but my read of the XDestroyImage man page says that
the image data will be freed:
The XDestroyImage function deallocates the memory associated with the XImage structure.
The patch above doesn't fix the core dump with the bitmap because the bitmap
uses a static blogo structure in iostuff.c which I am too confused by to
touch.
Raj (raj@colsa.com)
Noted your statement that Bug has been forwarded to bagleyd@tux.org.
Request was from Michael Stone <mstone@debian.org>
to control@bugs.debian.org.
Received: (at control) by bugs.debian.org; 7 Oct 1999 22:12:41 +0000
Received: (qmail 11810 invoked from network); 7 Oct 1999 22:12:41 -0000
Received: from justice.loyola.edu (root@144.126.178.227)
by master.debian.org with SMTP; 7 Oct 1999 22:12:41 -0000
Received: (from mstone@localhost)
by justice.loyola.edu (8.9.3/8.9.3/Debian/GNU) id SAA02875
for control@bugs.debian.org; Thu, 7 Oct 1999 18:12:39 -0400
Date: Thu, 7 Oct 1999 18:12:39 -0400
From: Michael Stone
To: control@bugs.debian.org
Message-ID: <19991007181239.I24927@justice.loyola.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 0.95.3i
forwarded 35425 bagleyd@tux.org