Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-31 Thread Reuben Thomas
On 25 January 2011 20:43, Adam D. Barratt a...@adam-barratt.org.uk wrote:
 user release.debian@packages.debian.org
 usertag 609535 + squeeze-will-remove
 thanks

Please see bug #611260: the major part of this is in fact a bug in
graphicsmagick, not in psiconv.

With my patch, and a fixed graphicsmagick, psiconv works fine.

I imagine that it's too late to fix graphicsmagick for squeeze, so I
see the following options:

1. Remove psiconv just for squeeze.

2. Build psiconv against imagemagick just for squeeze (I know that
this does not work as well as with graphicsmagick, but at least it
works).

But please do resurrect it after squeeze: I know that the popcon
figures are not huge, but as upstream maintainer of plptools (which is
in a similar position) I still get regular mail, mostly from Debian
users, trying to use it. It's just at this point, when the relevant
devices are becoming obsolete, that people are trying to recover their
old data.

In this case the need is particularly acute since the upstream
maintainer of psiconv is unresponsive, and I have not been able to get
a new patched release made; so it may well be that the only usable
version ends up being Debian's.

Thanks in advance.

-- 
http://rrt.sc3d.org



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-31 Thread Julien Cristau
On Mon, Jan 31, 2011 at 11:34:57 +, Reuben Thomas wrote:

 On 25 January 2011 20:43, Adam D. Barratt a...@adam-barratt.org.uk wrote:
  user release.debian@packages.debian.org
  usertag 609535 + squeeze-will-remove
  thanks
 
 Please see bug #611260: the major part of this is in fact a bug in
 graphicsmagick, not in psiconv.
 
 With my patch, and a fixed graphicsmagick, psiconv works fine.
 
 I imagine that it's too late to fix graphicsmagick for squeeze, so I
 see the following options:
 
 1. Remove psiconv just for squeeze.
 
 2. Build psiconv against imagemagick just for squeeze (I know that
 this does not work as well as with graphicsmagick, but at least it
 works).
 
We've done 1 for now, the rest is not up to the release team.

Cheers,
Julien


signature.asc
Description: Digital signature


Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-31 Thread Reuben Thomas
On 31 January 2011 11:47, Julien Cristau jcris...@debian.org wrote:
 On Mon, Jan 31, 2011 at 11:34:57 +, Reuben Thomas wrote:
 1. Remove psiconv just for squeeze.

 We've done 1 for now, the rest is not up to the release team.

In that case, would you be kind enough to build a backport for
squeeze? Who knows how long it will be until squeeze+1...

-- 
http://rrt.sc3d.org



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-25 Thread Adam D. Barratt
user release.debian@packages.debian.org
usertag 609535 + squeeze-will-remove
thanks

On Fri, 2011-01-21 at 15:11 +0100, Jakub Wilk wrote:
 * Reuben Thomas r...@sc3d.org, 2011-01-19, 19:05:
 you can always build against ImageMagick instead.
 
 I played a little bit more and unfortunately psiconv rebuilt against 
 ImageMagick sometimes produces different images that the one from lenny.  
 For examples/Clipart, the latter produces 71-page TIFF, while the former 
 only a single-page image.

In light of the above, the lack of an apparent fix and psiconv's
maintenance status, I'm looking at removing it from squeeze in the next
few days.

The package has two reverse dependencies - abiword and gnumeric - whose
maintainers have acked patches dropping the dependencies.

Although libpsiconv6 has a fairly substantial reported popcon
installation count, a significant number of those are most likely due to
the package being pulled in via abiword and/or gnumeric-plugins-extra;
the recent count is below 100 and the installation count for the
command-line utility barely breaks double figures.

Regards,

Adam




-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-21 Thread Jakub Wilk

* Reuben Thomas r...@sc3d.org, 2011-01-19, 19:05:

you can always build against ImageMagick instead.


I played a little bit more and unfortunately psiconv rebuilt against 
ImageMagick sometimes produces different images that the one from lenny.  
For examples/Clipart, the latter produces 71-page TIFF, while the former 
only a single-page image.


--
Jakub Wilk



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-19 Thread Reuben Thomas
On 18 January 2011 12:15, Jakub Wilk jw...@debian.org wrote:
 * Julien Cristau jcris...@debian.org, 2011-01-18, 12:50:

 This doesn't look good. GetMagickFileList is called in a loop and
 InitializeMagick is supposed to be run only once.

 That sounds like broken API for a library.  How is a library using
 graphicsmagick to know whether it needs to call InitializeMagick or it's
 already been done?

 The library itself (libpsiconv6) is not supposed to be linked to
 GraphicsMagick. Only the command line tool (binary package psiconv) is.

 So yet another possible way to fix this bug is to drop this binary package.

No need for that; you can always build against ImageMagick instead.

Or just try to work out why my patch doesn't work for Jakub; other
applications using graphicsmagick seem to have used a similar patch
with no problems, and it worked for me.

-- 
http://rrt.sc3d.org



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-18 Thread Julien Cristau
On Tue, Jan 11, 2011 at 14:55:21 +0100, Jakub Wilk wrote:

 This doesn't look good. GetMagickFileList is called in a loop and
 InitializeMagick is supposed to be run only once.
 
That sounds like broken API for a library.  How is a library using
graphicsmagick to know whether it needs to call InitializeMagick or it's
already been done?

Cheers,
Julien


signature.asc
Description: Digital signature


Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-18 Thread Jakub Wilk

* Julien Cristau jcris...@debian.org, 2011-01-18, 12:50:

This doesn't look good. GetMagickFileList is called in a loop and
InitializeMagick is supposed to be run only once.


That sounds like broken API for a library.  How is a library using
graphicsmagick to know whether it needs to call InitializeMagick or it's
already been done?


The library itself (libpsiconv6) is not supposed to be linked to 
GraphicsMagick. Only the command line tool (binary package psiconv) is.


So yet another possible way to fix this bug is to drop this binary 
package.


--
Jakub Wilk


signature.asc
Description: Digital signature


Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-14 Thread Jakub Wilk

* Reuben Thomas r...@sc3d.org, 2011-01-10, 12:48:

--- psiconv-0.9.8/configure.in  2005-11-15 15:43:19.0 +
+++ psiconv-0.9.8-rrt/configure.in  2011-01-10 12:35:58.0 +
@@ -112,6 +112,7 @@
   #include time.h
 #include magick/api.h
   int main(void) { ExceptionInfo exception;
+   InitializeMagick(NULL);
   GetExceptionInfo(exception);
   OpenModules(exception);
   return (NULL ==  GetMagickInfo(NULL,exception)); }],


For those who try to reproduce this bug: if this hunk of the patch is 
*not* applied and the package is rebuilt with recent enough 
GraphicsMagick[0], the package won't be linked with GraphicsMagick and 
won't be able to handle any images at all:


$ psiconv examples/Sketch
Unknown output type: `TIFF'

...which still renders psiconv unusable.


[0] E.g. psiconv 0.9.8-4.1+b1.

--
Jakub Wilk



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-11 Thread Reuben Thomas
On 11 January 2011 13:55, Jakub Wilk jw...@debian.org wrote:
 retitle 609535 psiconv: magick/semaphore.c:526: LockSemaphoreInfo: Assertion
 `semaphore_info-signature == 0xabacadabUL' failed.
 tags 609535 - patch
 thanks

 Thanks for your bugreport! (I'm not maintainer of this package, but I'll
 comment anyway.)

 --- psiconv-0.9.8/program/psiconv/magick-aux.c  2005-11-15
 15:08:21.0 +
 +++ psiconv-0.9.8-rrt/program/psiconv/magick-aux.c      2011-01-10
 12:37:09.0 +
 @@ -37,6 +37,7 @@
 const MagickInfo * GetMagickFileList(void)
 {
  ExceptionInfo exc;
 +  InitializeMagick(NULL);
  GetExceptionInfo(exc);
  OpenModules(exc);
  return GetMagickInfo(NULL,exc);

 This doesn't look good. GetMagickFileList is called in a loop and
 InitializeMagick is supposed to be run only once.

No it's not. GetMagickFileList is only called in the loop initializer,
and the loop is only run once.

 And in fact, after applying your patch, psiconv still crashes for me with
 the following traceback:

Are you sure you applied the patch and rebuilt correctly? The
traceback you give is identical with that obtained if the patch is not
applied.

-- 
http://rrt.sc3d.org



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-11 Thread Jakub Wilk

* Reuben Thomas r...@sc3d.org, 2011-01-11, 15:15:
GetMagickFileList is only called in the loop initializer, and the loop 
is only run once.


You are right, thanks for correction. Still, it's quite a surprising 
place to put InitializeMagick into.


And in fact, after applying your patch, psiconv still crashes for me 
with the following traceback:
Are you sure you applied the patch and rebuilt correctly? The traceback 
you give is identical with that obtained if the patch is not applied.


Yes. Also, gdb tells me that InitializeMagick is called as it should.

--
Jakub Wilk



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-11 Thread Reuben Thomas
On 11 January 2011 16:16, Jakub Wilk jw...@debian.org wrote:
 * Reuben Thomas r...@sc3d.org, 2011-01-11, 15:15:

 GetMagickFileList is only called in the loop initializer, and the loop is
 only run once.

 You are right, thanks for correction. Still, it's quite a surprising place
 to put InitializeMagick into.

Well, there seems to be only one place that sets up ImageMagick in
psiconv, so I put the code there for simplicity.

 Yes. Also, gdb tells me that InitializeMagick is called as it should.

A diagnosis would be appreciated. I don't get this crash, so I can't
help. I also can't see why it would crash in the same way, as this fix
seems to be the right thing (several programs have fixed this exact
crash by simply calling InitializeMagick). But I'm not an expert on
psiconv or ImageMagick.

-- 
http://rrt.sc3d.org



-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-11 Thread Jakub Wilk

* Reuben Thomas r...@sc3d.org, 2011-01-11, 15:15:
The traceback you give is identical with that obtained if the patch is 
not applied.


At least on my machine, they are different. When I run 
psiconv examples/Clipart I get:


#0  0xf76dc537 in raise () from /lib/libc.so.6
#1  0xf76df922 in abort () from /lib/libc.so.6
#2  0xf76d5727 in __assert_fail () from /lib/libc.so.6
#3  0xf7d95e5c in LockSemaphoreInfo (semaphore_info=0x0) at 
magick/semaphore.c:525
#4  0xf7d61614 in GetMagickInfoEntryLocked (name=0x0) at magick/magick.c:368
#5  0xf7d65377 in OpenModules (exception=0xd4b4) at magick/module.c:1562
#6  0x0804a30a in ?? ()
#7  0x0804a814 in ?? ()
#8  0x0804952b in ?? ()
#9  0xf76c8c76 in __libc_start_main () from /lib/libc.so.6
#10 0x08049421 in ?? ()

without the patch and

#0  0xf76d3537 in raise () from /lib/libc.so.6
#1  0xf76d6922 in abort () from /lib/libc.so.6
#2  0xf76cc727 in __assert_fail () from /lib/libc.so.6
#3  0xf7d95e32 in LockSemaphoreInfo (semaphore_info=0x8059840) at 
magick/semaphore.c:526
#4  0xf7cce852 in ReferenceBlob (blob=0x80597e8) at magick/blob.c:3818
#5  0xf7d5ebf3 in SyncNextImageInList (images=0x80ba6e8) at magick/list.c:943
#6  0xf7ec9fd3 in WriteTIFFImage (image_info=0x8587938, image=0x80ba6e8) at 
coders/tiff.c:4825
#7  0xf7d15f96 in WriteImage (image_info=0x8575858, image=0x80ba6e8) at 
magick/constitute.c:8947
#8  0xf7cd18f1 in ImageToBlob (image_info=0x8573780, image=0x80ba6e8, 
length=0xd420, exception=0xd424) at magick/blob.c:1925
#9  0x0804b146 in image_to_list (list=0x8059598, image=0x80ba6e8, dest=0x804f7d2 
TIFF) at gen_image.c:98
#10 0x0804b3ec in gen_image_list (config=0x8059360, list=0x8059598, sections=0x8059680, 
dest=0x804f7d2 TIFF) at gen_image.c:163
#11 0x0804b55b in gen_clipart (config=0x8059360, list=0x8059598, f=0x80595b0, 
dest=0x804f7d2 TIFF) at gen_image.c:193
#12 0x0804b637 in gen_image (config=0x8059360, list=0x8059598, file=0x8059588, 
dest=0x804f7d2 TIFF, encoding_type=ENCODING_UTF8) at gen_image.c:222
#13 0x0804a063 in main (argc=2, argv=0xd714) at psiconv.c:298

with it.


And no, I have no idea (yet) what's wrong. :)

--
Jakub Wilk



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-11 Thread Jakub Wilk

retitle 609535 psiconv: magick/semaphore.c:526: LockSemaphoreInfo: Assertion 
`semaphore_info-signature == 0xabacadabUL' failed.
tags 609535 - patch
thanks

Thanks for your bugreport! (I'm not maintainer of this package, but I'll 
comment anyway.)


* Reuben Thomas r...@sc3d.org, 2011-01-10, 12:48:

--- psiconv-0.9.8/configure.in  2005-11-15 15:43:19.0 +
+++ psiconv-0.9.8-rrt/configure.in  2011-01-10 12:35:58.0 +
@@ -112,6 +112,7 @@
   #include time.h
 #include magick/api.h
   int main(void) { ExceptionInfo exception;
+   InitializeMagick(NULL);
   GetExceptionInfo(exception);
   OpenModules(exception);
   return (NULL ==  GetMagickInfo(NULL,exception)); }],


This hunk is OK.


--- psiconv-0.9.8/program/psiconv/magick-aux.c  2005-11-15 15:08:21.0 
+
+++ psiconv-0.9.8-rrt/program/psiconv/magick-aux.c  2011-01-10 
12:37:09.0 +
@@ -37,6 +37,7 @@
const MagickInfo * GetMagickFileList(void)
{
  ExceptionInfo exc;
+  InitializeMagick(NULL);
  GetExceptionInfo(exc);
  OpenModules(exc);
  return GetMagickInfo(NULL,exc);


This doesn't look good. GetMagickFileList is called in a loop and
InitializeMagick is supposed to be run only once.

And in fact, after applying your patch, psiconv still crashes for me 
with the following traceback:


#0  0xf76cf537 in raise () from /lib/libc.so.6
#1  0xf76d2922 in abort () from /lib/libc.so.6
#2  0xf76c8727 in __assert_fail () from /lib/libc.so.6
#3  0xf7d91e32 in LockSemaphoreInfo () from /usr/lib/libGraphicsMagick.so.3
#4  0xf7cca852 in ReferenceBlob () from /usr/lib/libGraphicsMagick.so.3
#5  0xf7d5abf3 in SyncNextImageInList () from /usr/lib/libGraphicsMagick.so.3
#6  0xf7ec5fd3 in ?? () from /usr/lib/libGraphicsMagick.so.3
#7  0xf7d11f96 in WriteImage () from /usr/lib/libGraphicsMagick.so.3
#8  0xf7ccd8f1 in ImageToBlob () from /usr/lib/libGraphicsMagick.so.3
#9  0x0804b152 in image_to_list (list=0x8059590, image=0x80ba6e8, dest=0x804f7d2 
TIFF) at gen_image.c:98
#10 0x0804b3f8 in gen_image_list (config=0x8059358, list=0x8059590, sections=0x8059938, 
dest=0x804f7d2 TIFF) at gen_image.c:163
#11 0x0804b567 in gen_clipart (config=0x8059358, list=0x8059590, f=0x80595a8, 
dest=0x804f7d2 TIFF) at gen_image.c:193
#12 0x0804b643 in gen_image (config=0x8059358, list=0x8059590, file=0x8059580, 
dest=0x804f7d2 TIFF, encoding_type=ENCODING_UTF8) at gen_image.c:222
#13 0x0804a063 in main (argc=2, argv=0xd714) at psiconv.c:298

--
Jakub Wilk



--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Processed: Re: Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-11 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

 retitle 609535 psiconv: magick/semaphore.c:526: LockSemaphoreInfo: Assertion 
 `semaphore_info-signature == 0xabacadabUL' failed.
Bug #609535 [psiconv] psiconv: Patch for GraphicsMagick API change causing 
crash on startup
Changed Bug title to 'psiconv: magick/semaphore.c:526: LockSemaphoreInfo: 
Assertion `semaphore_info-signature == 0xabacadabUL' failed.' from 'psiconv: 
Patch for GraphicsMagick API change causing crash on startup'
 tags 609535 - patch
Bug #609535 [psiconv] psiconv: magick/semaphore.c:526: LockSemaphoreInfo: 
Assertion `semaphore_info-signature == 0xabacadabUL' failed.
Removed tag(s) patch.
 thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
609535: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=609535
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems


-- 
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#609535: psiconv: Patch for GraphicsMagick API change causing crash on startup

2011-01-10 Thread Reuben Thomas
Package: psiconv
Version: 0.9.8-4.1
Severity: grave
Tags: patch
Justification: renders package unusable

Recent versions of GraphicsMagick require the InitializeMagick API to be called:

1.3.8 (January 21, 2010)

[…]
Behavior Changes:

  * InitializeMagick() MUST be invoked prior to using any Magick API
function. Failure to do so will likely lead to an immediate
application crash. This is due to initialization and runtime
changes intended to improve thread safety and efficiency.
Previously it was only strongly recommended to invoke
InitializeMagick().

The attached patch fixes this issue for psiconv. Note that this patch
also works for building against ImageMagick (because InitializeMagick
is a long-standing API), and in any case it would only apply to old
versions, since psiconv's configure script detects GraphicsMagick as
API level 2, whereas the highest API level it detects is 4.

The only recent change is that calling InitializeMagick used to be
optional, whereas it is now mandatory.

-- System Information:
Debian Release: squeeze/sid
  APT prefers maverick-updates
  APT policy: (500, 'maverick-updates'), (500, 'maverick-security'), (500, 
'maverick-backports'), (500, 'maverick')
Architecture: i386 (i686)

Kernel: Linux 2.6.35-24-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages psiconv depends on:
ii  libbz2-1.0   1.0.5-4ubuntu1  high-quality block-sorting file co
ii  libc62.12.1-0ubuntu10Embedded GNU C Library: Shared lib
ii  libfreetype6 2.4.2-2ubuntu0.1FreeType 2 font engine, shared lib
ii  libgomp1 4.5.1-7ubuntu2  GCC OpenMP (GOMP) support library
ii  libgraphicsmagic 1.3.12-1format-independent image processin
ii  libice6  2:1.0.6-1   X11 Inter-Client Exchange library
ii  libjasper1   1.900.1-7   The JasPer JPEG-2000 runtime libra
ii  libjpeg626b-16.1 The Independent JPEG Group's JPEG 
ii  liblcms1 1.18.dfsg-1ubuntu2  Color management library
ii  libpng12-0   1.2.44-1PNG library - runtime
ii  libpsiconv6  0.9.8-4.1   a library for handling Psion files
ii  libsm6   2:1.1.1-1   X11 Session Management library
ii  libtiff4 3.9.4-2 Tag Image File Format (TIFF) libra
ii  libwmf0.2-7  0.2.8.4-7ubuntu2Windows metafile conversion librar
ii  libx11-6 2:1.3.3-3ubuntu1X11 client-side library
ii  libxext6 2:1.1.2-1   X11 miscellaneous extension librar
ii  libxml2  2.7.7.dfsg-4ubuntu0.1   GNOME XML library
ii  zlib1g   1:1.2.3.4.dfsg-3ubuntu1 compression library - runtime

psiconv recommends no packages.

psiconv suggests no packages.

-- no debconf information
--- psiconv-0.9.8/configure.in	2005-11-15 15:43:19.0 +
+++ psiconv-0.9.8-rrt/configure.in	2011-01-10 12:35:58.0 +
@@ -112,6 +112,7 @@
#include time.h
   		 #include magick/api.h
int main(void) { ExceptionInfo exception;
+   InitializeMagick(NULL);
GetExceptionInfo(exception);
OpenModules(exception);
return (NULL ==  GetMagickInfo(NULL,exception)); }],
--- psiconv-0.9.8/program/psiconv/magick-aux.c	2005-11-15 15:08:21.0 +
+++ psiconv-0.9.8-rrt/program/psiconv/magick-aux.c	2011-01-10 12:37:09.0 +
@@ -37,6 +37,7 @@
 const MagickInfo * GetMagickFileList(void)
 {
   ExceptionInfo exc;
+  InitializeMagick(NULL);
   GetExceptionInfo(exc);
   OpenModules(exc);
   return GetMagickInfo(NULL,exc);