Bug 29480

Summary: 32-bit lame sementation faults while encoding a .wav file to a .mp3 (not 64-bit)
Product: Mageia Reporter: james king <jamesk169>
Component: RPM PackagesAssignee: All Packagers <pkg-bugs>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Normal CC: jamesk169
Version: 8   
Target Milestone: ---   
Hardware: i586   
OS: Linux   
Whiteboard:
Source RPM: lame-3.100-7.mga8.src.rpm CVE:
Status comment:
Attachments: wav file that crashes lame on my PC

Description james king 2021-09-21 04:30:04 CEST
Description of problem:

Attempting to encode a .wav file into a .mp3 file will cause segmentation fault. The wav file is valid and plays when played with the 'mpv' program. I was able to encode the wav into an .ogg and the resulting .ogg played fine as well.  

Running on the following kernel (if this matters):
[user1@localhost x]$ uname -a
Linux localhost.localdomain 5.10.62-desktop-1.mga8 #1 SMP Fri Sep 3 15:03:25 UTC 2021 i686 i686 i386 GNU/Linux


Version-Release number of selected component (if applicable):

Name        : lame
Version     : 3.100
Release     : 7.mga8

How reproducible:

Just running lame on a file with no options will cause the problem. Here is a test run:
----- START. 
[user1@localhost x]$ lame vivaldi_allegro_in_d_for_strings.wav
LAME 3.100 32bits (http://lame.sf.net)
CPU features: MMX (ASM used), SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding vivaldi_allegro_in_d_for_strings.wav
      to vivaldi_allegro_in_d_for_strings.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (11x) 128 kbps qval=3
Segmentation fault (core dumped)
[user1@localhost x]$ 
----- END.

Steps to Reproduce:
1. just running the command on a .wav file will cause it to crash. e.g.:

   lame vivaldi_allegro_in_d_for_strings.wav
Comment 1 Lewis Smith 2021-09-21 21:24:41 CEST
I had difficulty finding any decent free .wav file to download, but having got a short one - it worked. I confirmed that the original .wav file played, and the resultant .mp3 one:
 $ lame elvis_riverside.wav 
LAME 3.100 64bits (http://lame.sf.net)
polyphase lowpass filter disabled
Encoding elvis_riverside.wav to elvis_riverside.mp3
Encoding as 11.025 kHz single-ch MPEG-2.5 Layer III (11x)  16 kbps qval=3
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA 
   372/372   (100%)|    0:00/    0:00|    0:00/    0:00|   76.204x|    0:00 
-------------------------------------------------------------------------------
   kbps       mono %     long switch short %
   16.0      100.0        96.5   2.2   1.3
ReplayGain: -14.1dB

As a cross-check, I converted a FLAC file I had (lossless) to WAV with ffmpeg, and tried laming that. It too worked, the result .mp3 played fine:
 $ lame Trac3.wav
LAME 3.100 64bits (http://lame.sf.net)
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding Trac3.wav to Trac3.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (11x) 128 kbps qval=3
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA 
  6979/6979  (100%)|    0:18/    0:18|    0:19/    0:19|   9.6504x|    0:00 
-------------------------------------------------------------------------------
   kbps        LR    MS  %     long switch short %
  128.0       78.9  21.1        99.7   0.2   0.2
Writing LAME Tag...done
ReplayGain: -5.5dB

Can you attach your .wav file to this bug? Or any that you know causes your crash. 1Mb max, I think.
Note that there are other ways than lame for doing this conversion, both command line & GUI, if it presses.

Status: NEW => UNCONFIRMED
Ever confirmed: 1 => 0
CC: (none) => lewyssmith

Comment 2 james king 2021-09-23 06:21:09 CEST
I cut my .wav file down to ~580kb but don't know how to attach it to bugzilla. I could uuencode it and paste it in here, but that would probably be annoying for some people. 

The 580kb .wav also crashed on my system when using lame to encode it. Perhaps it has something to do with the fact that I'm on a 32-bit only system? 

-- start output --

[user1@localhost Documents]$ lame export4.wav 
LAME 3.100 32bits (http://lame.sf.net)
CPU features: MMX (ASM used), SSE (ASM used), SSE2
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding export4.wav to export4.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (11x) 128 kbps qval=3
Segmentation fault (core dumped)
[user1@localhost Documents]$ ls -l
total 1144
-rw-r--r-- 1 user1 user1      0 Sep 23 00:18 export4.mp3
-rw-r--r-- 1 user1 user1 579628 Sep 22 19:52 export4.wav
[user1@localhost Documents]$ 

-- end output -- 

In the meantime, I got ffmpeg and got my script to make all of the mp3 files that I was looking to create. So, I'm not really delayed in my tasks. Perhaps I could install this 32-bit system in a VM and see if lame also crashes there.
Comment 3 james king 2021-09-23 23:03:37 CEST
Created attachment 12930 [details]
wav file that crashes lame on my PC

This is a clip of one of the wav files that I was trying to convert into MP3

CC: (none) => jamesk169

Comment 4 Lewis Smith 2021-09-24 21:35:37 CEST
Thank you for that extract. Fantastically short - I was looking forward to some decent music! But the most you can get within 1Mb is about 6sec...

On my system the WAV played OK, converted OK to MP3, and that played OK too:
 $ lame Desktop/export4.wav 
LAME 3.100 64bits (http://lame.sf.net)
Using polyphase lowpass filter, transition band: 16538 Hz - 17071 Hz
Encoding Desktop/export4.wav to Desktop/export4.mp3
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (11x) 128 kbps qval=3
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA 
   127/127   (100%)|    0:00/    0:00|    0:00/    0:00|   9.0552x|    0:00 
-------------------------------------------------------------------------------
   kbps        LR    MS  %     long switch short %
  128.0       78.0  22.0        97.6   1.6   0.8
Writing LAME Tag...done
ReplayGain: +4.3dB

> Perhaps it has something to do with the fact that I'm on a 32-bit only system?
Almost certainly. I should have spotted that initially...

'lame' has no registered nor visible packager, so assigning this globally.

Summary: lame sementation faults while encoding a .wav file to a .mp3 => 32-bit lame sementation faults while encoding a .wav file to a .mp3 (not 64-bit)
CC: lewyssmith => (none)
Assignee: bugsquad => pkg-bugs
Status: UNCONFIRMED => NEW
Ever confirmed: 0 => 1