http://projects.blender.org/tracker/?func=detail&atid=125&aid=3658&group_id=9
Running scripts from command line in bg mode:
blender -b -P myscript.py
crashes Blender 2.40.
The problem is in add_text() in text.c: G.scene can be NULL at this
point (in bg mode). Added a check:
line 323:
if (G.scene) /* can be NULL (bg mode) */
BLI_convertstringcode(str, G.sce, G.scene->r.cfra);
The text being added with add_text() in this particular case is the
script filename specified at the command prompt, so it should be ok to skip
BLI_convertstringcode. Feel free to disagree, though.