-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer" #76300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
test_notify_all() of test_multiprocessing_forkserver failed on Python on x86 Tiger 3.6 with "ValueError: cannot convert float NaN to integer": http://buildbot.python.org/all/#/builders/46/builds/60 0:52:21 load avg: 1.46 [378/406/1] test_multiprocessing_forkserver crashed (Exit code 1) Traceback (most recent call last):
File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/forkserver.py", line 196, in main
_serve_one(s, listener, alive_r, old_handlers)
File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/forkserver.py", line 231, in _serve_one
code = spawn._main(child_r)
File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/spawn.py", line 114, in _main
prepare(preparation_data)
File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/spawn.py", line 223, in prepare
_fixup_main_from_name(data['init_main_from_name'])
File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/multiprocessing/spawn.py", line 249, in _fixup_main_from_name
alter_sys=True)
File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/runpy.py", line 201, in run_module
mod_name, mod_spec, code = _get_module_details(mod_name)
File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/runpy.py", line 153, in _get_module_details
code = loader.get_code(mod_name)
File "<frozen importlib._bootstrap_external>", line 762, in get_code
ValueError: cannot convert float NaN to integer Timeout (0:25:00)! Moreover, when test_multiprocessing_forkserver was run a second time, a different test failed, test_forkserver_sigkill(): Re-running test 'test_multiprocessing_forkserver' in verbose mode Traceback (most recent call last):
File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 496, in test_forkserver_sigkill
self.check_forkserver_death(signal.SIGKILL)
File "/Users/db3l/buildarea/3.6.bolen-tiger/build/Lib/test/_test_multiprocessing.py", line 486, in check_forkserver_death
self.assertTrue(evt.is_set())
AssertionError: False is not true |
"ValueError: cannot convert float NaN to integer": this error occurred on int(float), where the float comes from os.stat() File "<frozen importlib._bootstrap_external>", line 762, in get_code Lib/importlib/_bootstrap_external.py: def get_code(self, fullname):
...
st = self.path_stats(source_path)
...
source_mtime = int(st['mtime']) <~~~~~~ HERE
...
def path_stats(self, path):
st = _path_stat(path)
return {'mtime': st.st_mtime, 'size': st.st_size}
def _path_stat(path):
return _os.stat(path) => The float NaN comes from os.stat().st_mtime. Implementation of os.stat().st_mtime in Modules/posixmodule.c: static PyObject*
_pystat_fromstructstat(STRUCT_STAT *st)
{
...
#if defined(HAVE_STAT_TV_NSEC)
ansec = st->st_atim.tv_nsec;
mnsec = st->st_mtim.tv_nsec;
cnsec = st->st_ctim.tv_nsec;
#elif defined(HAVE_STAT_TV_NSEC2)
ansec = st->st_atimespec.tv_nsec;
mnsec = st->st_mtimespec.tv_nsec;
cnsec = st->st_ctimespec.tv_nsec;
#elif defined(HAVE_STAT_NSEC)
ansec = st->st_atime_nsec;
mnsec = st->st_mtime_nsec;
cnsec = st->st_ctime_nsec;
#else
ansec = mnsec = cnsec = 0;
#endif
fill_time(v, 7, st->st_atime, ansec);
fill_time(v, 8, st->st_mtime, mnsec);
fill_time(v, 9, st->st_ctime, cnsec);
...
}
static void
fill_time(PyObject *v, int index, time_t sec, unsigned long nsec)
{
...
float_s = PyFloat_FromDouble(sec + 1e-9*nsec); <~~~~~~ HERE
...
PyStructSequence_SET_ITEM(v, index+3, float_s);
...
} Extract of the ./configure script output: checking for tv_nsec in struct stat... no => configure defines HAVE_STAT_TV_NSEC2 We need sec and nsec values from fill_time() to debug this issue. |
It may also be compiler issue.
Extract of pythoninfo: os.uname: posix.uname_result(sysname='Darwin', nodename='osx', release='8.11.1', version='Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386', machine='i386') |
This issue is very similar, likely the same bug, than bpo-13986. |
Similar error: bpo-14028, "Using a 32-bit Python 2.6.5 on a Linux system", reported at 2012-02-16. |
Interesting info about NaN on Intel x86: https://stackoverflow.com/questions/14021763/c-multiplication-or-addition-floats-results-nan "The multiplication is being performed in the x87 registers, and a floating-point stack overflow has occurred due to (possibly unrelated) earlier operations in your program's execution. When the processor is in this failure state, all computations performed on the x87 registers produce NaN results." -- For FreeBSD, Python main() starts with: /* 754 requires that FP exceptions run in "no stop" mode by default,
* and until C vendors implement C99's ways to control FP exceptions,
* Python requires non-stop mode. Alas, some platforms enable FP
* exceptions by default. Here we disable them.
*/
#ifdef __FreeBSD__
fedisableexcept(FE_OVERFLOW);
#endif |
I really have no clue on the root bug, and the bug only occurred once, so I choose to close it. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: