General
cancel
Showing results for 
Search instead for 
Did you mean: 

ImageMagick Build Issue/Lseek Error

sharner
Occasional Contributor

ImageMagick Build Issue/Lseek Error

I recently did a build of ImageMagick, and have been receiving various errors from it when trying to do an image conversion. For example, I get "convert: Insufficient image data in file" when trying to convert a bitmap to a png.

After further investigation with tusc, I have found that an incorrect parameter is being passed to lseek. My guess is that I have done something wrong during the build process, but I don't know quite what. Does anyone have any ideas?

Here's a valid lseek from tusc:

lseek(3, 0, SEEK_CUR) .................................... = 245765

Here's the invalid lseek tusc:

lseek(3, 2063875320, 0x36) ............................... ERR#22 EINVAL
6 REPLIES
Steven Schweda
Honored Contributor

Re: ImageMagick Build Issue/Lseek Error

> I recently did a build of ImageMagick [...]

How? Which version? Obtained from where?
On what? Get any build-time warnings?

> lseek(3, 2063875320, 0x36) [...]

Great. So, at some unknown place in a large
program, used in some unknown way, on some
unknown data, there seem to be some bad
values on some unknown variables. I see no
limit on the number of possible causes.

> [...] but I don't know quite what.

At least you may know what you _did_, which
puts you one step ahead of us non-psychics,
who have no useful information to work with.
sharner
Occasional Contributor

Re: ImageMagick Build Issue/Lseek Error

Unfortunately, in being new to the world of HP-UX and software builds in general, I did not know what information would be necessary to provide a good solution. Anyway, I hope that this helps, and if more information is needed, please let me know. Thanks to all for your patience.

How: Ran a build from source using the following commands.

1. ./configure CC=cc CXX=aCC CXXFLAG="-AA -D_REENTRANT" LDFLAGS="-L/opt/myapp/utils/libjpeg/lib -L/opt/myapp/utils/libtiff/lib -L/opt/myapp/utils/libpng/lib -L/opt/myapp/utils/zlib/lib -L/opt/myapp/utils/freetype/lib" CFLAGS="-I/opt/myapp/utils/libjpeg/include -I/opt/myapp/utils/libtiff/include -I/opt/myapp/utils/libpng/include -I/opt/myapp/utils/zlib/include -I/opt/myapp/utils/freetype/include" --prefix=/opt/myapp/utils/imagemagick --without-x
2. gmake clean
3. gmake
4. gmake install

Which Version: ImageMagick 6.2.4

Obtained From Where: The Porting And Archive Centre For HP-UX - http://hpux.connect.org.uk/. This is an older version than what is currently posted on the site. Unfortunately, I have been told that 6.2.4 is the version that must be used for this project. A previous co-worker had built this successfully on the same platform, but it seems that I must be doing something differently.

On What: HP-UX 11.11 9000/800 RISC Based

Build-Time Warnings: When running configure, I do get some errors like this "configure: WARNING: tiff.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: tiff.h: proceeding with the compiler's result". During gmake, I am receiving some warnings like this "cc: "ltdl/ltdl.c", line 3738: warning 604: Pointers are not assignment-compatible.
cc: "ltdl/ltdl.c", line 3738: warning 563: Argument #4 is not the correct type." Also, I am receiving "libtool: link: warning: this platform does not like uninstalled shared libraries
libtool: link: `utilities/composite' will be relinked during installation" during gmake.

Command Issued: convert -resample 72x72 -quality 50 test.bmp test.png

When The Error Occurs: Maybe this will help in giving a bit more context for the error.

open("test.bmp", O_RDONLY|O_LARGEFILE, 0666) = 3
read(3, "B M a2b105\0\0\0\0\06 \0\0\0( \0".., 245765) .... = 245765
lseek(3, 0, SEEK_CUR) .................................... = 245765
lseek(3, 0, SEEK_CUR) .................................... = 245765
lseek(3, 2063875320, 0x36) ............................... ERR#22 EINVAL
Steven Schweda
Honored Contributor

Re: ImageMagick Build Issue/Lseek Error

> Build-Time Warnings: [...]

That sounds like enough to cause some
trouble.

> On What: HP-UX 11.11 9000/800 RISC Based

I don't have a good HP compiler on my 11.11
system, so I can't duplicate your
environment. (You might try GCC.)

> 1. ./configure [...]

That's a lot of options. All needed?

> [...] Maybe this will help [...]

That doesn't really say where in the code the
bad lseek() is. You may need to do some
serious debugging to find it.

> [...] A previous co-worker had built this
> successfully on the same platform, [...]

Talk to him?
sharner
Occasional Contributor

Re: ImageMagick Build Issue/Lseek Error

I decided to give gcc a try and i am getting all the way to the install before encountering the error below. I've also included the line the generates the error.

gcc -c -I../ -I.. -I/opt/myapp/utils/freetype/include/freetype2 -I/opt/myapp/utils/freetype/include -DDEBUGGING -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -D_HPUX_SOURCE -Wl,+vnocompatwarnings -I/usr/local/include -z -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/opt/myapp/utils/libjpeg/include -I/opt/myapp/utils/libtiff/include -I/opt/myapp/utils/libpng/include -I/opt/myapp/utils/zlib/include -I/opt/myapp/utils/freetype/include -Wall -D_REENTRANT -pthread -DVERSION=\"6.2.4\" -DXS_VERSION=\"6.2.4\" "-I/opt/myapp/perl/lib/5.8.8/PA-RISC2.0-thread-multi/CORE" -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -DHAVE_CONFIG_H Magick.c

:1:2: error: missing '(' after predicate
Dennis Handly
Acclaimed Contributor

Re: ImageMagick Build Issue/Lseek Error

>Here's the invalid lseek tusc:
lseek(3, 2063875320, 0x36) .... ERR#22 EINVAL

That should be pretty much impossible. The third parm to lseek should be a hardcoded constant.
Steven Schweda
Honored Contributor

Re: ImageMagick Build Issue/Lseek Error

> :1:2: error: missing '(' after predicate

I know nothing, but a Google search for that
message found many things. One of them might
help.