Comment 14 for bug 1063350

Revision history for this message
Nathan Stratton Treadway (nathanst) wrote : Re: add-apt-repository/apt-add-repository fails with "ValueError: cannot convert float NaN to integer"

I found a Redhat bug that seems to be related:
  https://bugzilla.redha t.com/show_bug.cgi?id=758446
(It's for a different Python program, but pycurl is used there, too, and in it NaNs are similarly showing up in unexpected places.)

In comment #9, Zdeněk Pavlas suggests the problem might related to improper cleanup after the use of MMX instructions, as explained in:
http://en.wikipedia.org/wiki/SSE2#Differences_between_MMX_and_SSE2

"Once MMX has been used, the programmer must use the emms instruction (C: _mm_empty()) to restore operation to the x87 register file. [...] the corrupt floating-point state caused by failure to emit emms may go undetected for millions of instructions before ultimately causing the floating-point routine to fail, returning NaN."

I'm not sure how to verify that issue is actually what's triggering this specific problem, but the Wikipedia page goes on to mention that this cleanup is not required when SSE2 instructions are used instead of MMX, and I can confirm that the two machines I have found that exhibit this problem do have "mmx" but not "sse2" in the flags line of /proc/cpuinfo.

However, I have some other machine with that same combo of flags which don't show the bug, so it seems that the libXXX versions involved do matter. In my case, at least, the systems that do show the the bug are running Precise, and the ones that don't are running Lucid and Debian Etch.

If this "missing emms instruction" is in fact the problem, I'm also not sure exactly which library needs to be fixed (though the fact that it's https that triggers the problem might point towards libgnutls26...).