2

Update: Try to reproduce this behaviour with CellGrouping set to manual. To do that:

  • either evaluate SetOptions[$FrontEnd, CellGrouping -> Manual],
  • or hit CTRL+SHIFT+O to bring up the Option Inspector window, Lookup (among Global preferences) the option CellGrouping and set it to Manual.

Please test whether the phenomen is reproducible for you with the changed setting. You can reset cell grouping to its default behaviour by:

SetOptions[$FrontEnd, CellGrouping -> Automatic]

Strangest bug ever. Copy the following piece of code to the same notebook two times, below each other, as two identical cells. Be sure to run a fresh kernel.

DynamicModule[{x}, Print[1]; Dynamic@x, Initialization :> Print[2]]

Now evaluate the second cell. Fine, it returns and prints stuff.

Mathematica graphics

And now, without quitting the kernel, evaluate the first cell. It crashes Mathematica. Every time, and only when the first cell is evaluated. If (after a restart) I only evaluate the first cell, Mathematica crashes again.

How come that the outcome of evaluating two identical cells depends on whether the cell is the last one or not?

Furthermore, this one causes a crash on its own:

DynamicModule[{x}, Dynamic@x, Initialization :> Print[2]]

Mathematica 9.0.1.0 Windows 7 (64-bit), no packages, problem persists after full reboot, suggestion bar is turned off.

István Zachar
  • 47,032
  • 20
  • 143
  • 291

1 Answers1

4

Tech Support kindly answered and acknowledged the crash:

The crash is now reproducible after setting the option CellGrouping -> Manual. I have forwarded it to the developers for further investigation. You will be informed when a fix is made available.

You can turn off manual CellGrouping with:

SetOptions[$FrontEnd, CellGrouping -> Automatic]

Also, restarting Mathematica in clean mode resets everything including cell grouping behaviour to defaults and the two cells behave normally. The documentation states:

mathematica.exe -clean: ignore stored caches and rebuild the front end preferences file

(It also seems like from the documentation that this is a Mac-only option, but it also applies to Win.)

István Zachar
  • 47,032
  • 20
  • 143
  • 291