Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'm having a rather baffling problem that Wolfram was unable to help me diagnose, and I'm hoping one of you geniuses in residence here can figure it out. (I don't get access to the Technical Support folks at Wolfram because of the fact that mine is a home license.)

If I open a new notebook and run Factorial[10]//AbsoluteTiming I will get the expected results for my machine: {0.000024, 3 628 800}. However, if I execute it again, the notebook reports "Running" for 3-5 minutes before giving nearly the same output. During that period, the Mathkernel process is cranking with 100% CPU usage, however the actual time reported in the output to perform the evaluation is tiny.

There is a pattern. After either canceling the hanging evaluation or letting it run through to its tardy completion, the next evaluation runs normally (i.e. quickly). However, the next evaluation AFTER that hangs again. And the pattern continues indefinitely as far as I have tested it: every other evaluation hangs for 3-5 minutes.

My setup: 2012 Macbook Pro Retina running OS X 10.8.3, with Mathematica version I have 8 GB RAM, and plenty of space on my 250GB SSD. 2.3 GHz Intel Core i7.

What I have tried: Sleep --> Wake, Restart, Shut Down and Reboot, uninstalling and reinstalling Mathematica, including deactivating and reactivating it.

What might be causing this mysterious problem? All other software on the machine is performing normally and I ran the Apple Hardware Diagnostics, which turned up nothing.


More clues:

-Invoking Mathkernel from the terminal to execute an m file works fine. (I haven't tested keeping a Mathkernel alive from the terminal and sending commands one at a time, like you might in the front end.)

-If I leave Mathematica and do something else for a few minutes and come back, the first evaluation always works fine and the second hangs.

-If I press command+'.' (abort evaluation) before evaluating, it always works. What the....?

-If I run Factorial[10]//Timing a few times successfully, the typical response is actually {6.x10-6, 3 628 800}

share|improve this question
I have no idea what would cause that but damn that sounds annoying! :-/ –  Mr.Wizard May 23 '13 at 16:28
Needless to say that I can't reproduce this. I do note, however, that the reported timing in my case is always 0 and not the low, but definitely non-zero number you get. Perhaps, that's a clue of some kind? –  Sjoerd C. de Vries May 23 '13 at 18:33
It's a shame that a Mathematica random bug manifests itself following such a trivial pattern. Failing (for example) every Prime[Fibonacci[n]] would be much proper ( :D ) –  belisarius May 23 '13 at 21:12
A novice suggestion perhaps, but can you run from the terminal and see if it does the same thing? –  Jonathan Shock May 23 '13 at 23:56
Have you checked the various init.m files for strange settings? It could be that the ones in $(User)BaseDirectory/FrontEnd have some malicious code in it, since running it on just the kernel without the frontend worked for you. –  Teake Nutma Jun 29 '13 at 17:38

3 Answers 3

I just had something that sounded like the same problem on a linux machine. In this case there was a folder in the home directory called .Mathematica, when I removed that and ran mathematica again it worked. I have to say that it is server set up mathematica, so thing might be different, but it could be worth a try.

share|improve this answer

I had the exact same issue with Mac OS X 10.8.4 and Mathematica, where even simple commands such as Sin[10] would lead to an apparent halt every other execution. None of the suggestions worked (looking for a .Mathematica folder in the home directory, looking for a modified init.m file, trying $AllowInternet = False, etc.).

Removing the application and reinstalling it had no effect, but I realized that it was still activated. In a last-ditch effort, I did the following steps:

  1. In the Finder goto the menu and select Go -> Go to Folder...
  2. Goto ~/Library/
  3. Delete the Mathematica folder therein
  4. Restart Mathematica, enter activation key

I found that this worked for me. This clears all your preferences, but thankfully mine were not modified from the defaults.

share|improve this answer
I can confirm that this solution works fine for the same problem with Mathematica 9.01 on linux Ubuntu 12.04 . Many thanks –  luming Apr 3 at 11:55

In linux Mathematica 9.0 I confirm that this problem is caused by Internet access. Go to

  1. Home>Ctrl+H :Shows hidden files
  2. Browse to ./.Mathematica/Paclets/Confiruration
  3. Open "managerData_9.0.0.0.pmd2"
  4. Change "AllowInternet" -> False"

Hope that helps.

share|improve this answer
Typo at "Confiruration"? –  Yves Klett Nov 19 '13 at 15:25
I can confirm that this solution works fine for the same problem with Mathematica 9.01 on linux Ubuntu 12.04 . Many thanks –  luming Apr 3 at 11:55

protected by rm -rf Jan 29 at 18:09

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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