This repository was archived by the owner on Feb 1, 2023. It is now read-only.
Commit c7c058b
Release Manager
Trac #31395: RuntimeError: can't start new thread (due to memlimit)
My home machine can't run `sage -t` in 9.3.beta7:
{{{
$ echo "" > foo.py
$ sage -t foo.py
too many failed tests, not using stored timings
Running doctests with ID 2021-02-14-07-59-58-a18c55bc.
Git branch: u/mjo/ticket/31382
Using --optional=build,dochtml,gentoo,memlimit,pip,sage,sage_spkg
Doctesting 1 file.
Process DocTestWorker-1:
sage -t --random-seed=0 foo.py
Traceback (most recent call last):
File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in
_bootstrap
self.run()
File "/home/mjo/src/sage.git/local/lib/python3.9/site-
packages/sage/doctest/forker.py", line 2179, in run
task(self.options, self.outtmpfile, msgpipe, self.result_queue)
File "/home/mjo/src/sage.git/local/lib/python3.9/site-
packages/sage/doctest/forker.py", line 2529, in __call__
result_queue.put(result, False)
File "/usr/lib/python3.9/multiprocessing/queues.py", line 94, in put
self._start_thread()
File "/usr/lib/python3.9/multiprocessing/queues.py", line 179, in
_start_thread
self._thread.start()
File "/usr/lib/python3.9/threading.py", line 874, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
Bad exit: 1
**********************************************************************
Tests run before process (pid=13654) failed:
**********************************************************************
----------------------------------------------------------------------
sage -t --random-seed=0 foo.py # Bad exit: 1
----------------------------------------------------------------------
Total time for all tests: 0.1 seconds
cpu time: 0.0 seconds
cumulative wall time: 0.0 seconds
}}}
Running strace on that command shows a bunch of ENOMEM:
{{{
[pid 13910] mmap(NULL, 262144, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 ENOMEM (Cannot allocate memory)
}}}
So I tried `--memlimit=0`, and that seems to work:
{{{
$ sage -t -m 0 foo.py
too many failed tests, not using stored timings
Running doctests with ID 2021-02-14-08-08-27-1edc5213.
Git branch: u/mjo/ticket/31382
Using --optional=build,dochtml,gentoo,pip,sage,sage_spkg
Doctesting 1 file.
sage -t --random-seed=0 foo.py
[0 tests, 0.00 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 0.0 seconds
cpu time: 0.0 seconds
cumulative wall time: 0.0 seconds
}}}
I think the default memlimit of 3300 MiB is arbitrary anyway, so maybe
it just needs to be raised a little? A slight increase to
`--memlimit=3400` solves the problem on that machine.
URL: https://trac.sagemath.org/31395
Reported by: mjo
Ticket author(s): Michael Orlitzky
Reviewer(s): Dima PasechnikFile tree
6 files changed
+21
-70
lines changed- src
- bin
- sage
- doctest
- tests
- matrix
6 files changed
+21
-70
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | 46 | | |
52 | 47 | | |
53 | 48 | | |
| |||
135 | 130 | | |
136 | 131 | | |
137 | 132 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | 133 | | |
172 | 134 | | |
173 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | 99 | | |
101 | 100 | | |
102 | 101 | | |
| |||
381 | 380 | | |
382 | 381 | | |
383 | 382 | | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | 383 | | |
389 | 384 | | |
390 | 385 | | |
| |||
1013 | 1008 | | |
1014 | 1009 | | |
1015 | 1010 | | |
1016 | | - | |
| 1011 | + | |
1017 | 1012 | | |
1018 | 1013 | | |
1019 | 1014 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
491 | | - | |
492 | | - | |
493 | | - | |
494 | | - | |
495 | 491 | | |
496 | 492 | | |
497 | 493 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | 516 | | |
531 | 517 | | |
532 | 518 | | |
| |||
560 | 546 | | |
561 | 547 | | |
562 | 548 | | |
563 | | - | |
564 | 549 | | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | 171 | | |
176 | 172 | | |
177 | 173 | | |
| |||
180 | 176 | | |
181 | 177 | | |
182 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
183 | 199 | | |
184 | 200 | | |
185 | 201 | | |
| |||
0 commit comments