如何在没有Exception发生的情况下调试MagickReadImage失败
How to debug MagickReadImage fail when no Exception occurs
我有一些MagickWand代码,其中MagickReadImage()
在一个系统上失败(返回MagickFalse
),它在另一个系统上工作。
现在没有异常发生,MagickGetException()
返回一个空字符串,如果我正确理解文档,这意味着没有异常。
我想打开的文件在那里,我可以在同一用户下用其他工具打开它,我使用的magick_wand
不是NULL。
调用周围的代码基本上是这样的:
// read image
MagickBooleanType status = MagickReadImage(magick_wand, fn_selector);
// make sure it worked
if (status == MagickFalse)
{
char *description;
ExceptionType severity;
description=MagickGetException(magick_wand,&severity);
fprintf(stderr,"%s %s %lu :%s: %un",GetMagickModule(),description,severity);
description=(char *) MagickRelinquishMemory(description);
fprintf(stderr, "magickwand couldn't read file %sn", fn_selector);
exit(1);
}
是否有办法找出函数调用失败的原因?MagickReadImage()
似乎调用了一个不容易调试的内部函数,如果不是绝对必要的话,我不想自己构建MagickWand库并添加调试的东西。
使用MagickWand版本6.8.9.9 (debian jessie)
结果(经过strace
之后)ImageMagick的PDF阅读部分需要在系统上安装ghostscript可执行文件(/usr/bin/gs
)。现在,当通过Debian apt包管理器安装ImageMagick时,ghostscript不是一个依赖项,只是一个推荐的Magick库。不幸的是,当read调用失败时,Magick认为没有必要以任何方式通知您库组件丢失。
安装ghostscript
包后,一切正常
相关文章:
- 如何在添加文件的情况下在VSCode中调试C++程序
- 调试断言仅在某些情况下失败?C++
- 在没有 -g 选项的情况下编译,但我想获得更详细的调试信息
- 在这种情况下如何调试动态库
- 我的调试器说我有一个隔离错误错误,但无法告诉我在哪里,在非常特殊的情况下发生
- SIGABRT 运行时何时出现错误以及如何在这种情况下进行调试
- 例外情况下,我希望在没有任何堆栈展开的情况下进行调试
- 程序在没有调试符号的情况下崩溃,运行良好(两种情况下都没有优化或任何内容)
- 为什么在VS 2010 C++中,我的程序在调试器中运行良好时会崩溃,但在没有调试器的情况下运行时会崩溃
- OpenGL错误只在未经调试的情况下运行时出现,怎么可能呢
- 在不调试的情况下启动,与从.exe启动相同
- 如何在不调试符号的情况下确定从外部库引发的异常
- 链表程序挂在代码块调试器下,但在其他情况下正常执行
- PDB无法显示发布版本崩溃的确切行号,但在二进制调试版本的情况下显示精确行号
- 如何在没有调试符号和优化的情况下创建 cmake 构建配置
- 大多数为 Qt 5.3.2 编译的二进制文件都是在没有调试信息的情况下构建的
- 在没有源代码的情况下使用gdb进行调试
- 如何在没有文件、objdump或gdb的情况下知道二进制文件是否包含调试符号
- C++/opengl应用程序在附加调试器的情况下运行更流畅
- 如何在没有Exception发生的情况下调试MagickReadImage失败