Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OSX support incomplete #3

Closed
schmatz opened this issue Nov 5, 2014 · 33 comments
Closed

Mac OSX support incomplete #3

schmatz opened this issue Nov 5, 2014 · 33 comments

Comments

@schmatz
Copy link

schmatz commented Nov 5, 2014

As per the readme, OS X support is incomplete. What work needs to be done to achieve full compatibility?

@dcsommer
Copy link
Contributor

dcsommer commented Nov 5, 2014

We haven't tried it yet. Thrift and Folly, our main depencies, are pretty much working under OS X. This line was basically to document that it is simply untested at this point.

@schmatz
Copy link
Author

schmatz commented Nov 5, 2014

Awesome. When I have time I'll test on OSX.

@schmatz
Copy link
Author

schmatz commented Nov 6, 2014

Building the dependencies is a bit tricky, at least on Yosemite. @dcsommer, would a guide for building on Mac be something worth investing time in?

@electrum
Copy link

electrum commented Nov 6, 2014

Perhaps even better than a guide would be a Homebrew formula. Then everyone could just brew install folly.

A brief search turned up Homebrew/legacy-homebrew#33086.

@rezacute
Copy link

rezacute commented Nov 9, 2014

I did the build via docker on yosemite , it will works as long as you set virtual box memory to 3 Gigs.
Can i contribute building via docker and docker file ?

@dcsommer
Copy link
Contributor

@rezacute Building via docker isn't really what we're looking for here. We want to get a native compile on OSX working.

@chaitanyav
Copy link

There is no support for numa on OSX. I get this error

configure: error: Please install numa library

The rest of the dependencies can be installed via brew
brew install flex bison pkg-config openssl libcapn gperf autoconf-archive libevent wget

@chaitanyav
Copy link

May be the dependencies can be detected like this

case `uname -s` in
  Darwin) install dependencies via brew
    ;;
  Linux) install dependencies via apt-get
    ;;
  FreeBSD) install dependencies via pkg
    ;;
  esac

But this might be a overkill. May be do a bunch of wget of the dependencies from a site and do plain old configure, make and make install . The dependencies versions should be known ahead.

@rezacute
Copy link

rezacute commented Dec 9, 2014

I have succeeded (but still can not run the echo samples) building proxygen on osx yosemite by lot of hacks especially on fbthrift (removing NUMA, and the compiler from the build).
Here is the error whenever i ran echo_server

Syahs-MacBook-Air:echo syahriza$ ./echo_server 
dyld: Symbol not found: __ZTIN6apache6thrift9transport16THeaderTransportE
  Referenced from: /Users/syahriza/Documents/private/Proxygen_dev/proxygen/proxygen/fbthrift/thrift/lib/cpp/.libs//libthrift.14.dylib
  Expected in: flat namespace
 in /Users/syahriza/Documents/private/Proxygen_dev/proxygen/proxygen/fbthrift/thrift/lib/cpp/.libs//libthrift.14.dylib
Trace/BPT trap: 5

Anyone have suggestion?

@chaitanyav
Copy link

@rezacute how did you get folly working on osx?

@afrind
Copy link
Contributor

afrind commented Apr 3, 2015

Maybe try again now that the dependency on fbthrift has been removed?

@yfinkelstein
Copy link

I was able to build the latest versions of folly and proxygen on Mac OS 10.10 using downloaded llvm

$ clang++ --version
Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)
Target: x86_64-apple-darwin14.3.0
Thread model: posix

and
having the following options:

./configure CXX=clang++ CXXFLAGS="-std=c++11 -stdlib=libc++ -nostdinc++ -I/opt/clang+llvm-3.6.1-x86_64-apple-darwin/include/c++/v1"

Boost was installed using

brew install boost --c++11

I have tried various other combinations of compilers and c++ libraries but only this configuration have worked and produced valid binaries.

I also struggled with building libproxygenssl using native darwin toolset (ar not gar)
and ended up adding a dummy c++ file with an empty function just to keep ar happy as it does not support creating libraries without specifying at least one object file:
In proxygen/lib/ssl/Makefile.am:

-libproxygenssl_la_SOURCES =
+libproxygenssl_la_SOURCES = dummy.cpp

With this setup "make check" in folly passes all tests except for one:

PASS: sorted_vector_types_test
PASS: foreach_test
PASS: hash_test
PASS: timeout_queue_test
PASS: conv_test
PASS: range_test
PASS: bits_test
PASS: bit_iterator_test
PASS: spin_lock_test
PASS: small_locks_test
PASS: packed_sync_ptr_test
PASS: small_vector_test
PASS: discriminated_ptr_test
PASS: cpuid_test
PASS: fbstring_test_using_jemalloc
PASS: thread_cached_int_test
FAIL: thread_local_test
PASS: fbvector_test
PASS: dynamic_test
PASS: json_test
PASS: scope_guard_test
PASS: endian_test
PASS: rw_spinlock_test
PASS: synchronized_test
PASS: concurrent_skiplist_test
PASS: histogram_test
PASS: group_varint_test
PASS: map_util_test
PASS: string_test
PASS: producer_consumer_queue_test
PASS: atomic_hash_array_test
PASS: atomic_hash_map_test
PASS: format_test
PASS: fingerprint_test
PASS: portability_test
PASS: spooky_hash_v1_test
PASS: spooky_hash_v2_test
============================================================================
Testsuite summary for folly 41.0
============================================================================
# TOTAL: 37
# PASS:  36
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

Details on the failed test in thread-local group:

[----------] 7 tests from ThreadLocalPtr
[ RUN      ] ThreadLocalPtr.BasicDestructor
[       OK ] ThreadLocalPtr.BasicDestructor (0 ms)
[ RUN      ] ThreadLocalPtr.CustomDeleter1
[       OK ] ThreadLocalPtr.CustomDeleter1 (0 ms)
[ RUN      ] ThreadLocalPtr.resetNull
[       OK ] ThreadLocalPtr.resetNull (0 ms)
[ RUN      ] ThreadLocalPtr.TestRelease
[       OK ] ThreadLocalPtr.TestRelease (0 ms)
[ RUN      ] ThreadLocalPtr.CreateOnThreadExit
ThreadLocalTest.cpp:118: Failure
Value of: Widget::totalVal_
  Actual: 1
Expected: 2
[  FAILED  ] ThreadLocalPtr.CreateOnThreadExit (0 ms)
[ RUN      ] ThreadLocalPtr.CustomDeleter2
[       OK ] ThreadLocalPtr.CustomDeleter2 (0 ms)
[ RUN      ] ThreadLocalPtr.AccessAllThreadsCounter
[       OK ] ThreadLocalPtr.AccessAllThreadsCounter (1 ms)
[----------] 7 tests from ThreadLocalPtr (1 ms total)

[----------] 8 tests from ThreadLocal
[ RUN      ] ThreadLocal.BasicDestructor
[       OK ] ThreadLocal.BasicDestructor (0 ms)
[ RUN      ] ThreadLocal.SimpleRepeatDestructor
[       OK ] ThreadLocal.SimpleRepeatDestructor (0 ms)
[ RUN      ] ThreadLocal.InterleavedDestructors
[       OK ] ThreadLocal.InterleavedDestructors (0 ms)
[ RUN      ] ThreadLocal.resetNull
[       OK ] ThreadLocal.resetNull (0 ms)
[ RUN      ] ThreadLocal.Movable1
[       OK ] ThreadLocal.Movable1 (0 ms)
[ RUN      ] ThreadLocal.Movable2
[       OK ] ThreadLocal.Movable2 (0 ms)
[ RUN      ] ThreadLocal.Fork
[       OK ] ThreadLocal.Fork (0 ms)
[ RUN      ] ThreadLocal.Fork2
[       OK ] ThreadLocal.Fork2 (1 ms)
[----------] 8 tests from ThreadLocal (2 ms total)

[----------] Global test environment tear-down
[==========] 15 tests from 2 test cases ran. (3 ms total)
[  PASSED  ] 14 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] ThreadLocalPtr.CreateOnThreadExit

 1 FAILED TEST
FAIL thread_local_test (exit status: 1)

make check proxygen also has failures in util tests:

FAIL: UtilTests
PASS: AsyncTimeoutSetTest
============================================================================
Testsuite summary for proxygen 24.0
============================================================================
# TOTAL: 2
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

util test details:

FAIL: UtilTests
===============

[==========] Running 32 tests from 6 test cases.
[----------] Global test environment set-up.
[----------] 12 tests from OwnedGenericFilterTest
[ RUN      ] OwnedGenericFilterTest.empty_chain
[       OK ] OwnedGenericFilterTest.empty_chain (0 ms)
[ RUN      ] OwnedGenericFilterTest.single_elem_chain
[       OK ] OwnedGenericFilterTest.single_elem_chain (0 ms)
[ RUN      ] OwnedGenericFilterTest.multi_elem_chain
[       OK ] OwnedGenericFilterTest.multi_elem_chain (0 ms)
[ RUN      ] OwnedGenericFilterTest.multi_elem_multi_add
[       OK ] OwnedGenericFilterTest.multi_elem_multi_add (0 ms)
[ RUN      ] OwnedGenericFilterTest.wants
[       OK ] OwnedGenericFilterTest.wants (0 ms)
[ RUN      ] OwnedGenericFilterTest.wants_multi_add
[       OK ] OwnedGenericFilterTest.wants_multi_add (0 ms)
[ RUN      ] OwnedGenericFilterTest.wants_multi_add_hard
[       OK ] OwnedGenericFilterTest.wants_multi_add_hard (139 ms)
[ RUN      ] OwnedGenericFilterTest.change_callback
[       OK ] OwnedGenericFilterTest.change_callback (0 ms)
[ RUN      ] OwnedGenericFilterTest.set_null_cb
[       OK ] OwnedGenericFilterTest.set_null_cb (1 ms)
[ RUN      ] OwnedGenericFilterTest.delete_chain
[       OK ] OwnedGenericFilterTest.delete_chain (0 ms)
[ RUN      ] OwnedGenericFilterTest.get_chain_end
[       OK ] OwnedGenericFilterTest.get_chain_end (144 ms)
[ RUN      ] OwnedGenericFilterTest.set_destination
[       OK ] OwnedGenericFilterTest.set_destination (1 ms)
[----------] 12 tests from OwnedGenericFilterTest (287 ms total)

[----------] 3 tests from UnownedGenericFilterTest
[ RUN      ] UnownedGenericFilterTest.all
[       OK ] UnownedGenericFilterTest.all (141 ms)
[ RUN      ] UnownedGenericFilterTest.delete_do
[       OK ] UnownedGenericFilterTest.delete_do (0 ms)
[ RUN      ] UnownedGenericFilterTest.delete_on
[       OK ] UnownedGenericFilterTest.delete_on (0 ms)
[----------] 3 tests from UnownedGenericFilterTest (141 ms total)

[----------] 4 tests from HTTPTimeTests
[ RUN      ] HTTPTimeTests.InvalidTimeTest
[       OK ] HTTPTimeTests.InvalidTimeTest (0 ms)
[ RUN      ] HTTPTimeTests.ValidTimeTest
[       OK ] HTTPTimeTests.ValidTimeTest (0 ms)
[ RUN      ] HTTPTimeTests.EqualTimeTest
HTTPTimeTest.cpp:37: Failure
Value of: c.value()
  Actual: 1362674977
Expected: a.value()
Which is: 1362646177
HTTPTimeTest.cpp:38: Failure
Value of: c.value()
  Actual: 1362674977
Expected: b.value()
Which is: 1362646177
[  FAILED  ] HTTPTimeTests.EqualTimeTest (0 ms)
[ RUN      ] HTTPTimeTests.ReallyOldTimeTest
HTTPTimeTest.cpp:43: Failure
Value of: a.hasValue()
  Actual: false
Expected: true
HTTPTimeTest.cpp:45: Failure
Value of: b.hasValue()
  Actual: false
Expected: true
HTTPTimeTest.cpp:49: Failure
Expected: (a) < (b), actual: 16-byte object <90-70 80-08 01-00 00-00 00-F0 82-08 01-00 00-00> vs 16-byte object <00-51 84-08 01-00 00-00 00-51 84-08 01-00 00-00>
[  FAILED  ] HTTPTimeTests.ReallyOldTimeTest (0 ms)
[----------] 4 tests from HTTPTimeTests (0 ms total)

[----------] 8 tests from ParseURL
[ RUN      ] ParseURL.HostNoBrackets
[       OK ] ParseURL.HostNoBrackets (0 ms)
[ RUN      ] ParseURL.FullyFormedURL
[       OK ] ParseURL.FullyFormedURL (1 ms)
[ RUN      ] ParseURL.NoScheme
[       OK ] ParseURL.NoScheme (0 ms)
[ RUN      ] ParseURL.NoSchemeIP
[       OK ] ParseURL.NoSchemeIP (0 ms)
[ RUN      ] ParseURL.PathOnly
[       OK ] ParseURL.PathOnly (0 ms)
[ RUN      ] ParseURL.QueryIsURL
[       OK ] ParseURL.QueryIsURL (0 ms)
[ RUN      ] ParseURL.InvalidURL
[       OK ] ParseURL.InvalidURL (0 ms)
[ RUN      ] ParseURL.IsHostIPAddress
[       OK ] ParseURL.IsHostIPAddress (0 ms)
[----------] 8 tests from ParseURL (1 ms total)

[----------] 4 tests from Result
[ RUN      ] Result.Copy
[       OK ] Result.Copy (0 ms)
[ RUN      ] Result.Move
[       OK ] Result.Move (0 ms)
[ RUN      ] Result.Assign
[       OK ] Result.Assign (0 ms)
[ RUN      ] Result.Emplace
[       OK ] Result.Emplace (0 ms)
[----------] 4 tests from Result (0 ms total)

[----------] 1 test from UtilTest
[ RUN      ] UtilTest.CaseInsensitiveEqual
[       OK ] UtilTest.CaseInsensitiveEqual (0 ms)
[----------] 1 test from UtilTest (0 ms total)

[----------] Global test environment tear-down
[==========] 32 tests from 6 test cases ran. (430 ms total)
[  PASSED  ] 30 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] HTTPTimeTests.EqualTimeTest
[  FAILED  ] HTTPTimeTests.ReallyOldTimeTest

 2 FAILED TESTS
FAIL UtilTests (exit status: 1)

Not sure if this a big deal and did not have time to look into the test code itself.
Is this to be expected in the current version in master branch?

But the real problem is the fact the echo sample consistently crashes within seconds with assertion in folly:

Assertion failed: (sp >= tls_stackLimit), function unmapUnusedStack, file detail/MemoryIdler.cpp, line 142.
[New Thread 0x1713 of process 21075]
[New Thread 0x1803 of process 21075]
[New Thread 0x1903 of process 21075]
[New Thread 0x1a03 of process 21075]
[New Thread 0x1b03 of process 21075]
[New Thread 0x1c03 of process 21075]
[New Thread 0x1d03 of process 21075]
[New Thread 0x1e03 of process 21075]
[New Thread 0x1f03 of process 21075]
[New Thread 0x2003 of process 21075]

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x1713 of process 21075]
0x00007fff8ace2286 in __pthread_kill () from /usr/lib/system/libsystem_kernel.dylib
(gdb) bt
#0  0x00007fff8ace2286 in __pthread_kill () from /usr/lib/system/libsystem_kernel.dylib
#1  0x00007fff879b442f in pthread_kill () from /usr/lib/system/libsystem_pthread.dylib
#2  0x00007fff8854bb53 in abort () from /usr/lib/system/libsystem_c.dylib
#3  0x00007fff88513c39 in __assert_rtn () from /usr/lib/system/libsystem_c.dylib
#4  0x0000000100623f57 in folly::detail::MemoryIdler::unmapUnusedStack(unsigned long) () from /usr/local/lib/libfolly.41.dylib
#5  0x00000001007704ed in folly::wangle::MemoryIdlerTimeout::runLoopCallback() () from /usr/local/lib/libfolly.41.dylib
#6  0x000000010077070c in non-virtual thunk to folly::wangle::MemoryIdlerTimeout::runLoopCallback() () from /usr/local/lib/libfolly.41.dylib
#7  0x00000001005f291f in folly::EventBase::loopBody(int) () from /usr/local/lib/libfolly.41.dylib
#8  0x00000001005f2237 in folly::EventBase::loop() () from /usr/local/lib/libfolly.41.dylib
#9  0x00000001005f45a4 in folly::EventBase::loopForever() () from /usr/local/lib/libfolly.41.dylib
#10 0x000000010076c56d in folly::wangle::IOThreadPoolExecutor::threadRun(std::__1::shared_ptr<folly::wangle::ThreadPoolExecutor::Thread>) () from /usr/local/lib/libfolly.41.dylib
#11 0x00000001007a6250 in std::__1::__function::__func<std::__1::__bind<void (folly::wangle::ThreadPoolExecutor::*)(std::__1::shared_ptr<folly::wangle::ThreadPoolExecutor::Thread>), folly::wangle::ThreadPoolExecutor*, std::__1::shared_ptr<folly::wangle::ThreadPoolExecutor::Thread>&>, std::__1::allocator<std::__1::__bind<void (folly::wangle::ThreadPoolExecutor::*)(std::__1::shared_ptr<folly::wangle::ThreadPoolExecutor::Thread>), folly::wangle::ThreadPoolExecutor*, std::__1::shared_ptr<folly::wangle::ThreadPoolExecutor::Thread>&> >, void ()>::operator()() () from /usr/local/lib/libfolly.41.dylib
#12 0x0000000100027498 in ?? () from /usr/local/lib/libproxygenhttpserver.0.dylib
#13 0x0000000105504000 in ?? ()
#14 0x0000000000001603 in ?? ()
#15 0x000000010400f3a0 in ?? ()
#16 0x0000000100027430 in ?? () from /usr/local/lib/libproxygenhttpserver.0.dylib
#17 0x0000000105503f10 in ?? ()
#18 0x00007fff879b2268 in _pthread_body () from /usr/lib/system/libsystem_pthread.dylib
Backtrace stopped: frame did not save the PC
(gdb) quit
A debugging session is active.

    Inferior 1 [process 21075] will be killed.


I tried linking both folly and proxygen with and without jemalloc - the same effect.

Can somebody explain the nature of this assertion and exception?

Thanks
Yuri

@bugok
Copy link
Contributor

bugok commented Jun 4, 2015

@jwatzman - do you might have an idea?

@jwatzman
Copy link
Contributor

jwatzman commented Jun 4, 2015

I don't, sorry. I have been poking at HHVM's dependencies (of which proxygen and folly are two) as well as HHVM itself to try to get it to build on OS X, but haven't quite succeeded yet. So there are likely issues actually running the code I have yet to get to :) Nothing in the traces above jumps out at me as an obvious likely culprit, sorry.

@lbrandy
Copy link

lbrandy commented Jun 4, 2015

My guess is that's just a bug. That particular code is doing some pretty platform-specific nonsense (e.g. comments about glibc internals) so I wouldn't be surprised if its just not portable. We can probably rip out the necessary bits to get a reasonable repro.

There might be a strong hint if you could pull sp and tls_stackLimit from that crash inside the debugger (it'll be in the unmapUnusedStack stack frame)?

bugok pushed a commit to facebook/folly that referenced this issue Jun 5, 2015
Summary:
This diff strengthens the preconditions for attempting to use
optimize by madvising away idle stacks, because it seemed to be causing
problems on OS X (facebook/proxygen#3).

Test Plan: unit tests

Reviewed By: ldbrandy@fb.com

Subscribers: folly-diffs@, yfeldblum, chalfant

FB internal diff: D2129100

Signature: t1:2129100:1433458268:0b6b3696dde6c2bd13b89bc7ec58f0b1898be458
@bugok
Copy link
Contributor

bugok commented Jun 5, 2015

@yfinkelstein: Thanks again for this. I just pushed a new version (43) to folly that has a fix for this.
Can you please try again? (Also, make sure that proxygen will refer version 43 of folly when you build proxygen against it.

ghost pushed a commit that referenced this issue Sep 18, 2015
…on closed

Summary: Add emitTraceEvents() to TraceEventObserver.

Reviewed By: @​yangchi

Differential Revision: D2429577
@jinlee
Copy link

jinlee commented Jan 20, 2016

I've spent a few hours now trying to get a valid OS X build working. However I was unable to get a valid build for neither folly nor wangle. Both fail to build from the latest master.

Wangle has two issues outstanding regarding OS X:

  1. Build fail on Mac OS X wangle#7
  2. Build error on OSX wangle#6

And this issue on folly which seems very similar to errors I was getting has no replies:

  1. OSX: thread_local_test and futures_test fail folly#292

From the issues I ran into with folly, supporting OS X will require some significant changes (such as removing the use of TLS). Would that sort of fix make sense on the private internal branch to support OS X?

@Dalzhim
Copy link

Dalzhim commented Mar 11, 2016

I'm also very interested into any plans for supporting OS X.

@fredemmott
Copy link
Contributor

https://github.com/hhvm/homebrew-hhvm/ could be a useful reference - HHVM uses Folly, Wangle, and Proxygen, and builds on OSX via homebrew with that.

@jwatzman
Copy link
Contributor

The specific bits of folly and proxygen that HHVM needs to build and work on OS X, but notably that is not all of folly, and doesn't include any of the folly or proxygen binaries or tests. So it's possible to use as a library as-is, but not without some serious finagling.

@Dalzhim
Copy link

Dalzhim commented Apr 28, 2016

I have worked on compiling Proxygen on OS X and I've been successful after a few modifications along the way. I've blogged about it over here and I'd like to know if you're having any success reproducing my results. I hope this may help to bring full OS X support to the Proxygen library eventually.

@amin-jabri
Copy link

I have tried to build Proxygen on OSX, but still blocked due to missing libcap. Is there a way to workaround the "libcap" dependency?

@Dalzhim
Copy link

Dalzhim commented Feb 10, 2017

Simply comment out the else clause in the configure script where it spits an error. That way it will keep going without generating the #define HAVE_LIBCAP 1 instruction which is all fine to experiment with Proxygen on OS X.

@andrewstucki
Copy link

andrewstucki commented Nov 11, 2017

Not to resurrect old issues or anything, but just in case someone else wanted some steps for building proxygen on OS X, here's a gist of what I did that got everything up and running pretty quickly.

Only real oddities are that you have to patch the configuration and Makefiles to link against boost_thread-mt instead of boost_thread and also use shasum instead of sha1sum when verifying the google package dependencies.

P.S. There are some test failures for both Wangle and Proxygen when building against OS X, so you are in a bit of uncharted territory, but running and compiling the Proxygen samples seems to work like a charm.

@dio
Copy link

dio commented Jan 9, 2018

Add a comment to ☝️ gist. It seems OK now to compile latest proxygen, given latest wangle with latest folly from homebrew on osx.

I'm at least able to run the echo sample 🙌 .

@fredemmott
Copy link
Contributor

For what it’s worth, it’s been used as part of HHVM on Mac for a few years now, without any issues I remember - though we extended HHVM’s cmake-based build system to build it, rather than using proxygen’s one

facebook-github-bot pushed a commit that referenced this issue Mar 8, 2018
Summary:
Exposed by UBSAN:
```lang=bash
  proxygen/lib/http/codec/SPDYConstants.cpp:67:11: runtime error: load of value 314159, which is not a valid value for type 'proxygen::spdy::ResetStatusCode'
      #0 0x7f81bb4b39d9 in proxygen::spdy::rstToErrorCode(proxygen::spdy::ResetStatusCode) proxygen/lib/http/codec/SPDYConstants.cpp:67
      #1 0x7f81bb443d31 in proxygen::SPDYCodec::onRstStream(unsigned int) proxygen/lib/http/codec/SPDYCodec.cpp:1331
      #2 0x7f81bb43f559 in proxygen::SPDYCodec::onControlFrame(folly::io::Cursor&) proxygen/lib/http/codec/SPDYCodec.cpp:376
      #3 0x7f81bb43c305 in proxygen::SPDYCodec::parseIngress(folly::IOBuf const&) proxygen/lib/http/codec/SPDYCodec.cpp:309
      #4 0x7f81bb43a4ec in proxygen::SPDYCodec::onIngress(folly::IOBuf const&) proxygen/lib/http/codec/SPDYCodec.cpp:243
      #5 0x7f81cdf12854 in proxygen::PassThroughHTTPCodecFilter::onIngress(folly::IOBuf const&) proxygen/lib/http/codec/HTTPCodecFilter.cpp:170
      #6 0x7f81cdf12854 in proxygen::PassThroughHTTPCodecFilter::onIngress(folly::IOBuf const&) proxygen/lib/http/codec/HTTPCodecFilter.cpp:170
      #7 0x7f81cdf12854 in proxygen::PassThroughHTTPCodecFilter::onIngress(folly::IOBuf const&) proxygen/lib/http/codec/HTTPCodecFilter.cpp:170
      #8 0x7f81cdf12854 in proxygen::PassThroughHTTPCodecFilter::onIngress(folly::IOBuf const&) proxygen/lib/http/codec/HTTPCodecFilter.cpp:170
      #9 0x7f81d0da0239 in proxygen::HTTPSession::processReadData() proxygen/lib/http/session/HTTPSession.cpp:487
      #10 0x7f81d0d9fe39 in proxygen::HTTPSession::readDataAvailable(unsigned long) proxygen/lib/http/session/HTTPSession.cpp:440
      #11 0x7f81e6daea85 in folly::AsyncSocket::handleRead() folly/io/async/AsyncSocket.cpp:1900
      #12 0x7f81e6da93f9 in folly::AsyncSocket::ioReady(unsigned short) folly/io/async/AsyncSocket.cpp:1694
      #13 0x7f81e6dc14ee in folly::AsyncSocket::IoHandler::handlerReady(unsigned short) folly/io/async/AsyncSocket.h:976
      #14 0x7f81e6e5e91b in folly::EventHandler::libeventCallback(int, short, void*) folly/io/async/EventHandler.cpp:160
      #15 0x7f81de739b11 in event_process_active /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:390
      #16 0x7f81de739b11 in event_base_loop /home/engshare/third-party2/libevent/1.4.14b_hphp/src/libevent-1.4.14b-stable/event.c:532
      #17 0x7f81e6e11864 in folly::EventBase::loopBody(int) folly/io/async/EventBase.cpp:313
      #18 0x7f81e6e10726 in folly::EventBase::loop() folly/io/async/EventBase.cpp:252
      #19 0x7f81e6e14e85 in folly::EventBase::loopForever() folly/io/async/EventBase.cpp:450
      #20 0x7f81c4141a7b in proxygen::WorkerThread::runLoop() proxygen/lib/services/WorkerThread.cpp:137
      #21 0x7f81c4143afe in proxygen::WorkerThread::start()::$_0::operator()() proxygen/lib/services/WorkerThread.cpp:41
      #22 0x7f81c4143a34 in void std::_Bind_simple<proxygen::WorkerThread::start()::$_0 ()>::_M_invoke<>(std::_Index_tuple<>) third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1530
      #23 0x7f81c4143a04 in std::_Bind_simple<proxygen::WorkerThread::start()::$_0 ()>::operator()() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/functional:1520
      #24 0x7f81c41438d8 in std::thread::_Impl<std::_Bind_simple<proxygen::WorkerThread::start()::$_0 ()> >::_M_run() third-party-buck/gcc-5-glibc-2.23/build/libgcc/include/c++/trunk/thread:115
      #25 0x7f81da7ef170 in execute_native_thread_routine /home/engshare/third-party2/libgcc/5.x/src/gcc-5/x86_64-facebook-linux/libstdc++-v3/src/c++11/../../../.././libstdc++-v3/src/c++11/thread.cc:84
      #26 0x7f81d7e1f7a8 in start_thread /home/engshare/third-party2/glibc/2.23/src/glibc-2.23/nptl/pthread_create.c:333
      #27 0x7f81d71f9a7c in __clone /home/engshare/third-party2/glibc/2.23/src/glibc-2.23/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:109

  SUMMARY: UndefinedBehaviorSanitizer: invalid-enum-load proxygen/lib/http/codec/SPDYConstants.cpp:67:11
```
Here we have a typical function that converts from one enum type to another. There is a special validation logic in place, if the original enum value is not among predetermined values the result is a "special" error value. UBSAN detected that the argumemnt value which was provided was invalid for the original enum type. To prevent the UB and potential overflow use an int type.

Reviewed By: w-o-o

Differential Revision: D7185566

fbshipit-source-id: 613c8c6aa64d24c48889810e56a79fd370cdb32b
@lnicco
Copy link
Contributor

lnicco commented Jul 9, 2019

well, I am happy to say that this should be fixed now.
After moving the build to CMake it should build on mac via the same build.sh script.
Please give it a try.

@lnicco lnicco closed this as completed Jul 9, 2019
@Dalzhim
Copy link

Dalzhim commented Jul 11, 2019

I tried running build.sh on my mac but it couldn't resolve the libsodium dependency of fizz. Here's the relevant error:

CMake Error at /usr/local/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Sodium (missing: sodium_LIBRARY_RELEASE sodium_LIBRARY_DEBUG
  sodium_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindSodium.cmake:227 (find_package_handle_standard_args)
  CMakeLists.txt:54 (find_package)

I tried building every dependency manually and I had to disable building the tests for some dependencies. I managed to compile proxygen but couldn't link it because of some linking errors related to libfolly. It might not be helpful to consider this though as I may have made a mistake while building everything manually. Better focus on the dependency problem with build.sh.

@lnicco
Copy link
Contributor

lnicco commented Jul 11, 2019

ok, let me reopen and look at this. thanks!

@lnicco lnicco reopened this Jul 11, 2019
facebook-github-bot pushed a commit that referenced this issue Dec 10, 2019
Summary:
This should fix the Travis CI builds. It adds rust toolchain support inside docker and sets the required THRIFT env variable.
Pull Request resolved: facebookexperimental/rust-shed#3

Reviewed By: krallin

Differential Revision: D18905608

Pulled By: lukaspiatkowski

fbshipit-source-id: 5db1eff6f215a6617d8acaa0c99a62d45225956b
@benstadin
Copy link

Any updates on this?

@lnicco
Copy link
Contributor

lnicco commented Mar 9, 2020

@benstadin there are two build script that should help you get a mac build.

  1. cd proxygen && build.sh and
  2. getdeps.sh (in the top-level directory of the repo)

1 uses homebrew to pull dependencies
2 builds all the dependencies, hence it should be more stable, but its currently still not 100% supported.

Let me know if you hit any build issue

@MathBunny
Copy link

@lnicco Hi, I'm running into an issue with building Proxygen when getting to Folly:

/Users/horatiulazu/Desktop/Programming-Projects/proxygen/proxygen-2020.04.20.00/proxygen/_build/deps/folly/folly/memory/detail/MallocImpl.h:53:14: error: 
      redefinition of 'mallctlnametomib' as different kind of symbol
extern int (*mallctlnametomib)(const char*, size_t*, size_t*);
             ^
/usr/local/include/jemalloc/jemalloc.h:250:38: note: previous definition is here
JEMALLOC_EXPORT int JEMALLOC_NOTHROW    je_mallctlnametomib(const char *name,
                                        ^
/usr/local/include/jemalloc/jemalloc.h:65:31: note: expanded from macro
      'je_mallctlnametomib'
#  define je_mallctlnametomib mallctlnametomib

However I installed Folly using brew so I am not sure why Proxygen is rebuilding it. Here is a link to more output: link.

I'm on OS X High Sierra (10.13.3)

@lnicco
Copy link
Contributor

lnicco commented Sep 11, 2020

closing this issue again. please refer to the scripts mentioned above for building on osx.
If the build fails, please file a separate issue

@MathBunny thanks for reporting that build failure, it does look like a problem with the folly setup though.
you can try ./build.sh -m to see if it helps

@lnicco lnicco closed this as completed Sep 11, 2020
facebook-github-bot pushed a commit that referenced this issue Aug 31, 2023
Summary:
Generic WebTransport interface

Principles:

1. It should be easy to write simple applications
2. The backpressure and error handling APIs should be understandable
3. The same generic API should work with traditional async code and coroutines

Futures is the best way to implement #3 because they can also be
awaited in a coroutine, without introducing a dependency on coroutines yet.

Reviewed By: lnicco

Differential Revision: D47422753

fbshipit-source-id: 6aad62cd399a9e8112cab37f4979003d560caf8a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests