Bug introduced in 10.0 and fixed in 11.1
Run these two samples of code here (AFTER SAVING YOUR CURRENT WORK):
Do[
TimeConstrained[
While[True,
Delete[{1}, 1];
];,
0.1];,
{100}]
Do[
TimeConstrained[
While[True,
Delete[Range[1], 1];
];,
0.1];,
{100}]
When I run the second one, the kernel crashes. WTH?
Some details.
- This works for a
Range
of any size. - It doesn't happen every time
TimeConstrained
is run, which is why I put it in aTable
to guarantee a crash. - It happens no matter what the timeout is, I just chose 0.1 to make the crash happen sooner.
- This is actually significant, it means whatever the problem is happens when
TimeConstrained
times out.
- This is actually significant, it means whatever the problem is happens when
- It also won't happen if you replace
Delete
withDrop[Range[1], {1}]
.
I encounter this problem while writing a benchmark that compares, among other things, Drop
to Delete
. I'd like to avoid just dropping Delete
from all of my test cases.
Tested Versions
Crashes on:
- 10.0.0, Windows 8.1 64-bit
- 10.0.1, Windows 8.1 64-bit
- 10.0.2, Mac OS X 10.10.2
- 10.1.0, Max OS X 10.10.2
- 10.3.1, Linux (Raspian)
- 10.4.1, Windows 7 x64, Windows 10
- 11.0.0, Windows 10
- 11.0.1, Windows 7 x64
Not on:
- 8.0.4, Windows 7 x64
- 9.0.0.0, Linux x86-64
- 10.0.2, Linux
- 11.1.0, Windows 10 64-bit
Updates
April 2015: I contacted Wolfram, they say they are aware of the bug.
April 2017: Wolfram emailed me letting me know that "We believe that the issue has been resolved in the current 11.1 release of Mathematica."
Compile
to work had borked my system! $\endgroup$