Linux V0022 Mega 2560 crash (SOLVED?)

SurferTim:
Yes. I did download it from the repository for my version of Linux. These are the versions they show:
avr-gcc 4.4.2
avr-binutils 2.20
avr-libc 1.67

The repository has been very reliable in the past. Do you see anything here that should be upgraded? Did I miss a utility?
If so, I can recommend the repository team compile new versions. It might take a while tho.

Based on my own experience, chances are very high they are handing out known buggy compilers. You can compile your own binutils, compiler, and libc; which I strongly recommend. Again, from my own experience, the distros are very much aware they have a crappy AVR compiler but just don't care. I guess from their perspective, the number of users who not only cross compile for AVR AND are using one of the MCUs which are buggy with their compiler is so small, its not worth their time.

As a stop gap, so as to allow you to use the Serial interface with your compiler, try this. Modify HardwareSerial.cpp. Make the following changes at the end of the file.

#if defined(UBRR1H)
  //HardwareSerial Serial1(&rx_buffer1, &UBRR1H, &UBRR1L, &UCSR1A, &UCSR1B, &UDR1, RXEN1, TXEN1, RXCIE1, UDRE1, U2X1);
  #warning serial port 1 disabled because of compiler bug
#endif
#if defined(UBRR2H)
  //HardwareSerial Serial2(&rx_buffer2, &UBRR2H, &UBRR2L, &UCSR2A, &UCSR2B, &UDR2, RXEN2, TXEN2, RXCIE2, UDRE2, U2X2);
  #warning serial port 2 disabled because of compiler bug
#endif
#if defined(UBRR3H)
  //HardwareSerial Serial3(&rx_buffer3, &UBRR3H, &UBRR3L, &UCSR3A, &UCSR3B, &UDR3, RXEN3, TXEN3, RXCIE3, UDRE3, U2X3);
  #warning serial port 3 disabled because of compiler bug
#endif

The Mega2560 has four hardware UARTS. This change means only one is available (Serial); without manually instantiating them inside your loop. Furthermore, instantiating other global objects will likely also trigger the compiler bug which screws up save/restore of a couple of registers. This in turn means you'll need to move some globals into the loop() scope. This in turn means lots of examples will not work without change. Furthermore, this means a lot of code will simply not work without yet more changes.

If compiling for the 2560 is important for your project, I strongly encourage you to compile your own compiler. The combination which works is documented in the thread. The important part is applying the patches. As noted in that thread, one hunk from one patch failed to apply for me. Regardless, once done you should have a compiler which at the very least is far more reliable than the one provided by your distribution.

Now if only the arduino devs would release a 0023 based on the current libc + gcc 4.6.x. In doing so, it would likely prevent the Linux problems altogether. But once again, I guess the cross section of users means they don't really care either.