segmentation faults with libraries using libxml2 (Bug #970)


Added by Rosen Diankov almost 14 years ago. Updated almost 14 years ago.


Status:Done Start date:
Priority:Low Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:core
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

Linking OpenCV with a library that includes libxml2 always causes a crash.

It looks like this is a known problem with libxml2 and is caused because of zlib. It has been fixed in the system zlib installs but local zlib installs can have problems:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439982

Because opencv does not look for the system zlib install and only uses its local install, it makes it impossible for us to solve this problem.

It would be great if you can add a command in cmake to propritize system installs for zlib:

find_package(ZLIB)
if( NOT ZLIB_FOUND ) # use the local zlib
endif()


Associated revisions

Revision 55e83b8d
Added by Roman Donchenko almost 12 years ago

Merge pull request #970 from asmorkalov:dshow_valid_check_fix

Revision 13cd0a05
Added by Roman Donchenko over 11 years ago

Merge remote-tracking branch 'origin/2.4'

Original pull requests:
#996 from jet47:gpu-nvcuvid-libraries
#995 from jet47:fix-bug-2985
#999 from snosov1:unreliable-results-fix
#1005 from alekcac:doc_fix
#1004 from jet47:fix-bug-3068
#987 from jet47:bug-3085-fix
#969 from pengx17:2.4_binary_cache
#929 from dominikrose:mingw-libdc1394-2-windows
#1000 from ivan-korolev:fix_sift_bug_2892
#1001 from ivan-korolev:fix_stitching_bug_2405
#998 from asmorkalov:android_cmake_mips_fix
#993 from ivan-korolev:fix_videostab_bug_3023
#988 from snosov1:3071-fix
#986 from pengx17:2.4_initiated_context
#982 from pengx17:2.4_fix_two_bugs
#981 from SeninAndrew:ximea_camera_support_fix
#991 from asmorkalov:android_javadoc_fix
#972 from jet47:mog2-params-bug-2168
#980 from SpecLad:include-config
#973 from pengx17:2.4_oclclahe
#903 from aks2:2.4
#968 from asmorkalov:android_na_cproj_fix
#971 from SpecLad:matchers-ctor
#970 from asmorkalov:dshow_valid_check_fix
#965 from apavlenko:fix_java_empty_mats

Conflicts:
cmake/OpenCVModule.cmake
modules/core/src/matmul.cpp
modules/gpu/CMakeLists.txt
modules/ocl/include/opencv2/ocl/ocl.hpp
modules/ocl/perf/perf_imgproc.cpp
modules/ocl/src/imgproc.cpp
modules/ocl/src/initialization.cpp
modules/stitching/src/matchers.cpp
modules/video/src/video_init.cpp
modules/videostab/src/global_motion.cpp

History

Updated by Rosen Diankov almost 14 years ago

I should add that the segmentation fault happens just by adding -lopencv_core to the gcc command line, without even using opencv methods.

Updated by Rosen Diankov almost 14 years ago

The problem can be fixed if modules/core/CMakeLists.txt is changed to:

include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/include")
find_package(ZLIB)
if( ZLIB_FOUND )
  set(deps opencv_lapack ${ZLIB_LIBRARIES})
  include_directories(${ZLIB_INCLUDE_DIR})
else()
  set(deps opencv_lapack zlib)
endif()
define_opencv_module(core ${deps})

Updated by Vadim Pisarevsky almost 14 years ago

thanks! the patch with some modifications & extensions has been applied in r4951

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Also available in: Atom PDF