More info: I compiled MAME with -O0 and debugging information to try to get a backtrace but I couldn't make it crash. Other than the aforementioned differences, I was also using GCC 4.6.3 (not 4.7.0 as in the version compiled by Debian). Berto