Bug 219013

Summary: devel/libftdi1 Segmentation fault (core dumped) during update
Product: Ports & Packages Reporter: drhowarddrfine
Component: Individual Port(s)Assignee: Boris Samorodov <bsam>
Status: Closed FIXED    
Severity: Affects Only Me CC: kenji, w.schwarzenfeld
Priority: --- Flags: bsam: maintainer-feedback+
Version: Latest   
Hardware: amd64   
OS: Any   
Description Flags
possible_patch-libftdi1_Makefile none

Description drhowarddrfine 2017-05-02 13:01:11 UTC
[ 90%] Linking CXX executable test_libftdi1
cd /usr/ports/devel/libftdi1/work/libftdi1-1.3/test && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/test_libftdi1.dir/link.txt --verbose=1
/usr/local/libexec/ccache/c++  -O2 -pipe -fstack-protector -fno-strict-aliasing -O2 -pipe -fstack-protector -fno-strict-aliasing   -fstack-protector CMakeFiles/test_libftdi1.dir/basic.cpp.o CMakeFiles/test_libftdi1.dir/baudrate.cpp.o  -o test_libftdi1 -Wl,-rpath,/usr/ports/devel/libftdi1/work/libftdi1-1.3/src:/usr/local/lib ../src/libftdi1.so.2.3.0 /usr/local/lib/libboost_unit_test_framework.so -lusb 
--- examples/CMakeFiles/find_all_pp.dir/all ---
[ 90%] Built target find_all_pp
--- test/CMakeFiles/test_libftdi1.dir/all ---
[ 90%] Built target test_libftdi1
--- python/CMakeFiles/doc_i.dir/all ---
Segmentation fault (core dumped)
*** [doc/xml/ftdi_8c.xml] Error code 139

make[4]: stopped in /usr/ports/devel/libftdi1/work/libftdi1-1.3
1 error

make[4]: stopped in /usr/ports/devel/libftdi1/work/libftdi1-1.3
*** [python/CMakeFiles/doc_i.dir/all] Error code 2

make[3]: stopped in /usr/ports/devel/libftdi1/work/libftdi1-1.3
1 error

make[3]: stopped in /usr/ports/devel/libftdi1/work/libftdi1-1.3
*** [all] Error code 2

make[2]: stopped in /usr/ports/devel/libftdi1/work/libftdi1-1.3
1 error

make[2]: stopped in /usr/ports/devel/libftdi1/work/libftdi1-1.3
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

make[1]: stopped in /usr/ports/devel/libftdi1
*** Error code 1
Comment 1 Boris Samorodov freebsd_committer 2017-05-02 14:30:22 UTC
Hi Drhowarddrfine,

I can't reproduce the error both at 10.3-amd64 and HEAD-amd64:

You didn't mention it at the comment, but you seem to use ccache. What if you try without ccache?
Then, you may try to upgrade your ports to the latest versions (there have been some clang/gcc modifications).
And if all that doesn't make the port to build I recommend trying ports-mgmt/poudriere. It's an awesome program to build/check ports/packages.

HTH & WBR, Boris
Comment 2 Kenji Rikitake 2017-05-03 02:10:55 UTC
(In reply to Boris Samorodov from comment #1)
the DOCS option of 'make config' generates SIGSEGV on FreeBSD amd64 11.0-STABLE r313572, disabling CCACHE.

Log here:

--- examples/CMakeFiles/find_all_pp.dir/all ---
[ 88%] Building CXX object examples/CMakeFiles/find_all_pp.dir/find_all_pp.cpp.o
cd /usr/ports/devel/libftdi1/work/libftdi1-1.3/examples && /usr/local/libexec/cc
ache/c++   -I/usr/ports/devel/libftdi1/work/libftdi1-1.3/src -I/usr/ports/devel/libftdi1/work/libftdi1-1.3/ftdipp -I/usr/ports/devel/libftdi1/work/libftdi1-1.3/examples -I/usr/local/include -O2 -pipe -fno-omit-frame-pointer -fstack-protecto
r -fno-strict-aliasing -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-
strict-aliasing   -Wall -o CMakeFiles/find_all_pp.dir/find_all_pp.cpp.o -c /usr/
--- examples/find_all_pp ---
[ 90%] Linking CXX executable find_all_pp
cd /usr/ports/devel/libftdi1/work/libftdi1-1.3/examples && /usr/local/bin/cmake
-E cmake_link_script CMakeFiles/find_all_pp.dir/link.txt --verbose=1
/usr/local/libexec/ccache/c++  -O2 -pipe -fno-omit-frame-pointer -fstack-protect
or -fno-strict-aliasing -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno
-strict-aliasing   -fstack-protector CMakeFiles/find_all_pp.dir/find_all_pp.cpp.
o  -o find_all_pp -Wl,-rpath,/usr/ports/devel/libftdi1/work/libftdi1-1.3/ftdipp:
/usr/ports/devel/libftdi1/work/libftdi1-1.3/src ../ftdipp/libftdipp1.so.2.3.0 ..
/src/libftdi1.so.2.3.0 -lusb
[ 90%] Built target find_all_pp
--- python/CMakeFiles/doc_i.dir/all ---
Segmentation fault (core dumped)
*** [doc/xml/ftdi_8c.xml] Error code 139

Another log when portmaster was run with MAKE_JOBS_UNSAFE=yes:

[ 25%] Built target ftdipp1
/usr/bin/make -f python/CMakeFiles/doc_i.dir/build.make python/CMakeFiles/doc_i.dir/depend
cd /usr/ports/devel/libftdi1/work/libftdi1-1.3 && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /usr/ports/devel/libftdi1/work/libftdi1-1.3 /usr/ports/devel/libftdi1/work/libftdi1-1.3/python /usr/ports/devel/libftdi1/work/libftdi1-1.3 /usr/ports/devel/libftdi1/work/libftdi1-1.3/python /usr/ports/devel/libftdi1/work/libftdi1-1.3/python/CMakeFiles/doc_i.dir/DependInfo.cmake --color=
Scanning dependencies of target doc_i
/usr/bin/make -f python/CMakeFiles/doc_i.dir/build.make python/CMakeFiles/doc_i.dir/build
[ 27%] Generating ../doc/xml/ftdi_8c.xml
/usr/local/bin/cmake -E make_directory /usr/ports/devel/libftdi1/work/libftdi1-1.3/doc
/usr/local/bin/doxygen /usr/ports/devel/libftdi1/work/libftdi1-1.3/Doxyfile.xml
*** Signal 11

Comment 3 Kenji Rikitake 2017-05-03 02:12:23 UTC
Building without DOCS option enabled (use `make config` to disable) worked OK.
Comment 4 Walter Schwarzenfeld freebsd_triage 2017-05-03 06:31:32 UTC
You can build with DOCS=on, if PYTHON=off.
Comment 5 drhowarddrfine 2017-05-05 16:04:13 UTC
I concur that building with DOCS disabled caused the upgrade to complete successfully.

For some reason, I didn't get notification of these comments.
Comment 6 Walter Schwarzenfeld freebsd_triage 2017-05-05 21:50:42 UTC
If I am right, it is in the moment not solvable to build DOCS
The error seems caused here:
option ( PYTHON_BINDINGS "Build python bindings via swig" ON )
option ( LINK_PYTHON_LIBRARY "Link against python libraries" ON )

  # workaround for cmake bug #0013449
    find_package ( SWIG )
  else ()
    find_program ( SWIG_EXECUTABLE NAMES swig2.0 swig )
      set ( SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake )
      set ( SWIG_FOUND TRUE )
    endif ()
  endif ()
  find_package ( PythonLibs )
  find_package ( PythonInterp )
endif ()

cause of 
=> # workaround for cmake bug #0013449

The only solution seems:
Comment 7 Walter Schwarzenfeld freebsd_triage 2017-05-06 01:08:16 UTC
I was wrong, cause it builds with poudriere.
Comment 8 Walter Schwarzenfeld freebsd_triage 2017-05-06 03:39:29 UTC
If I comment out in python/CMakeLists.txt
=>   find_package ( PythonInterp )
it compiles, but does not make the *.py files.
It does not find find the python interpreter.
Comment 9 Walter Schwarzenfeld freebsd_triage 2017-05-06 04:20:16 UTC
This should work:
+                -DPYTHON_BINDINGS:BOOL=false

 USES+=          python:2
+                 -DDOCUMENTATION:BOOL=false
 BUILD_DEPENDS+= ${LOCALBASE}/bin/swig2.0:devel/swig20
Comment 10 Walter Schwarzenfeld freebsd_triage 2017-05-06 04:42:20 UTC
Created attachment 182324 [details]
Comment 11 Walter Schwarzenfeld freebsd_triage 2018-01-16 12:49:17 UTC
Submitter and maintainer feedback, please!
Comment 12 Kenji Rikitake 2018-01-16 13:41:15 UTC
(In reply to w.schwarzenfeld from comment #11)
With the "possible_patch-libftdi1_Makefile", the Port was built and installed OK on amd64 11.1-STABLE r326726. Sorry for getting so late!
Comment 13 commit-hook freebsd_committer 2018-01-16 15:23:04 UTC
A commit references this bug:

Author: bsam
Date: Tue Jan 16 15:22:47 UTC 2018
New revision: 459183
URL: https://svnweb.freebsd.org/changeset/ports/459183

  devel/libftdi1: DOCS and PYTHON options can not be used together.

  PR:		219013
  Submitted by:	drhowarddrfine@charter.net
  Patch by:	w.schwarzenfeld@utanet.at

Comment 14 Boris Samorodov freebsd_committer 2018-01-16 15:24:26 UTC
The patch has been just committed. Thanks all!