This happened on one of my Ubuntu machines where Igot some kind of segfault on line 21 from LAME at random while encoding MP3s (a second try is fine usually). I've read that it's best to compile it from source and that has solved most issues for people.
Here is my preferred configure line:
./configure --enable-mp3x --with-fileio=lame --enable-debug --with-vorbis
Even with that I got a different error this time:
line 33: 22793 Floating point exceptionlame $lameoptions "$dest_dir"/$track.wav
lame: vbrquantize.c:183: k_34_4: Assertion `x <= 8206 && x <= 8206 && x <= 8206 && x <= 8206' failed.
/root/mp3rip.sh: line 33: 24594 Aborted lame $lameoptions "$dest_dir"/$track.wav
mp, encoder, segmentation, faultsthis, ubuntu, segfault, encoding, ve, compile, preferred, configure, enable, fileio, debug, vorbis, exceptionlame, lameoptions, quot, dest_dir, wav, vbrquantize, k_, _, assertion, sh, aborted,