List Archive

Thread

Thread Index

Message

From: Boaz Stolk <bstolk%aweta.nl@localhost>
To: "libzip-discuss%nih.at@localhost" <libzip-discuss%nih.at@localhost>
Subject: Seek error when libzip is compiled with CMake
Date: Wed, 20 Jan 2016 15:42:25 +0000

Hi,

I am encountering the following issue when libzip is compiled with the 
Makefiles that CMake has generated.

When I do a zip_fopen_index on an (successfully opened archive), 
zip_fopen_index returns NULL and the error is: Seek error: Value too large for 
defined data type.

Note that this does *not* occur when I build libzip using autoconf / configure.

System:
CentOS 6.6 (Final)
Kernel Linux 2.6.32-504.16.2.el6.x86_64

This is the code that I used:
#include <zip.h> 
int main(int argc, char** argv)
{
  int flags = 0;
  int ez = 0;
  zip_t* archive = zip_open("fileorder.zip", flags, &ez); // fileorder.zip from 
regress/
  if (archive != NULL)
  {
    zip_int64_t index = 0;
    zip_file_t* zf = zip_fopen_index(archive, index, flags);
    if (zf != NULL)
    {
      printf("Test PASS\n");
    }
  }
  printf("%s\n", zip_strerror(archive)); // Gives: Seek error: Value too large 
for defined data type
}

And this is the CMake command from libzip source directory do:
$> mkdir build
$> cmake ..
$> make

Attached you'll find the CMakeCache.txt.

Any ideas what could be the cause of this error?

Thanks,

Boaz
# This is the CMakeCache file.
# For build in directory: /home/bstolk/Downloads/libzip-14717ae31f59/build
# It was generated by CMake: /usr/bin/cmake
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.

########################
# EXTERNAL cache entries
########################

//Path to a program.
CMAKE_AR:FILEPATH=/usr/bin/ar

//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING=

//Enable/Disable color output during build.
CMAKE_COLOR_MAKEFILE:BOOL=ON

//C compiler.
CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc

//Flags used by the compiler during all build types.
CMAKE_C_FLAGS:STRING=

//Flags used by the compiler during debug builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g

//Flags used by the compiler during release minsize builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG

//Flags used by the compiler during release builds (/MD /Ob1 /Oi
// /Ot /Oy /Gs will produce slightly less optimized but smaller
// files).
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG

//Flags used by the compiler during Release with Debug Info builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG

//Flags used by the linker.
CMAKE_EXE_LINKER_FLAGS:STRING=' '

//Flags used by the linker during debug builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=

//Flags used by the linker during release minsize builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=

//Flags used by the linker during release builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=

//Flags used by the linker during Release with Debug Info builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=

//Enable/Disable output of compile commands during generation.
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF

//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local

//Path to a program.
CMAKE_LINKER:FILEPATH=/usr/bin/ld

//Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake

//Flags used by the linker during the creation of modules.
CMAKE_MODULE_LINKER_FLAGS:STRING=' '

//Flags used by the linker during debug builds.
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=

//Flags used by the linker during release minsize builds.
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=

//Flags used by the linker during release builds.
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=

//Flags used by the linker during Release with Debug Info builds.
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=

//Path to a program.
CMAKE_NM:FILEPATH=/usr/bin/nm

//Path to a program.
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy

//Path to a program.
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump

//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=libzip

//Path to a program.
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib

//Flags used by the linker during the creation of dll's.
CMAKE_SHARED_LINKER_FLAGS:STRING=' '

//Flags used by the linker during debug builds.
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=

//Flags used by the linker during release minsize builds.
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=

//Flags used by the linker during release builds.
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=

//Flags used by the linker during Release with Debug Info builds.
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=

//If set, runtime paths are not added when installing shared libraries,
// but are added when building.
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO

//If set, runtime paths are not added when using shared libraries.
CMAKE_SKIP_RPATH:BOOL=NO

//Flags used by the linker during the creation of static libraries.
CMAKE_STATIC_LINKER_FLAGS:STRING=

//Flags used by the linker during debug builds.
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=

//Flags used by the linker during release minsize builds.
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=

//Flags used by the linker during release builds.
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=

//Flags used by the linker during Release with Debug Info builds.
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=

//Path to a program.
CMAKE_STRIP:FILEPATH=/usr/bin/strip

//If true, cmake will use relative paths in makefiles and projects.
CMAKE_USE_RELATIVE_PATHS:BOOL=OFF

//If this value is on, makefiles will be generated without the
// .SILENT directive, and all commands will be echoed to the console
// during the make.  This is useful for debugging only. With Visual
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE

//Path to a file.
ZLIB_INCLUDE_DIR:PATH=/usr/include

//Path to a library.
ZLIB_LIBRARY:FILEPATH=/usr/lib64/libz.so

//Value Computed by CMake
libzip_BINARY_DIR:STATIC=/home/bstolk/Downloads/libzip-14717ae31f59/build

//Value Computed by CMake
libzip_SOURCE_DIR:STATIC=/home/bstolk/Downloads/libzip-14717ae31f59

//Dependencies for the target
zip_LIB_DEPENDS:STATIC=general;/usr/lib64/libz.so;


########################
# INTERNAL cache entries
########################

//ADVANCED property for variable: CMAKE_AR
CMAKE_AR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_BUILD_TOOL
CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1
//What is the target build tool cmake is generating for.
CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/gmake
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/home/bstolk/Downloads/libzip-14717ae31f59/build
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=8
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=12
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=/usr/bin/cmake
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=/usr/bin/cpack
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=/usr/bin/ctest
//ADVANCED property for variable: CMAKE_C_COMPILER
CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//Path to cache edit program executable.
CMAKE_EDIT_COMMAND:INTERNAL=/usr/bin/ccmake
//Executable file format
CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Start directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/home/bstolk/Downloads/libzip-14717ae31f59
//Install .so files without execute permission.
CMAKE_INSTALL_SO_NO_EXE:INTERNAL=0
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_NM
CMAKE_NM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=6
//ADVANCED property for variable: CMAKE_OBJCOPY
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJDUMP
CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RANLIB
CMAKE_RANLIB-ADVANCED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=/usr/share/cmake
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STRIP
CMAKE_STRIP-ADVANCED:INTERNAL=1
//uname command
CMAKE_UNAME:INTERNAL=/bin/uname
//ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS
CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
//Details about finding ZLIB
FIND_PACKAGE_MESSAGE_DETAILS_ZLIB:INTERNAL=[/usr/lib64/libz.so][/usr/include][v1.2.3()]
//Have function fileno
HAVE_FILENO:INTERNAL=1
//Have function fseeko
HAVE_FSEEKO:INTERNAL=1
//Have function ftello
HAVE_FTELLO:INTERNAL=1
//Have include fts.h
HAVE_FTS_H:INTERNAL=1
//Have function getopt
HAVE_GETOPT:INTERNAL=1
//Result of TRY_COMPILE
HAVE_INT16_T_LIBZIP:INTERNAL=TRUE
//Result of TRY_COMPILE
HAVE_INT32_T_LIBZIP:INTERNAL=TRUE
//Result of TRY_COMPILE
HAVE_INT64_T_LIBZIP:INTERNAL=TRUE
//Result of TRY_COMPILE
HAVE_INT8_T_LIBZIP:INTERNAL=TRUE
//Have include inttypes.h
HAVE_INTTYPES_H_LIBZIP:INTERNAL=1
//Result of TRY_COMPILE
HAVE_INT_LIBZIP:INTERNAL=TRUE
//Result of TRY_COMPILE
HAVE_LONG_LIBZIP:INTERNAL=TRUE
//Result of TRY_COMPILE
HAVE_LONG_LONG_LIBZIP:INTERNAL=TRUE
//Have function mkstemp
HAVE_MKSTEMP:INTERNAL=1
//Have function open
HAVE_OPEN:INTERNAL=1
//Have function setmode
HAVE_SETMODE:INTERNAL=
//Result of TRY_COMPILE
HAVE_SHORT_LIBZIP:INTERNAL=TRUE
//Result of TRY_COMPILE
HAVE_SIZEOF_OFF_T:INTERNAL=TRUE
//Result of TRY_COMPILE
HAVE_SIZE_T_LIBZIP:INTERNAL=TRUE
//Have function snprintf
HAVE_SNPRINTF:INTERNAL=1
//Result of TRY_COMPILE
HAVE_SSIZE_T_LIBZIP:INTERNAL=TRUE
//Have include stdbool.h
HAVE_STDBOOL_H:INTERNAL=1
//Have include stddef.h
HAVE_STDDEF_H:INTERNAL=1
//Have include stdint.h
HAVE_STDINT_H:INTERNAL=1
//Have include stdint.h
HAVE_STDINT_H_LIBZIP:INTERNAL=1
//Have function strcasecmp
HAVE_STRCASECMP:INTERNAL=1
//Have function strdup
HAVE_STRDUP:INTERNAL=1
//Have function stricmp
HAVE_STRICMP:INTERNAL=
//Have include strings.h
HAVE_STRINGS_H:INTERNAL=1
//Have include sys/types.h
HAVE_SYS_TYPES_H:INTERNAL=1
//Have include sys/types.h
HAVE_SYS_TYPES_H_LIBZIP:INTERNAL=1
//Result of TRY_COMPILE
HAVE_UINT16_T_LIBZIP:INTERNAL=TRUE
//Result of TRY_COMPILE
HAVE_UINT32_T_LIBZIP:INTERNAL=TRUE
//Result of TRY_COMPILE
HAVE_UINT64_T_LIBZIP:INTERNAL=TRUE
//Result of TRY_COMPILE
HAVE_UINT8_T_LIBZIP:INTERNAL=TRUE
//Have include unistd.h
HAVE_UNISTD_H:INTERNAL=1
//Have function _close
HAVE__CLOSE:INTERNAL=
//Have function _dup
HAVE__DUP:INTERNAL=
//Have function _fdopen
HAVE__FDOPEN:INTERNAL=
//Have function _fileno
HAVE__FILENO:INTERNAL=
//Have function _open
HAVE__OPEN:INTERNAL=
//Have function _setmode
HAVE__SETMODE:INTERNAL=
//Have function _snprintf
HAVE__SNPRINTF:INTERNAL=
//Have function _strdup
HAVE__STRDUP:INTERNAL=
//Have function _stricmp
HAVE__STRICMP:INTERNAL=
//Result of TRY_COMPILE
HAVE___INT16_LIBZIP:INTERNAL=FALSE
//Result of TRY_COMPILE
HAVE___INT32_LIBZIP:INTERNAL=FALSE
//Result of TRY_COMPILE
HAVE___INT64_LIBZIP:INTERNAL=FALSE
//Result of TRY_COMPILE
HAVE___INT8_LIBZIP:INTERNAL=FALSE
//CHECK_TYPE_SIZE: sizeof(int16_t)
INT16_T_LIBZIP:INTERNAL=2
//CHECK_TYPE_SIZE: sizeof(int32_t)
INT32_T_LIBZIP:INTERNAL=4
//CHECK_TYPE_SIZE: sizeof(int64_t)
INT64_T_LIBZIP:INTERNAL=8
//CHECK_TYPE_SIZE: sizeof(int8_t)
INT8_T_LIBZIP:INTERNAL=1
//CHECK_TYPE_SIZE: sizeof(int)
INT_LIBZIP:INTERNAL=4
//CHECK_TYPE_SIZE: sizeof(long)
LONG_LIBZIP:INTERNAL=8
//CHECK_TYPE_SIZE: sizeof(long long)
LONG_LONG_LIBZIP:INTERNAL=8
//CHECK_TYPE_SIZE: sizeof(short)
SHORT_LIBZIP:INTERNAL=2
//CHECK_TYPE_SIZE: sizeof(off_t)
SIZEOF_OFF_T:INTERNAL=8
//CHECK_TYPE_SIZE: sizeof(size_t)
SIZE_T_LIBZIP:INTERNAL=8
//CHECK_TYPE_SIZE: sizeof(ssize_t)
SSIZE_T_LIBZIP:INTERNAL=8
//CHECK_TYPE_SIZE: sizeof(uint16_t)
UINT16_T_LIBZIP:INTERNAL=2
//CHECK_TYPE_SIZE: sizeof(uint32_t)
UINT32_T_LIBZIP:INTERNAL=4
//CHECK_TYPE_SIZE: sizeof(uint64_t)
UINT64_T_LIBZIP:INTERNAL=8
//CHECK_TYPE_SIZE: sizeof(uint8_t)
UINT8_T_LIBZIP:INTERNAL=1
//ADVANCED property for variable: ZLIB_INCLUDE_DIR
ZLIB_INCLUDE_DIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: ZLIB_LIBRARY
ZLIB_LIBRARY-ADVANCED:INTERNAL=1
//CHECK_TYPE_SIZE: __int16 unknown
__INT16_LIBZIP:INTERNAL=
//CHECK_TYPE_SIZE: __int32 unknown
__INT32_LIBZIP:INTERNAL=
//CHECK_TYPE_SIZE: __int64 unknown
__INT64_LIBZIP:INTERNAL=
//CHECK_TYPE_SIZE: __int8 unknown
__INT8_LIBZIP:INTERNAL=

Made by MHonArc.