trying to make tracebacks reproducible

Christian Ebert blacktrash at gmx.net
Thu Jul 1 19:08:16 CDT 2010


* Greg Ward on Thursday, July 01, 2010 at 17:31:22 -0400
> On Thu, Jul 1, 2010 at 2:21 PM, Christian Ebert <blacktrash at gmx.net> wrote:
>> Since a few days -- sorry for being vague, but this is actually
>> part of the problem, I _sometimes_ get tracebacks with
>> crew-stable (basically 1.6 I'd say). I cannot reproduce them
>> "reliably", i.e. in the following example, I reissued the command
>> and got the diff as expected. I can reduce the loaded extensions
>> etc. but I'd like to reproduce this reliably first. It seems to
>> happen at random - well, in the true sense of the word, if you
>> look at the final lines of the traceback.
> [...]
>> $ hg diff -r default
>> ** unknown exception encountered, details follow
>> ** report bug details to http://mercurial.selenic.com/bts/
>> ** or mercurial at selenic.com
>> ** Python 2.6.5 (r265:79063, May 13 2010, 09:27:41) [GCC 4.0.1 (Apple Inc. build 5493)]
>> ** Mercurial Distributed SCM (version 1.5.4+190-521c8e0c93bf)
>> ** Extensions loaded: keyword, mq, convert, patchbomb, graphlog, record, extdiff, color, pager, crecord
>> Traceback (most recent call last):
>>  File "/usr/local/bin/hg", line 27, in <module>
>>    mercurial.dispatch.run()
> [...]

>>  File "/sw/lib/python2.6/tempfile.py", line 34, in <module>
>>    from random import Random as _Random
>>  File "/usr/local/lib/python2.6/site-packages/mercurial/demandimport.py", line 106, in _demandimport
>>    mod = _origimport(name, globals, locals)
>>  File "/sw/lib/python2.6/random.py", line 59, in <module>
>>    LOG4 = _log(4.0)
>> ValueError: math domain error
> 
> That is absolutely totally bizarre.  This is completely deterministic
> code; it's just random.py's setup.  It saves log(4.0) in a constant,
> presumably as a performance tweak.
> 
> I'm looking in the source for the 'math' module (Modules/mathmodule.c)
> from Python trunk (2.7-ish).  There are only two reasons why it can
> raise "ValueError: math domain error":
> 
>  1) errno is set to EDOM by some call into the standard C library
> (libm, I presume) -- eg. caller passes negative number to libm's log()
>  2) caller passes x < 0 to log()
> 
> Clearly random.py is not passing a negative number to math.log().
> This smells like either a deep and bizarre Python bug, a deep and
> bizarre bug in libm, or cosmic rays.  I am inclined to blame cosmic
> rays (or bad memory).  Try rebooting and see if the problem goes away.
> Also try checking your RAM.

I was doing extremely cpu intensive video conversions. So I took
your advice and rebooted, and, for the moment at least, the
problem is gone (I tested with Martin's evil script).

Hm, I somehow prefer the cosmic rays hypothesis ...

"Good afternoon, gentlemen. I am a HAL 9000 computer."
-- 
theatre - books - texts - movies
Black Trash Productions at home: http://www.blacktrash.org/
Black Trash Productions on Facebook:
http://www.facebook.com/blacktrashproductions


More information about the Mercurial-devel mailing list