Comment 3 for bug 770334

Revision history for this message
Brandon Rhodes (brandon-rhodes) wrote :

The PyOS_ascii_strtod() call is often returning complete nonsense. After six hours of wrestling with this bug, I have removed the call to PyOS_ascii_strtod() and replaced it with an entirely self-contained routine for parsing floats, and the program STILL crashes on me and goes haywire. Unless I have made some terrible blunder between the working code branch that powers the Python 2 version and the branch that powers Python 3, there must be some difference between the Python versions that exposes or exercises some terrible and obscure bug in my code (or XEphem's). I am not sure what to try next, as I have no guess as to where the problem lies — with my malloc() and free()? With a stray pointer somewhere? With function lifetimes and pointers to variables on the stack?

In other news, I have started experimenting with writing a pure-Python implementation of the logic inside of libastro. If all goes well, I might be able to switch to shipping only Python. Then, people who need speed could use PyPy; while normal people would still get at least reasonable performance, but with an error like this one — an obscure, hours-long wade into machine code behavior — never possible again. :)

Meanwhile, let me know if you have any ideas. This one has me stumped! Running "python3.2 -m unittest ephem.tests.test_bodies" completely freezes on my machine and has to be killed.