I'm trying to work out if it's a Mathematica, Ubuntu or setup specific bug. I've asked some colleagues to try it on other Linuxes.
This also crashes on OS X with Mathematica 8.0 and fails with 9.0, so it looks like it could be a Mathematica bug (output on request). It may be an artefact of running on the CLI (my tests on 9.0 so far have had to be via ssh), though the full 8.0 .app crashes, too.
Warning: it may suddenly end your session, so close all other programs and save your work, etc, first.
logMeOut.m
p = ListDensityPlot[Table[RandomReal[], {i, 1, 128}, {j, 1, 128}]];
Export["myPlot.jpg", p, ImageSize -> Scaled[2]]
Export["myPlot.jpg", p, ImageSize -> Scaled[2]]
run it with
$ /path/to/MathKernel -noprompt -script logMeOut.m
Interestingly, when I run either of
$ strace -f /path/to/MathKernel -noprompt -script logMeOut.m &> mathematicabug.strace
(output on request) or
$ /path/to/MathKernel -noprompt -script logMeOut.m &> mathematicabug.log
I don't get logged out. The second gives no output.
Per the strace, the library accessed before the crash (it still seg faults) is terminfo (/lib/x86_64-linux-gnu/libtinfo.so.5), so given the above suppresses output, it may be related to that.
Any ideas from a Mathematica rather than system perspective why it doesn't work? System perspectives are also welcome, though maybe don't go here.