[darcs-users] "darcs get" crashes (usually)

Martin Schaffner maschaffner at gmx.ch
Fri Jul 23 16:45:17 UTC 2004


David Roundy wrote:
> > > > I have a darcs repo which I can't "get", neither on Windows nor on 
 
> > > > Mac OS X. On the mac, darcs usually does a "Bus error",
> > > > sometimes a Seg fault, and rarely it succeeds. It is in 
> > > > relation to garbage collection
> > > I will also try on Mac OS X without mmap support.
> > 
> > I compiled darcs without mmap support, and got exactly the same result 
> > as with mmap support.
> 
> Hmmmm.  This is very strange.  Without the mmap support, this means 
> there is a bug in the compiler.  In theory, the bug could be in the
> FastPackedString module, but that module is quite simple an very well
> tested.

I tested with the number 1'000'000 in FastPackedString.hs decreased to 
100'000, and the behaviour was the same as with the unmodified version. 
But when I increased it to 10'000'000, the crash didn't occur anymore, 
although an inserted putStr revealed that performGC was still called many 
times.

Would it be a big thing to write a dummy FastPackedString that wraps a 
simple String? If the current FastPackedString triggers the crash, then we 
wouldn't see the crash when the dummy FastPackedString is used, and we 
would be certain that it's in FastPackedString (and not in the compiler).

Would it be easy to log all calls to FastPackedString? This way I 
might be able to create a testcase to trigger the crash.

> If the bug is really in darcs, it would have to be in one of the
> ForeignPtrs (which I think are only created in FastPackedString).  
> There's a routine to add an extra finalizer to a ForeignPtr which you 
> could use to add a putStr whenever one is deleted.

How exactly? Sorry, I've never done anything in Haskell before.
Anyway, this looks to me like darcs tries to access memory that was freed 
too early. So does only knowing when something was freed help much?

> Is there any chance I either get a login on your Mac system

Sorry, I can't give you access. I can't give you my repo, either :-(

> I've only got one device on my mac,
> which could explain why I haven't seen this.

You can also create and mount a disk image from "disk tools" in 
"utilities". This triggers the crash as well (for my repo).

> Does the problem only show up for one particular repository? I got that
> impression... Perhaps there's something odd about that repo, although it

Yes, up to now it only occured in one repo. The crash appeared at the 
same time on both mac and windows.

The crash is really not "reliable":

/tmp me$ for i in /Applications/*; do darcs get /Volumes/bla/thing/repo; 
rm -rf repo; done
Copying patches...
............................................................
Finished getting.
Copying patches...
............................................................Bus error
Copying patches...
............................................................
Finished getting.
Copying patches...
..........................................................Bus error
Copying patches...
..........................................................Bus error
Copying patches...
............................................................
Finished getting.
Copying patches...
..........................................................Bus error
Copying patches...
............................................................
Finished getting.
Copying patches...
..........................................................Bus error
Copying patches...
.........................................................Bus error
Copying patches...
..........................................................Bus error
Copying patches...
..........................................................Bus error
Copying patches...
............................................................
Finished getting.
Copying patches...
...........................................................Bus error
Copying patches...
............................................................
Finished getting.

--
Martin Schaffner

-- 
+++ GMX DSL-Tarife 3 Monate gratis* +++ Nur bis 25.7.2004 +++
Bis 24.000 MB oder 300 Freistunden inkl. http://www.gmx.net/de/go/dsl





More information about the darcs-users mailing list