10
$\begingroup$

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 a Table 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.
  • It also won't happen if you replace Delete with Drop[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."

$\endgroup$
10
  • 1
    $\begingroup$ Can confirm crash on Windows 8.1 Mathematica V10.0.2.0. $\endgroup$ Commented Mar 21, 2015 at 23:06
  • $\begingroup$ @DumpsterDoofus That's good to know, I was worried that all the stuff I did getting Compile to work had borked my system! $\endgroup$ Commented Mar 22, 2015 at 0:17
  • $\begingroup$ Nothing happens on Mathematica 10.0.2 on Linux! $\endgroup$
    – Mahdi
    Commented Mar 22, 2015 at 19:32
  • $\begingroup$ Interesting... I'm going to try and update to 10.0.1 (school license... can't get 10.0.2) and see if that helps. $\endgroup$ Commented Mar 22, 2015 at 19:58
  • 3
    $\begingroup$ Replicated and reported. $\endgroup$ Commented Mar 24, 2015 at 22:07

1 Answer 1

4
$\begingroup$

This bug has been fixed in the just released Mathematica 11.1.

Do[
 TimeConstrained[While[True, Delete[Range[1], 1];];, 
   0.1];, {100}]; "done"

(* "done" *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.