Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#40893 closed defect (fixed)

encfs 1.7.4 build fails including sys/endian.h on Mavericks

Reported by: andrew.t.baldwin@… Owned by: Markus.Ueberall@…
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: mavericks Cc: qpjevi@…, axet (Alexey Kuznetsov), jrblevin@…, mauricio_ville@…, mni@…, nicolas.stransky@…, bruins@…, lawrence.ong@…, garillka@…, simon.oulevay@…, macports@…, hapaguy (Brian Kurt Fujikawa), petr@…, SickTeddyBear, cscott@…, macports@…, plucinski.mariusz@…, macports@…, thomas@…, biofilter@…, rectalogic (Andrew Wason), matteonibbi@…
Port: encfs

Description

Attempting a clean install of encfs fails locally in OS X 10.9, with the error log showing

:info:build libtool: compile:  /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I.. -I../intl -I/opt/local/include -D__FreeBSD__=10 -D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26 -D__STDC_FORMAT_MACROS -DRLOG_COMPONENT=encfs -I/opt/local/include -I/opt/local/include -I/opt/local/include -D__FreeBSD__=10 -DLOCALEDIR=\"/opt/local/share/locale\" -W -Wall -Wpointer-arith -Wwrite-strings -pipe -Os -arch x86_64 -D_THREAD_SAFE -MT ConfigVar.lo -MD -MP -MF .deps/ConfigVar.Tpo -c ConfigVar.cpp  -fno-common -DPIC -o .libs/ConfigVar.o
:info:build In file included from readpassphrase.cpp:38:
:info:build In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/csignal:43:
:info:build /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config:45:11: fatal error: 'sys/endian.h' file not found
:info:build # include <sys/endian.h>
:info:build           ^
:info:build In file included from ConfigReader.cpp:18:
:info:build In file included from ./ConfigReader.h:21:
:info:build In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:429:
:info:build /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config:45:11: fatal error: 'sys/endian.h' file not found
:info:build # include <sys/endian.h>
:info:build           ^
:info:build In file included from ConfigVar.cpp:18:
:info:build In file included from ./ConfigVar.h:21:
:info:build In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:429:
:info:build /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config:45:11: fatal error: 'sys/endian.h' f
ile not found
:info:build # include <sys/endian.h>
:info:build           ^
:info:build mv -f .deps/base64.Tpo .deps/base64.Plo
:info:build 1 error generated.
:info:build make[2]: *** [readpassphrase.lo] Error 1

Attachments (2)

Portfile-encfs.diff (458 bytes) - added by ak@… 11 years ago.
Patch for encfs Portfile to add compile options for OS-X 10.9
Portfile-encfs-using-svn.diff (1.1 KB) - added by lukhnos (Lukhnos Liu) 11 years ago.
An alternative patch that uses svn to checkout the latest 1.x branch

Download all attachments as: .zip

Change History (46)

comment:1 Changed 11 years ago by qpjevi@…

Cc: qpjevi@… added

Cc Me!

comment:2 Changed 11 years ago by axet (Alexey Kuznetsov)

Cc: ak@… added

Cc Me!

comment:4 Changed 11 years ago by jrblevin@…

Cc: jrblevin@… added

Cc Me!

comment:5 Changed 11 years ago by mauricio_ville@…

Cc: mauricio_ville@… added

Cc Me!

comment:6 Changed 11 years ago by mni@…

Cc: mni@… added

Cc Me!

comment:7 Changed 11 years ago by nicolas.stransky@…

Cc: nicolas.stransky@… added

Cc Me!

comment:8 Changed 11 years ago by bruins@…

Cc: bruins@… added

Cc Me!

comment:9 Changed 11 years ago by lawrence.ong@…

Cc: lawrence.ong@… added

Cc Me!

comment:10 Changed 11 years ago by garillka@…

Cc: garillka@… added

Cc Me!

comment:11 in reply to:  10 ; Changed 11 years ago by garillka@…

Replying to garillka@…:

Cc Me!

workaround

port uninstall encfs boost fuse4x-kext fuse4x port clean encfs boost fuse4x-kext fuse4x port install boost configure.compiler=macports-clang-3.3 # reboot port install encfs configure.compiler=macports-clang-3.3

comment:12 in reply to:  11 ; Changed 11 years ago by lawrence.ong@…

Replying to garillka@…:

Replying to garillka@…:

Cc Me!

workaround

port uninstall encfs boost fuse4x-kext fuse4x port clean encfs boost fuse4x-kext fuse4x port install boost configure.compiler=macports-clang-3.3 # reboot port install encfs configure.compiler=macports-clang-3.3

Thanks. It works for me

comment:13 Changed 11 years ago by simon.oulevay@…

I tried this workaround but then encfs fails with a malloc error.

#> ENCFS6_CONFIG=~/.encfs6.xml encfs /encrypted /mount --extpass="head -n 1 /password.txt" -- -ovolname=Safe

encfs(37221,0x7fff75a13310) malloc: *** error for object 0x7fe09b3002e8: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

comment:14 Changed 11 years ago by axet (Alexey Kuznetsov)

remount around 1000 times, it will fix :(

https://code.google.com/p/encfs/issues/detail?id=182

comment:15 in reply to:  12 ; Changed 11 years ago by kacnow@…

Replying to lawrence.ong@…:

Replying to garillka@…:

Replying to garillka@…:

Cc Me!

workaround

port uninstall encfs boost fuse4x-kext fuse4x port clean encfs boost fuse4x-kext fuse4x port install boost configure.compiler=macports-clang-3.3 # reboot port install encfs configure.compiler=macports-clang-3.3

Thanks. It works for me

Doesnt work for me:

$ sudo port install boost configure.compiler=macports-clang-3.3 ---> Computing dependencies for boost ---> Dependencies to be installed: clang-3.3 clang_select ld64 cctools-headers dyld-headers libunwind-headers llvm-3.3 llvm_select Error: The following dependencies were not installed: clang-3.3 clang_select ld64 cctools-headers dyld-headers libunwind-headers llvm-3.3 llvm_select To report a bug, follow the instructions in the guide:

http://guide.macports.org/#project.tickets

Error: Processing of port boost failed

comment:16 in reply to:  description Changed 11 years ago by qvacua@…

CC Me!

comment:17 Changed 11 years ago by simon.oulevay@…

Cc: simon.oulevay@… added

Cc Me!

comment:18 in reply to:  15 Changed 11 years ago by lawrence.ong@…

Replying to kacnow@…:

Replying to lawrence.ong@…:

Replying to garillka@…:

Replying to garillka@…:

Cc Me!

workaround

port uninstall encfs boost fuse4x-kext fuse4x port clean encfs boost fuse4x-kext fuse4x port install boost configure.compiler=macports-clang-3.3 # reboot port install encfs configure.compiler=macports-clang-3.3

Thanks. It works for me

Doesnt work for me:

$ sudo port install boost configure.compiler=macports-clang-3.3 ---> Computing dependencies for boost ---> Dependencies to be installed: clang-3.3 clang_select ld64 cctools-headers dyld-headers libunwind-headers llvm-3.3 llvm_select Error: The following dependencies were not installed: clang-3.3 clang_select ld64 cctools-headers dyld-headers libunwind-headers llvm-3.3 llvm_select To report a bug, follow the instructions in the guide:

http://guide.macports.org/#project.tickets

Error: Processing of port boost failed

The error message says that dependencies were not installed. So, just install them first:

$ sudo port install clang-3.3 clang_select ld64 cctools-headers dyld-headers libunwind-headers llvm-3.3 llvm_select

comment:19 Changed 11 years ago by macports@…

Hi,

after upgrading to 10.9 and re-compiling my installed ports, I also received the following encfs-compilation error:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/stringIn
file included from ConfigVar.cpp::42918:
:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config./ConfigVar.h:45:11:
fatal error: 'sys/endian.h' file not found:21:
In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:
429:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config:45:11:
fatal error: 'sys/endian.h' file not found
# include <sys/endian.h>
          ^
# include <sys/endian.h>

After re-compiling boost and encfs via clang=3.3

$ sudo port install boost configure.compiler=macports-clang-3.3

I also receive the malloc checksum error...

encfs(24175,0x7fff7aac0310) malloc: *** error for object 0x7fb56b615d38:
incorrect checksum for freed object - object was probably modified after
being freed.
*** set a breakpoint in malloc_error_break to debug

Please CC me, once a bugfix is released.

Thanks Marcel

Version 0, edited 11 years ago by macports@… (next)

comment:20 Changed 11 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:21 Changed 11 years ago by neurodroid (Christoph Schmidt-Hieber)

I've submitted a patch against the 1.7.x branch to fix the shared_ptr and the missing header (endian.h) bugs when the default compiler (clang 5) is used. Hopefully this will make it into encfs 1.7.5.

Last edited 11 years ago by neurodroid (Christoph Schmidt-Hieber) (previous) (diff)

comment:22 Changed 11 years ago by neurodroid (Christoph Schmidt-Hieber)

Update: The following environment variables need to be set to build encfs 1.7.4 on OS X 10.9 without any patches:

CPPFLAGS="-I/opt/local/include -mmacosx-version-min=10.7" LDFLAGS="-L/opt/local/lib -mmacosx-version-min=10.7" ./configure

Can someone patch the encfs Portfile accordingly?

See https://code.google.com/p/encfs/issues/detail?id=185

comment:23 Changed 11 years ago by raimue (Rainer Müller)

Owner: changed from macports-tickets@… to Markus.Ueberall@…

comment:24 Changed 11 years ago by hapaguy (Brian Kurt Fujikawa)

Cc: brian.fujikawa@… added

Cc Me!

comment:25 Changed 11 years ago by petr@…

Cc: petr@… added

Cc Me!

comment:26 Changed 11 years ago by SickTeddyBear

Cc: amcgee@… added

Cc Me!

comment:27 Changed 11 years ago by cscott@…

Cc: cscott@… added

Cc Me!

Changed 11 years ago by ak@…

Attachment: Portfile-encfs.diff added

Patch for encfs Portfile to add compile options for OS-X 10.9

comment:28 in reply to:  22 Changed 11 years ago by ak@…

Hi,

after patching der Portfile for encfs, it compiles w/o errors. But running encfs ends with an boost issue:

dyld: lazy symbol binding failed: Symbol not found: __ZN5boost7archive17xml_iarchive_implINS0_12xml_iarchiveEEC2ERSij
  Referenced from: /opt/local/lib/libencfs.6.dylib
  Expected in: flat namespace

dyld: Symbol not found: __ZN5boost7archive17xml_iarchive_implINS0_12xml_iarchiveEEC2ERSij
  Referenced from: /opt/local/lib/libencfs.6.dylib
  Expected in: flat namespace

Also tried to recompile boost without success.

comment:29 Changed 11 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:30 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Why was -mmacosx-version-min=10.7 needed? That reveals a deeper issue.

Why is this using flat namespace?

comment:31 Changed 11 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Keywords: mavericks added

comment:32 Changed 11 years ago by plucinski.mariusz@…

Cc: plucinski.mariusz@… added

Cc Me!

comment:33 Changed 11 years ago by craftey

Why not patching the Portfile like this?

platform darwin 13 { 
   configure.cppflags-append   "-I/opt/local/include -mmacosx-version-min=10.7" 
   configure.ldflags-append    "-L/opt/local/lib -mmacosx-version-min=10.7" 
}

EDIT: I guess /opt/local must be replaced with something generic.

Last edited 11 years ago by craftey (previous) (diff)

comment:34 Changed 11 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:35 Changed 11 years ago by thomas@…

Cc: thomas@… added

Cc Me!

comment:36 Changed 11 years ago by biofilter@…

Cc: biofilter@… added

Cc Me!

comment:37 Changed 11 years ago by detlevd (Detlev Droege)

I had the same problem - encfs compiled after applying the above patch, but it did not work, it failed with the malloc error also reported in https://trac.macports.org/ticket/40893#comment:19

Meanwhile I found a solution which works for me: Recompile 'rlog' with appropriate flags as reported at http://code.google.com/p/encfs/issues/detail?id=182#c5 . Be sure to add the '-s' option (port -s install ...) to force a recompile with gcc-4.8 as otherwise a non working precompiled binary might get fetched and installed. I don't know how to add this to the Portfile but I hope some wizzards will know and do it in the macports tree.

comment:38 Changed 11 years ago by rectalogic (Andrew Wason)

Cc: rectalogic@… added

Cc Me!

Changed 11 years ago by lukhnos (Lukhnos Liu)

An alternative patch that uses svn to checkout the latest 1.x branch

comment:39 Changed 11 years ago by lukhnos (Lukhnos Liu)

Quite a few changes have entered the 1.x branch of encfs and the as of r135 that branch (builds 1.7.5) fixes the build issues on OS X 10.9. No source package has been made yet, so I've made this diff that uses svn to check it out – see attachment Portfile-encfs-using-svn.diff.

It needs to generate the configure script first, and hence the overriding of configure.cmd. This being my first time editing a portfile, so the solution may have other issues, but it built encfs for me.

Last edited 11 years ago by lukhnos (Lukhnos Liu) (previous) (diff)

comment:40 Changed 11 years ago by jrblevin@…

Thanks, lukhnos, that patch worked for me! I was able to install encfs without recompiling either rlog or boost with special options:

% sudo port uninstall encfs boost fuse4x-kext fuse4x rlog
% sudo port clean encfs boost fuse4x-kext fuse4x rlog
% sudo port install encfs

No more symbol binding errors or malloc errors (as reported in #40893, which I was also getting with some previously proposed solutions out there).

comment:41 Changed 11 years ago by bruins@…

Thanks lukhnos. For me the patch did work, but I needed to manually do the build and install as the "port install encfs" step failed.

comment:42 Changed 11 years ago by simon.oulevay@…

This also got rid of the malloc errors for me. I put the patched file in a local portfile repository and the normal install command worked like a charm.

comment:43 Changed 11 years ago by neverpanic (Clemens Lang)

Resolution: fixed
Status: newclosed

The problem here seems to always have been a C++ standard library issue. In Mavericks clang's default C++ runtime library switched from libstdc++ to libc++. These two libraries are incompatible, however. Mixing them in the same binary causes the crashes you have seen. This incompatibility might also have caused the build error against boost reported above.

It seems encfs did not build against libc++ because of the sys/endian.h issue. Some people in this thread suggested using libstdc++ instead (e.g. by passing -mmacosx-version-min=10.7, which effectively disables the new default and re-instantiates the old one), which allowed encfs to build, but caused the crashes. http://code.google.com/p/encfs/issues/detail?id=182#c5 goes even further, suggesting to rebuild the rlog port with GCC, which will, in turn, cause the rlog port to use libstdc++, too. While this fixes the immediate crashes you have seen, it still is not a correct solution, because MacPorts boost is built against libc++ and encfs links against both rlog and boost, causing two different C++ runtimes to be present in the encfs binary – the people who did this were just lucky it didn't crash.

I've commited the patch in r116237 with the following changes:

  • whitespace adjusted to conform to the modeline
  • use of use_autoreconf yes and autoreconf.args -fvi instead of changing configure.cmd, because use_autoreconf automatically adds the necessary dependencies autoconf, automake and libtool.

I would like to ask everybody who rebuilt rlog with GCC to undo this change, as it will very likely break this fixed version of encfs.

comment:44 Changed 11 years ago by matteonibbi@…

Cc: matteonibbi@… added

Cc Me!

Note: See TracTickets for help on using tickets.