After fixing a few things - see the tip at commit 6cecc26206c4a539999b04664136c6f785211a41 disables the watch command on OSX, Missing dependancy in commit 6cecc26206c4a539999b04664136c6f785211a41 and bsd?) I tried the watch command on my ~180gig annex of stuff. This might be yet again related to the issue of Issue on OSX with some system limits

the watch command segfaults

x00:annex jtang$ git annex watch --foreground -d
watch . [2012-07-26 12:27:16 IST] read: git ["--git-dir=/Users/jtang/annex/.git","--work-tree=/Users/jtang/annex","show-ref","git-annex"] 
[2012-07-26 12:27:16 IST] read: git ["--git-dir=/Users/jtang/annex/.git","--work-tree=/Users/jtang/annex","show-ref","--hash","refs/heads/git-annex"] 
[2012-07-26 12:27:16 IST] read: git ["--git-dir=/Users/jtang/annex/.git","--work-tree=/Users/jtang/annex","log","refs/heads/git-annex..38d3f769ef004b96b6d640cfb59a45f7b4edf5f6","--oneline","-n1"] 
[2012-07-26 12:27:16 IST] read: git ["--git-dir=/Users/jtang/annex/.git","--work-tree=/Users/jtang/annex","log","refs/heads/git-annex..ebabe9c92516c350a30126037173080648f5930b","--oneline","-n1"] 
[2012-07-26 12:27:16 IST] read: git ["--git-dir=/Users/jtang/annex/.git","--work-tree=/Users/jtang/annex","log","refs/heads/git-annex..d36d8d88847decc2320f0be22892ad94a8abe594","--oneline","-n1"] 
[2012-07-26 12:27:16 IST] read: git ["--git-dir=/Users/jtang/annex/.git","--work-tree=/Users/jtang/annex","log","refs/heads/git-annex..aaa62a8191b3c964fdf546077049f626e8561b22","--oneline","-n1"] 
[2012-07-26 12:27:16 IST] chat: git ["--git-dir=/Users/jtang/annex/.git","--work-tree=/Users/jtang/annex","cat-file","--batch"] 
(scanning...) error: git-annex died of signal 11

The above was done on the usual OSX 10.7 system that I have.


I'll try and bisect it and find out where the problem first appeared, does the tests currently test the watch command? (also my comments seem to get moderated whether i use my openid account with google or with the native ikiwiki account, so some comments might be hidden)

The test suite does not currently test the watch command, unfortunatly.

Wow, I had not noticed the 30 pending moderated comments.. Let them all thru, and I guess I'll turn off comment spam filtering for now, since there has apparently been none. --Joey


Seems this segfault is fixed. done --Joey

Do you see the segfault in a repo with fewer files?
Comment by http://joeyh.name/ Thu Jul 26 17:09:16 2012
Also, you might try bisecting to find whatever commit it first started segfaulting on.
Comment by http://joeyh.name/ Thu Jul 26 17:09:59 2012
It fails on repos with either no files or smaller repos.
Comment by jtang Thu Jul 26 17:11:55 2012
It just occurred to me that bisecting won't help much, as the watch command was disabled accidentally in earlier commits and doing a script for bisecting is going to be as much work as just stepping through and debugging the issue with a debugger (i might need to fire up gdb on a mac (this wont be fun))
Comment by jtang Thu Jul 26 17:50:42 2012
After some debugging, I looked at the Utility/libkqueue.c and used it as a test, it seems to be hanging/segfaulting around the call to that library. Annoyingly I get segfaults from the library every so often on OSX, it's pretty a random event.

Are you seeing libkqueue crash when it's called from a debugger or C program, rather than from Haskell?

Are you building for 32 or 64 bit? You might try getting the 32 bit version of GCC (or The Haskell Platform) and see if it does better. There is a known GCC crashes on 64 bit OSX involving C libraries, although this bug report doesn't seem to apply, since we're not using ghci http://hackage.haskell.org/trac/ghc/ticket/7040.

Are you building with cabal, or using the Makefile?

You might try reverting git commit da4c506d61115236f3e43dd0bd17f30cd54df950

You might try disabling the -threaded option in the cabal file or Makefile.

I ssh'd to the OSX box I have an account on, and confirmed that git-annex watch still works there as of the current head of the assistant branch. That's a 64 bit GHC system, FWIW.

Do you see the crash when building from the master branch, or only assistant? Master has the watch command, but it's much out of date, so this will tell if the problem was introduced recently... and you might still have to bisect it since I can't reproduce it. :(

Comment by http://joeyh.name/ Fri Jul 27 16:34:45 2012

I'm using make and a 64bit version of haskell-platform, it's fine on the master branch. It's just crashing on the assistant branch, I'm just thinking out loud, but could I share the binaries that I have with you (I'd like to grab your binaries too) to see see if its just some silly problem with my build environment.

I'm seeing the crash when I'm running git-annex (in haskell), when I run libkqueue in a debugger it behaves randomly, is mostly succeeds, but every so often it fails. A back trace reveals nothing so I am a bit at a loss.

I've tried disabling the threaded option, but it still crashes, I will give it another try later when I get home. The problem seems to occur on my desktop mac in work and my home mac, however it is fine on my linux machines.

Could I ask which version of OSX do you have access to? is it 10.6 or 10.7 ?

I've reproduced a crash on OSX, involving not kqueue, but the WebApp's use of getaddrinfo. I've fixed that, but several things you've said in this bug report don't 100% add up to this being the same crash you've been seeing (for one thing, this can't affect git annex watch), so I'll wait for you to confirm.
Comment by http://joeyh.name/ Fri Jul 27 18:10:06 2012

Ah, it's alive, I'm testing on my home machine right now and it's functioning as expected. I've tested on my work machine as well and the watch command works as expected! (short of the existing system limits which fails for my bigger annexes).

Apologies for sending you on the wrong path with the kqueue path. I reckon if I give this a good testing over the weekend is a good idea before closing this bug, I will report back in a few days on this after giving a thrashing of files!

Comment by jtang Fri Jul 27 18:17:45 2012
This is looking good, no more segfaulting.
Comment by jtang Sun Jul 29 10:49:05 2012
Comments on this page are closed.