-
Notifications
You must be signed in to change notification settings - Fork 17
OpenBSD: tests fail: "Magick: Failed to close module" #108
Comments
Thanks for the bug report. This smells like a bug in GraphicsMagick. I will investigate further. |
The error message There's certainly a bug in But I don't know why this error crops up in the first place. It doesn't show up here (on Linux). I suspect it's a bug in GraphicsMagick itself, because pdf2djvu doesn't load or unload any modules explicitly. |
Do you get this error with other programs linking to GraphicsMagick? Could you try applying the attached patch (cherry-picked from GM's hg repo)? It might make the error message more helpful. diff --git a/magick/module.c b/magick/module.c
--- a/magick/module.c
+++ b/magick/module.c
@@ -2168,8 +2170,7 @@
UnloadModule(const CoderInfo *coder_info,ExceptionInfo *exception)
{
char
- message[MaxTextExtent],
- name[MaxTextExtent];
+ message[MaxTextExtent];
unsigned int
status=True;
@@ -2193,7 +2194,8 @@
{
if (lt_dlclose((ModuleHandle) coder_info->handle))
{
- FormatString(message,"\"%.1024s: %.1024s\"",name,lt_dlerror());
+ FormatString(message,"\"%.1024s: %.1024s\"",coder_info->tag,
+ lt_dlerror());
ThrowException(exception,ModuleError,FailedToCloseModule,message);
status=False;
} |
Comment submitted by @juanfra684: I'm not aware of similar problems with other software linked to GM, but not every OpenBSD maintainer runs tests against their packages, so I don't have a real answer for that. Tests with your patch applied:
|
OK, I reproduced the bug on OpenBSD 5.7. Still no idea why it happens. |
Minimal program that triggers the error: #include <Magick++.h>
int main(int argc, char **argv)
{
Magick::InitializeMagick("");
Magick::Image image(Magick::Geometry(23, 37), Magick::Color());
} |
Work-around to make the tests pass despite the error message on stderr: diff --git a/tests/common.py b/tests/common.py
--- a/tests/common.py
+++ b/tests/common.py
@@ -133,6 +133,9 @@
env=env,
)
stdout, stderr = child.communicate()
+ if sys.platform.startswith('openbsd'):
+ # FIXME: https://github.com/jwilk/pdf2djvu/issues/108
+ stderr = re(r'Magick: Failed to close module [(]"\w*: Invalid handle\"[)].\n').sub('', stderr)
stderr = re(r'^(?: \S+ --> \S+ \(\d+ bytes\)\n)+$').sub('', stderr) # strip djvuextract cruft
return ipc_result(stdout, stderr, child.returncode)
|
Comment submitted by @juanfra684: Sorry for the delay and thanks for taking care of the bug. I will apply your patch to the OpenBSD port. I have a question, the problem doesn't affect to the conversion to djvu, right?. |
Yes, this bug doesn't affect conversion. |
I've committed the work-around as 4ce17b3. No progress in figuring out what's the root cause. :-( |
Comment submitted by @juanfra684: The tests work fine on Bitrig (a derivative of OpenBSD with a different toolchain). Maybe the problem is in the OpenBSD side. |
Issue reported by @juanfra684:
The text was updated successfully, but these errors were encountered: