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

should FOLLY_HAVE_PTHREAD_ATFORK should be defined for linux by default? #124

Closed
emaxerrno opened this issue Feb 3, 2015 · 4 comments
Closed

Comments

@emaxerrno
Copy link

Folly version 23 (i just download this today)

/usr/local/include/folly/detail/ThreadLocalDetail.h:221:6: error: pthread_atfork unavailable [-Werror,-W#warnings]

  StaticMeta() : nextId_(1) {
    head_.next = head_.prev = &head_;
    int ret = pthread_key_create(&pthreadKey_, &onThreadExit);
    checkPosixError(ret, "pthread_key_create failed");

#if FOLLY_HAVE_PTHREAD_ATFORK
    ret = pthread_atfork(/*prepare*/ &StaticMeta::preFork,
                         /*parent*/ &StaticMeta::onForkParent,
                         /*child*/ &StaticMeta::onForkChild);
    checkPosixError(ret, "pthread_atfork failed");
#elif !__ANDROID__
    // pthread_atfork is not part of the Android NDK at least as of n9d. If
    // something is trying to call native fork() directly at all with Android's
    // process management model, this is probably the least of the problems.
    //
    // But otherwise, this is a problem.
    #warning pthread_atfork unavailable
#endif
  }

Here is the man pages for the default linux pthread installation.

https://gist.github.com/senior7515/88c40a7c007595603531

maybe i'm missing something?

@djwatson
Copy link

djwatson commented Feb 3, 2015

Yea, something seems wrong with the configure script that tries to detect this

@marcinpe
Copy link
Contributor

marcinpe commented Feb 3, 2015

i can confirm it. Happens also on latest arch linux (as a result make check fails on ThreadLocalTest). Seems that the presence of pthread_at_fork is tested without linking in pthread.

@0mok
Copy link
Contributor

0mok commented Feb 5, 2015

I already fixed configure script for this issue.
Please check my pull request.
#125

@marcinpe
Copy link
Contributor

marcinpe commented Feb 9, 2015

pull request #125 has been merged. I verified it work with latest Arch Linux (it used to fail before).

@marcinpe marcinpe closed this as completed Feb 9, 2015
facebook-github-bot pushed a commit that referenced this issue Jan 27, 2023
Summary:
X-link: facebook/fboss#124

X-link: facebookincubator/reindeer#6

X-link: facebook/sapling#497

X-link: facebook/mvfst#284

X-link: facebook/wangle#212

X-link: facebookincubator/velox#3785

X-link: facebookexperimental/rust-shed#37

X-link: facebook/hhvm#9317

X-link: facebookexperimental/edencommon#6

X-link: facebookincubator/hsthrift#108

X-link: facebook/proxygen#436

X-link: facebookincubator/katran#183

X-link: facebook/openr#143

X-link: facebook/fbthrift#536

X-link: facebook/fb303#33

Pull Request resolved: #1924

FBOSS OSS on-diff job is failing due to random test failures.

Disabling the tests for now to avoid build breakages.

Reviewed By: shri-khare

Differential Revision: D42550176

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

No branches or pull requests

4 participants