Bug 219013 - devel/libftdi1 Segmentation fault (core dumped) during update
Summary: devel/libftdi1 Segmentation fault (core dumped) during update
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Boris Samorodov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-02 13:01 UTC by drhowarddrfine
Modified: 2018-01-16 15:24 UTC (History)
2 users (show)

See Also:
bsam: maintainer-feedback+


Attachments
possible_patch-libftdi1_Makefile (663 bytes, patch)
2017-05-06 04:42 UTC, Walter Schwarzenfeld
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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

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

I can't reproduce the error both at 10.3-amd64 and HEAD-amd64:
https://poudriere.passap.ru/data/103-amd64-testing/2017-05-02_16h59m41s/logs/libftdi1-1.3_3.log
https://poudriere.passap.ru/data/HEAD-amd64-testing/2017-05-02_16h37m55s/logs/libftdi1-1.3_3.log

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/
ports/devel/libftdi1/work/libftdi1-1.3/examples/find_all_pp.cpp
--- 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

Stop.
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 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 2017-05-05 21:50:42 UTC
If I am right, it is in the moment not solvable to build DOCS
and PYTHON.
The error seems caused here:
libftdi1/CMakeLists.txt 
option ( PYTHON_BINDINGS "Build python bindings via swig" ON )
option ( LINK_PYTHON_LIBRARY "Link against python libraries" ON )

if ( PYTHON_BINDINGS )
  # workaround for cmake bug #0013449
  if ( NOT DEFINED CMAKE_FIND_ROOT_PATH )
    find_package ( SWIG )
  else ()
    find_program ( SWIG_EXECUTABLE NAMES swig2.0 swig )
    if ( SWIG_EXECUTABLE )
      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:
DOCS_PREVENTS= PYTHON
PYTHON_PREVENTS= DOCS
Comment 7 Walter Schwarzenfeld 2017-05-06 01:08:16 UTC
I was wrong, cause it builds with poudriere.
Comment 8 Walter Schwarzenfeld 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 2017-05-06 04:20:16 UTC
This should work:
Makefile:
 .if ${PORT_OPTIONS:MDOCS}
- CMAKE_ARGS+=    -DDOCUMENTATION:BOOL=true 
+ CMAKE_ARGS+=    -DDOCUMENTATION:BOOL=true \
+                -DPYTHON_BINDINGS:BOOL=false
 .else
 CMAKE_ARGS+=    -DDOCUMENTATION:BOOL=false
.endif

....
 .if ${PORT_OPTIONS:MPYTHON}
 USES+=          python:2
-  CMAKE_ARGS+=    -DPYTHON_BINDINGS:BOOL=true
+ CMAKE_ARGS+=    -DPYTHON_BINDINGS:BOOL=true \
+                 -DDOCUMENTATION:BOOL=false
 BUILD_DEPENDS+= ${LOCALBASE}/bin/swig2.0:devel/swig20
 .else
 CMAKE_ARGS+=    -DPYTHON_BINDINGS:BOOL=false
 .endif
Comment 10 Walter Schwarzenfeld 2017-05-06 04:42:20 UTC
Created attachment 182324 [details]
possible_patch-libftdi1_Makefile
Comment 11 Walter Schwarzenfeld 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 freebsd_triage 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

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

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

Changes:
  head/devel/libftdi1/Makefile
Comment 14 Boris Samorodov freebsd_committer freebsd_triage 2018-01-16 15:24:26 UTC
The patch has been just committed. Thanks all!