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

Alpha Windows support #19

Closed
mitchellh opened this issue Jan 10, 2014 · 69 comments
Closed

Alpha Windows support #19

mitchellh opened this issue Jan 10, 2014 · 69 comments

Comments

@mitchellh
Copy link

mitchellh commented Jan 10, 2014

@wez edited this issue to place this status at the top

Current status: Alpha for 64-bit Windows.
It builds and passes the test suite on Windows Server 2012 R2 (x64) and should work on Windows 7 and later. PCRE expression terms are not currently supported.

At this time we're looking for alpha testers. Watchman on Windows may hang, crash or otherwise be unreliable. If you encounter problems we'll need you to provide detailed information about how to trigger the problem, and we may ask you to use visual studio to attach and perform some rudimentary debugging.

The latest build is available here:
https://ci.appveyor.com/api/projects/wez/watchman/artifacts/watchman.zip?branch=master&job=Environment:+WATCHMAN_WIN7_COMPAT%3D

Extract the zip file and make sure that watchman.exe is located in your PATH.
The watchman.pdb file is provided to facilitate debugging.

If you are consuming watchman from python, you will need to build pywatchman for yourself.
The released package on https://pypi.python.org/pypi/pywatchman should work for this purpose.

If you are consuming watchman from nodejs, the existing fb-watchman package available via npm should work, but the version in master has slightly better diagnostics in case you experience hangs.

@wez
Copy link
Contributor

wez commented Jan 10, 2014

Windows is not currently supported. We have no immediate plans to add support for it. We would welcome a contribution to add this support if someone has the time and inclination to produce it.

wez added a commit that referenced this issue Apr 20, 2014
@wez
Copy link
Contributor

wez commented Apr 20, 2014

To support Windows, we first need to tidy up our handling of case-insensitive filesystems; that work is in-progress, but we still have no immediate plans for Windows at this time.

@wez
Copy link
Contributor

wez commented Nov 2, 2014

We're tracking the list of things that would need to be tackled for Windows support in this wiki page:
https://github.com/facebook/watchman/wiki/Changes-required-for-Windows-support

@pclouds
Copy link

pclouds commented Nov 11, 2014

This is something you guys may want to watch out when using ReadDirectoryChangesW [1]

I dropped ReadDirectoryChangesW because maintaining a 'live' file system cache became more and more
complicated. For example, according to MSDN docs, ReadDirectoryChangesW may report short DOS 8.3
names (i.e. "PROGRA~1" instead of "Program Files"), so a correct and fast cache implementation would
have to be indexed by long and short names...

[1] http://article.gmane.org/gmane.comp.version-control.git/216195

@ziriax
Copy link

ziriax commented Jun 11, 2015

You might want to consider using the NTFS Change Journal. It is rock solid. I used it for Evolver, a closed source version control system that I developed for a game company in 2002.

It seems a Python wrapper is already made

@wez
Copy link
Contributor

wez commented Jul 27, 2015

cc: @dsp

I just pushed https://github.com/wez/watchman/tree/win with my hacking in progress; it's been sitting on my laptop for a while and I just rebased on master as of today and make sure that it still builds on both osx and windows.

You will need the microsoft visual C++ compiler to build it; you can use the community edition for this.
The compiler tools (cl, nmake and so on) must be in your path.
To run the integration tests you will need arcanist and php installed and in your path.

To build and test:

cd watchman
nmake -f winbuild\Makefile check
arc test

The integration tests are a bit rough and ready largely because of the filesystem semantics on windows are not POSIX; there are a lot of errors around attempting to delete dirs while handles are still open on them. There are also some errors with / instead of \ in path names. These are for the most part cosmetic.

The current status is 26 of 74 tests failed.

If you're interested in helping with hacking and testing, you are most welcome! We're at the cleaning things up stage.

If you're interested in making a client connect to it, you can connect to a named pipe for the current user; for example, my watchman instance listens at \\.\pipe\watchman-wez. The code to select the default name of the pipe can be found here: https://github.com/wez/watchman/blob/win/main.c#L456

Once connected, you use the standard JSON or BSER watchman protocol to communicate with the server.

@ziriax
Copy link

ziriax commented Jul 27, 2015

Great! I just tried to compile and run watchman.exe, but the code seems to use Windows 8 specific APIs, while we're still at Windows 7. For example, the API function GetOverlappedResultEx is used. Is this by design?

@wez
Copy link
Contributor

wez commented Jul 27, 2015

Windows 8 has a number of API calls that make it easier to port posix style applications and we're currently using those. In addition, I didn't have easy access to Windows 7 while I was prototyping this. I'm not opposed to making changes to have this run on Windows 7.

wez added a commit that referenced this issue Jul 29, 2015
Summary:
We've had a number of compatibility issues with the arcanist
based test suite, so this is an effort to run them using the
python unittest infrastructure.

This new structure allows us to create a single temporary dir
and to create a dir per test case to track the temporary files
and dirs created during the test.  This is beneficial both from
a post-mortem perspective if a test fails, but also because
the paths that show up in the watchman logs will now be easily
recognizable as being associated with a given test.

This will also help us manage the windows integration tests
(#19 (comment))
a bit more sanely; a source of errors in the php tests is that
deleting directory trees can fail if a handle still references
any part of it, and there is often a noticeable lag where we
can hit this state and error out.  By deferring the deletes
until our process end, we should minimize this issue.

I've ported a single integration test to demonstrate what this
looks like, the rest will have to be a series of diffs for
easier review.

Test Plan: `make integration` or `./runtests.py`

Reviewers: sid0

Differential Revision: https://reviews.facebook.net/D43137
@ziriax
Copy link

ziriax commented Jul 29, 2015

It seems the only Win8 specific API function call is the GetOverlappedResultEx. At first sight it seems you can just replace this with the old GetOverlappedResult function, since your timeout is either 0 or INFINITE, so the timeout maps to the BOOL bWait argument of the old function.

I was able to compile and run the watchman fine on my Win7 machine, and the log shows that watching indeed works.

I was not yet able to get the hgwatchman Mercurial extension running on Windows, but I suspect I have a conflict between 32-bit and 64-bit version. I'll dig deeper.

wez added a commit to wez/watchman that referenced this issue Jul 29, 2015
* On 64-bit systems we need to handle the long long type in the python
  bser implementation
* Address a race condition if a query comes in almost immediately after
  a watch is established
* Fix construction of relative root string on windows
* Add named pipe client transport support to pywatchman
* Tweak windows build to coexist on a shared drive with a unix build
* Update make.bat to do the right thing for me

The python based test suite now passes 100% most of the time (there's
a couple of intermittent issues)

Refs: facebook#19
@wez
Copy link
Contributor

wez commented Jul 29, 2015

@ziriax great! I just (force) pushed some fixes to my branch to pick up the python build and test bits. You'll also see how to establish the named pipe connection you'll need for hgwatchman--you have to use os.open because the higher level file abstraction in python doesn't work properly with named pipes

@wez
Copy link
Contributor

wez commented Jul 29, 2015

I remembered that I added make.bat in my branch as a short cut, so you can just run:

make

to have it run nmake with the right makefile for you. This script will also source the visual studio build environment. We're moving towards having the tests use python, so it is best if you have python in your path when you build; I'm using python 2.7.

wez added a commit to wez/watchman that referenced this issue Jul 29, 2015
Fixes up some windows path issues.  I believe that the only
test failures now are just path expectations in the php tests,
and because we don't currently have pcre support in the
windows build.

Ref: facebook#19
@wez
Copy link
Contributor

wez commented Jul 29, 2015

Current status is 18 of 73 failing, and a quick scan of the output looks like they're all / vs \ path related in the test expectations, or because we don't yet have pcre in the build and aren't smart enough to skip the pcre tests if support is missing.

I fixed a couple of race conditions and issues with relative roots and window filesystem convention handling.

I'll take a look at the GetOverlappedResult thing as well a bit later tonight.

wez added a commit to wez/watchman that referenced this issue Jul 30, 2015
Down to 7 failures all in trigger related tests

Ref: facebook#19
wez added a commit to wez/watchman that referenced this issue Jul 30, 2015
This probes for GetOverlappedResultEx at runtime; if it is found we'll
use it.  Otherwise, we fall back to looping and using SleepEx.

It is important to trigger the alertable wait state otherwise the
WriteFileEx completion won't get triggered.

It is also important to not use set the wait parameter to
GetOverlappedResult because it will block the watchman service and
break concurrent clients.

Refs: facebook#19
@wez
Copy link
Contributor

wez commented Jul 30, 2015

OK, the most recent run is down to just 6 failing tests.
I've also pushed a commit that tries to do the right thing on Windows 7; it's not as simple as just calling GetOverlappedResult as that will impact the ability of the service to handle concurrent clients (more details can be found in that commit)

@stefanpenner
Copy link

@wez if I recall some modes of windows FS watching (at-least the flags that are used in libuv) trigger change events on a file when attaching a hard link to it.

If possible, could watchman on windows not share this same behavior?

@stefanpenner
Copy link

If memory serves (it was quite some time ago), attaching a hard link mutates an attribute on the file: https://github.com/libuv/libuv/blob/188e0e94ac8374a5e177e1407052ed1b26c528a6/src/win/fs-event.c#L49

@stefanpenner
Copy link

It's also worth noting, my above statement might just be describing a symptom of an entirely different problem. So feel free to disregard as you feel appropriate.

@wez
Copy link
Contributor

wez commented Jul 30, 2015

[FYI: am currently traveling and may not be super responsive]

As of the most recent commit on wez/watchman:win, watchman is buildable on windows and basically functions (as in, I have only performed the most basic test as shown below) with hgwatchman.

To get hgwatchman to work, you'll need to copy the python/pywatchman dir from the windows watchman tree to hgwatchman/hgwatchman/pywatchman and then apply this patch to hgwatchman:

diff --git a/hgwatchman/__init__.py b/hgwatchman/__init__.py
--- a/hgwatchman/__init__.py
+++ b/hgwatchman/__init__.py
@@ -170,6 +170,8 @@
     if normalize:
         foldmap = dict((normcase(k), k) for k in results)

+    hg_slash = '.hg' + os.sep
+
     for entry in result['files']:
         fname = entry['name']
         if normalize:
@@ -183,7 +185,7 @@
         fmode = entry['mode']
         fexists = entry['exists']
         kind = getkind(fmode)
-        if fname == '.hg' or fname.startswith('.hg/'):
+        if fname == '.hg' or fname.startswith(hg_slash):
             continue

         if fname not in results:

Then run this in the root of the hgwatchman repo:

python setup.py build_py -c -d .  build_ext -i

Then:

hg --config extensions.hgwatchman=z:\fb\hgwatchman\hgwatchman --config watchman.mode=on st

@wez
Copy link
Contributor

wez commented Jul 30, 2015

@stefanpenner https://github.com/wez/watchman/blob/win/watcher/win32.c#L142 is what we're using for our win32 watcher.

We're really at the mercy of what windows reports here. The nature of these things is that neither the kernel nor watchman itself can reliably maintain enough state to guarantee that we can quash that kind of a notification without risking making the wrong choice and not notifying you of a similar but otherwise notify-able change.

Our philosophy on these situations in watchman is that we are conservative and err on the side of over notifying rather than missing a notification.

@stefanpenner
Copy link

Our philosophy on these situations in watchman is that we are conservative and err on the side of over notifying rather than missing a notification.

this sounds very reasonable :) If we run into issues, i will explore it in more details and report back. Thank you for the link.

@ziriax
Copy link

ziriax commented Jul 30, 2015

For a similar project I used the NTFS change journal. As far as I recall, this is very reliable. But since it logs all changes to a partition, we used to have a dedicated partition for our source files, and another one for the generated files.

@wez
Copy link
Contributor

wez commented Jul 30, 2015

Pull request for hgwatchman to support windows:
https://bitbucket.org/facebook/hgwatchman/pull-requests/3

@wez
Copy link
Contributor

wez commented Jul 30, 2015

@ziriax yeah, we've often talked about how it would be great if the filesystems themselves gave us an API for these kinds of operations; it would help to eliminate some of the TOCTOU issues that we have to deal with in the watchman service.

I haven't looked at the NTFS change journal API, but watchman does have a reasonably modular way to plug in an alternative watcher implementation (watcher/win32.c is currently the only windows implementation); it might be interesting to try building a change journal watcher to contrast/compare. It does sound a bit more painful to configure and deploy, so it probably would not be the default mode of operation. In addition, the ReadDirectoryChangeW API should work with more filesystems.

I don't think we're actively going to try the change journal ourselves, but I'm definitely open to reviewing and evaluating that contribution :-)

@ziriax
Copy link

ziriax commented Jul 30, 2015

Well, that's the nice thing about the NTFS change journal, since the file system writes entries in the journal, you do not need to "watch" anything. You just ask the file system about what changes happened between two "timestamps". No software has to run to constantly monitor the changes.

We found the directory notification system to be rather unreliable. But we used Windows XP in those days, so a lot could be improved by now.

-----Original Message-----
From: "Wez Furlong" notifications@github.com
Sent: ‎30/‎07/‎2015 19:22
To: "facebook/watchman" watchman@noreply.github.com
Cc: "Peter Verswyvelen" bugfact@gmail.com
Subject: Re: [watchman] Windows support? (#19)

@ziriax yeah, we've often talked about how it would be great if the filesystems themselves gave us an API for these kinds of operations; it would help to eliminate some of the TOCTOU issues that we have to deal with in the watchman service.
I haven't looked at the NTFS change journal API, but watchman does have a reasonably modular way to plug in an alternative watcher implementation (watcher/win32.c is currently the only windows implementation); it might be interesting to try building a change journal watcher to contrast/compare. It does sound a bit more painful to configure and deploy, so it probably would not be the default mode of operation. In addition, the ReadDirectoryChangeW API should work with more filesystems.
I don't think we're actively going to try the change journal ourselves, but I'm definitely open to reviewing and evaluating that contribution :-)

Reply to this email directly or view it on GitHub.

@upsuper
Copy link

upsuper commented Sep 23, 2016

Hmm, I thought the bitly link in the main description above was auto-updating to be current, I'm not sure if that is the case.

It doesn't seem to me that's the case.

The Last-Modified field of the last url shows Sat, 08 Aug 2015 19:22:02 GMT.

Instead, the link in your comment shows Tue, 23 Aug 2016 17:20:41 GMT for Last-Modified.

@igorsvee
Copy link

Can confirm that hot reloading works on Win 8.1 + genymotion + react-native 0.34.1 using https://ci.appveyor.com/api/buildjobs/kravw77nw7fqhvio/artifacts/watchman.zip. Thanks guys.

@waynebloss
Copy link

Are you guys officially supporting Windows now or not?

The first comment still reads "Windows is not currently supported" and this issue is still open, so I am assuming the answer is No?

Is this project even necessary for Windows, since Windows had a file-change notifications API way before the Mac OS or Linux had them?

Thanks.

@wez
Copy link
Contributor

wez commented Nov 10, 2016

@waynebloss at the moment the folks working on Watchman don't run it on Windows for any real purpose. We're anticipating that this will change in the future, which is why we've added support and have CI configured and so on. Until that changes and we've seen what really happens to the system outside of our integration test suite, we feel that it would be disingenuous to label it more than alpha or perhaps beta.

Watchman provides both a real-time file change subscription mechanism (echoing what the native OS facilities provide, but in a cross-platform way) and functionality to query the view of the filesystem without talking to the filesystem. The latter part of this may sound strange, but when you are dealing with a very large directory tree, the act of looking at a "cold" portion of it can block for a non-trivial amount of time.

Whether watchman is necessary depends on your needs.

@muloka
Copy link

muloka commented Dec 14, 2016

@wez out of curiosity, got any recommendations of alternative tools for Windows?

@kumarharsh
Copy link

@wez: I'm writing a plugin for vscode: graphql-for-vscode which relies on watchman. Users have been using it for about a month now, and till date there's not been a single issue. Pretty good work by your team 👍

@wez
Copy link
Contributor

wez commented Dec 15, 2016

@muloka do you mean alternatives to watchman, or just tools for windows?

@muloka
Copy link

muloka commented Dec 16, 2016

@wez Alternatives to watchman that are suitable for Windows

Anyway since writing my comment I've dabbled in both Powershell and syncthing

Using the two I've managed to arrive at a solution that works.

@lednhatkhanh
Copy link

Hi, where can I find the latest windows version?

@kumarharsh
Copy link

kumarharsh commented Jan 27, 2017

@lednhatkhanh The link is in the original post above: http://bit.ly/watchmanwinalpha

@wez
Copy link
Contributor

wez commented Jun 2, 2017

Figured out that we can use this link to always reference the latest build:

https://ci.appveyor.com/api/projects/wez/watchman/artifacts/watchman.zip?branch=master&job=Environment:+WATCHMAN_WIN7_COMPAT%3D

(updated the description to reflect this)

@wez wez added the windows label Jun 2, 2017
@masaeedu
Copy link

masaeedu commented Jun 6, 2017

@wez The clockspec on Windows looks a bit weird; it doesn't seem to match the two segment clockspec shown in the docs. Is there some special meaning for each

I get something with four segments when I run watchman since D:\depot\git\agentautodeditor\sampledata n:foo '':

{
    "version": "4.9.0",
    "is_fresh_instance": false,
    "clock": "c:1496775649:11508:1:63",
    "files": []
}

Additionally, this clockspec seems to increment every time I run that command, whereas from my understanding of the docs logical clock IDs should not increment unless files have actually changed in the directory. I've been using watchman clock D:\depot\git\agentautodeditor\sampledata instead, which seems to maintain a stable clock when I haven't changed anything.

Could you point me to some detailed docs on the anatomy of a clock id, and whether this is how things should be working?

@wez
Copy link
Contributor

wez commented Jun 6, 2017

@masaeedu would you mind opening a separate issue to ask those questions? This one is already pretty overloaded and long

@wez
Copy link
Contributor

wez commented Jun 8, 2017

OK folks, thanks for following along; I'm going to promote us from alpha to beta on Windows, so I'm closing this issue.

The install section of the docs has more information about downloading and installing the beta, as well as encouraging folks to file issues if/when they encounter them.

https://facebook.github.io/watchman/docs/install.html#download-for-windows-beta

@wez wez closed this as completed Jun 8, 2017
@chidionuekwusi
Copy link

The link is broken
watchman-problems

@AdrianoCahete
Copy link

The link is broken

This is working: https://ci.appveyor.com/api/buildjobs/41p1lupk97crwvm0/artifacts/watchman.zip

@wez
Copy link
Contributor

wez commented Mar 12, 2018

This link works correctly:

https://ci.appveyor.com/api/projects/wez/watchman/artifacts/watchman.zip?branch=master&job=Environment:+WATCHMAN_WIN7_COMPAT%3D&pr=false

The issue is that the default for pr is true so it's trying to download artifacts from the not-yet-ready cmake changes I'm hacking on in another pr :-/

facebook-github-bot pushed a commit that referenced this issue Oct 7, 2022
Summary:
We have seen deadlock running `terminationHandler` -> `hasSubscribers` in 2 threads.
It's unclear which other thread is holding the lock.

To make things easier to debug next time, let's change terminationHandler (and
also main.cpp) to bypass the logging lock and write to stderr directly.

Related threads (all threads in P536343453):

  Thread 11 (LWP 3275661):
  #0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
  #1  0x0000000001cc995b in folly::detail::(anonymous namespace)::nativeFutexWaitImpl (addr=<optimized out>, expected=<optimized out>, absSystemTime=<optimized out>, absSteadyTime=<optimized out>, waitMask=<optimized out>) at fbcode/folly/detail/Futex.cpp:126
  #2  folly::detail::futexWaitImpl (futex=0x89, futex@entry=0x7f1c3ac2ef90, expected=994748889, absSystemTime=absSystemTime@entry=0x0, absSteadyTime=<optimized out>, absSteadyTime@entry=0x0, waitMask=waitMask@entry=1) at fbcode/folly/detail/Futex.cpp:254
  #3  0x0000000001d34bce in folly::detail::futexWait<std::atomic<unsigned int> > (futex=0x7f1c3ac2ef90, expected=137, waitMask=1) at buck-out/v2/gen/fbcode/110b607930331a92/folly/detail/__futex__/headers/folly/detail/Futex-inl.h:96
  #4  folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever::doWait (this=<optimized out>, futex=..., expected=137, waitMask=1) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:718
  #5  folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::futexWaitForZeroBits<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever> (this=0x7f1c3ac2ef90, state=@0x7f1c149f88e4: 118379409, goal=128, waitMask=1, ctx=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:1184
  #6  0x0000000001cd42b2 in folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::yieldWaitForZeroBits<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever> (this=0x7f1c3ac2ef90, state=@0x7f1c149f88e4: 118379409, goal=128, waitMask=1, ctx=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:1151
  #7  folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::waitForZeroBits<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever> (this=0x7f1c3ac2ef90, state=@0x7f1c149f88e4: 118379409, goal=128, waitMask=1, ctx=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:1109
  #8  0x0000000001e7e14c in folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::lockSharedImpl<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever> (this=0x7f1c3ac2ef90, state=@0x7f1c149f88e4: 118379409, token=0x0, ctx=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:1664
  #9  folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::lockSharedImpl<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever> (this=0x7f1c3ac2ef90, token=0x0, ctx=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:1356
  #10 folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::lock_shared (this=0x7f1c3ac2ef90) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:495
  #11 std::shared_lock<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault> >::shared_lock (this=<optimized out>, __m=...) at fbcode/third-party-buck/platform010/build/libgcc/include/c++/trunk/shared_mutex:727
  #12 0x0000000002d765fd in folly::LockedPtr<folly::Synchronized<watchman::Publisher::state, folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault> > const, folly::detail::SynchronizedLockPolicy<(folly::detail::SynchronizedMutexLevel)2, (folly::detail::SynchronizedMutexMethod)0> >::doLock<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>, std::shared_lock<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault> >, folly::detail::SynchronizedLockPolicy<(folly::detail::SynchronizedMutexLevel)2, (folly::detail::SynchronizedMutexMethod)0>, 0> (mutex=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__synchronized__/headers/folly/Synchronized.h:1493
  #13 folly::LockedPtr<folly::Synchronized<watchman::Publisher::state, folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault> > const, folly::detail::SynchronizedLockPolicy<(folly::detail::SynchronizedMutexLevel)2, (folly::detail::SynchronizedMutexMethod)0> >::LockedPtr (this=0x7f1c149f8928, parent=<optimized out>) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__synchronized__/headers/folly/Synchronized.h:1272
  #14 folly::SynchronizedBase<folly::Synchronized<watchman::Publisher::state, folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault> >, (folly::detail::SynchronizedMutexLevel)2>::rlock (this=<optimized out>) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__synchronized__/headers/folly/Synchronized.h:229
  #15 watchman::Publisher::hasSubscribers (this=<optimized out>) at fbcode/watchman/PubSub.cpp:117
  #16 0x0000000002eca798 in watchman::Log::log<char const (&) [39], char const*, char const (&) [3]> (this=<optimized out>, level=level@entry=watchman::ABORT, args=..., args=..., args=...) at buck-out/v2/gen/fbcode/110b607930331a92/watchman/__logging__/headers/watchman/Logging.h:42
  #17 0x0000000002ec9ba7 in watchman::log<char const (&) [39], char const*, char const (&) [3]> (level=watchman::ABORT, args=..., args=..., args=...) at buck-out/v2/gen/fbcode/110b607930331a92/watchman/__logging__/headers/watchman/Logging.h:121
  #18 (anonymous namespace)::terminationHandler () at fbcode/watchman/SignalHandler.cpp:159
  #19 0x00007f1c3b0c7b3a in __cxxabiv1::__terminate (handler=<optimized out>) at ../../.././libstdc++-v3/libsupc++/eh_terminate.cc:48
  #20 0x00007f1c3b0c7ba5 in std::terminate () at ../../.././libstdc++-v3/libsupc++/eh_terminate.cc:58
  #21 0x0000000001c38c8b in __clang_call_terminate ()
  #22 0x0000000003284c9e in folly::detail::terminate_with_<std::runtime_error, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (args=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/lang/__exception__/headers/folly/lang/Exception.h:93
  #23 0x0000000003281bae in folly::terminate_with<std::runtime_error, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&> (args=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/lang/__exception__/headers/folly/lang/Exception.h:123
  #24 folly::SingletonVault::fireShutdownTimer (this=<optimized out>) at fbcode/folly/Singleton.cpp:499
  #25 0x0000000003281ad9 in folly::(anonymous namespace)::fireShutdownSignalHelper (sigval=...) at fbcode/folly/Singleton.cpp:454
  #26 0x00007f1c3b42b939 in timer_sigev_thread (arg=<optimized out>) at ../sysdeps/unix/sysv/linux/timer_routines.c:55
  #27 0x00007f1c3b41fc0f in start_thread (arg=<optimized out>) at pthread_create.c:434
  #28 0x00007f1c3b4b21dc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

  ...

  Thread 1 (LWP 3201992):
  #0  syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
  #1  0x0000000001cc995b in folly::detail::(anonymous namespace)::nativeFutexWaitImpl (addr=<optimized out>, expected=<optimized out>, absSystemTime=<optimized out>, absSteadyTime=<optimized out>, waitMask=<optimized out>) at fbcode/folly/detail/Futex.cpp:126
  #2  folly::detail::futexWaitImpl (futex=0x89, futex@entry=0x7f1c3ac2ef90, expected=994748889, absSystemTime=absSystemTime@entry=0x0, absSteadyTime=<optimized out>, absSteadyTime@entry=0x0, waitMask=waitMask@entry=1) at fbcode/folly/detail/Futex.cpp:254
  #3  0x0000000001d34bce in folly::detail::futexWait<std::atomic<unsigned int> > (futex=0x7f1c3ac2ef90, expected=137, waitMask=1) at buck-out/v2/gen/fbcode/110b607930331a92/folly/detail/__futex__/headers/folly/detail/Futex-inl.h:96
  #4  folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever::doWait (this=<optimized out>, futex=..., expected=137, waitMask=1) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:718
  #5  folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::futexWaitForZeroBits<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever> (this=0x7f1c3ac2ef90, state=@0x7ffd2d5be924: 118379408, goal=128, waitMask=1, ctx=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:1184
  #6  0x0000000001cd42b2 in folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::yieldWaitForZeroBits<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever> (this=0x7f1c3ac2ef90, state=@0x7ffd2d5be924: 118379408, goal=128, waitMask=1, ctx=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:1151
  #7  folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::waitForZeroBits<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever> (this=0x7f1c3ac2ef90, state=@0x7ffd2d5be924: 118379408, goal=128, waitMask=1, ctx=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:1109
  #8  0x0000000001e7e14c in folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::lockSharedImpl<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever> (this=0x7f1c3ac2ef90, state=@0x7ffd2d5be924: 118379408, token=0x0, ctx=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:1664
  #9  folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::lockSharedImpl<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::WaitForever> (this=0x7f1c3ac2ef90, token=0x0, ctx=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:1356
  #10 folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>::lock_shared (this=0x7f1c3ac2ef90) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__shared_mutex__/headers/folly/SharedMutex.h:495
  #11 std::shared_lock<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault> >::shared_lock (this=<optimized out>, __m=...) at fbcode/third-party-buck/platform010/build/libgcc/include/c++/trunk/shared_mutex:727
  #12 0x0000000002d765fd in folly::LockedPtr<folly::Synchronized<watchman::Publisher::state, folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault> > const, folly::detail::SynchronizedLockPolicy<(folly::detail::SynchronizedMutexLevel)2, (folly::detail::SynchronizedMutexMethod)0> >::doLock<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault>, std::shared_lock<folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault> >, folly::detail::SynchronizedLockPolicy<(folly::detail::SynchronizedMutexLevel)2, (folly::detail::SynchronizedMutexMethod)0>, 0> (mutex=...) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__synchronized__/headers/folly/Synchronized.h:1493
  #13 folly::LockedPtr<folly::Synchronized<watchman::Publisher::state, folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault> > const, folly::detail::SynchronizedLockPolicy<(folly::detail::SynchronizedMutexLevel)2, (folly::detail::SynchronizedMutexMethod)0> >::LockedPtr (this=0x7ffd2d5be968, parent=<optimized out>) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__synchronized__/headers/folly/Synchronized.h:1272
  #14 folly::SynchronizedBase<folly::Synchronized<watchman::Publisher::state, folly::SharedMutexImpl<false, void, std::atomic, folly::SharedMutexPolicyDefault> >, (folly::detail::SynchronizedMutexLevel)2>::rlock (this=<optimized out>) at buck-out/v2/gen/fbcode/110b607930331a92/folly/__synchronized__/headers/folly/Synchronized.h:229
  #15 watchman::Publisher::hasSubscribers (this=<optimized out>) at fbcode/watchman/PubSub.cpp:117
  #16 0x0000000002ecac20 in watchman::Log::log<char const (&) [59]> (this=<optimized out>, level=level@entry=watchman::ABORT, args=...) at buck-out/v2/gen/fbcode/110b607930331a92/watchman/__logging__/headers/watchman/Logging.h:42
  #17 0x0000000002ec9b24 in watchman::log<char const (&) [59]> (level=watchman::ABORT, args=...) at buck-out/v2/gen/fbcode/110b607930331a92/watchman/__logging__/headers/watchman/Logging.h:121
  #18 (anonymous namespace)::terminationHandler () at fbcode/watchman/SignalHandler.cpp:165
  #19 0x00007f1c3b0c7b3a in __cxxabiv1::__terminate (handler=<optimized out>) at ../../.././libstdc++-v3/libsupc++/eh_terminate.cc:48
  #20 0x00007f1c3b0c7ba5 in std::terminate () at ../../.././libstdc++-v3/libsupc++/eh_terminate.cc:58
  #21 0x0000000002d8cde1 in std::thread::~thread (this=0x7f1c3ac2ef90) at fbcode/third-party-buck/platform010/build/libgcc/include/c++/trunk/bits/std_thread.h:152
  #22 0x00007f1c3b3cc8f8 in __run_exit_handlers (status=1, listp=0x7f1c3b598658 <__exit_funcs>, run_list_atexit=<optimized out>, run_dtors=<optimized out>) at exit.c:113
  #23 0x00007f1c3b3cca0a in __GI_exit (status=<optimized out>) at exit.c:143
  #24 0x00007f1c3b3b165e in __libc_start_call_main (main=0x2d11220 <main(int, char**)>, argc=2, argv=0x7ffd2d5bec78) at ../sysdeps/nptl/libc_start_call_main.h:74
  #25 0x00007f1c3b3b1718 in __libc_start_main_impl (main=0x2d11220 <main(int, char**)>, argc=2, argv=0x7ffd2d5bec78, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd2d5bec68) at ../csu/libc-start.c:409
  #26 0x0000000002d0e181 in _start () at ../sysdeps/x86_64/start.S:116

Reviewed By: xavierd

Differential Revision: D40166374

fbshipit-source-id: 7017e20234e5e0a9532eb61a63ac49ac0020d443
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