Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGSEGV in SoundTouch 1.9.2 #8534

Closed
mixxxbot opened this issue Aug 22, 2022 · 24 comments
Closed

SIGSEGV in SoundTouch 1.9.2 #8534

mixxxbot opened this issue Aug 22, 2022 · 24 comments

Comments

@mixxxbot
Copy link
Collaborator

Reported by: uklotzde
Date: 2016-04-30T19:21:40Z
Status: Fix Released
Importance: Critical
Launchpad Issue: lp1577042


OS: Fedora 23 x86_64
Lib: soundtouch-1.9.2-3.fc23.x86_64

Branch: master (2.1.0-alpha-pre x64)
Key Lock enabled
Pitch at 0.00
  - not moved during the whole session (AutoDJ background music @home)
File plays fine after restart
  - same results
  - waveform generation is skipped now

Warning [AnalyzerQueue 1]: Recoverable MP3 frame decoding error: lost synchronization
Debug [AnalyzerQueue 1]: Waveform generation for track 92614 done 6 s
Debug [AnalyzerQueue 1]: ReplayGain 2.0 (libebur128) result is -2.78099 dB for "/home/uk/Music/Collection/nico/chelsea girl/01-02 nico these days.mp3"
Debug [AnalyzerQueue 1]: Beat Calculation complete
Debug [AnalyzerQueue 1]: Key Detection complete
Debug [AnalyzerQueue 1]: Key Histogram
Debug [AnalyzerQueue 1]: 6 : "F" 7.93267e+06
Debug [AnalyzerQueue 1]: 11 : "B♭" 1.47456e+06

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffee22d2700 (LWP 16845)]
0x00007ffff7891e90 in soundtouch::TDStretch::overlapStereo(float*, float const*) const () from /usr/lib64/libSoundTouch.so.1
(gdb) bt
#0  0x00007ffff7891e90 in soundtouch::TDStretch::overlapStereo(float*, float const*) const () at /usr/lib64/libSoundTouch.so.1
mixxxdj/mixxx#4910  0x00007ffff7893037 in soundtouch::TDStretch::processSamples() ()
    at /usr/lib64/libSoundTouch.so.1
mixxxdj/mixxx#4911  0x00007ffff7891490 in soundtouch::SoundTouch::putSamples(float const*, unsigned int) () at /usr/lib64/libSoundTouch.so.1
mixxxdj/mixxx#4912  0x00000000007cfc82 in EngineBufferScaleST::getScaled(float*, int) (this=0x20a9d00, pOutput=<optimized out>, buf_size=2048)
    at src/engine/enginebufferscalest.cpp:164
mixxxdj/mixxx#4913  0x00000000007cba11 in EngineBuffer::process(float*, int) (this=0x1fa1be0, pOutput=0x7fffc8792010, iBufferSize=2048) at src/engine/enginebuffer.cpp:983
mixxxdj/mixxx#4914  0x00000000007d1310 in EngineDeck::process(float*, int) (this=0x1f759d0, pOut=0x7fffc8792010, iBufferSize=2048) at src/engine/enginedeck.cpp:98
mixxxdj/mixxx#4915  0x00000000007dff4e in EngineMaster::processChannels(int) (this=this@entry=0x14fe100, iBufferSize=iBufferSize@entry=2048) at src/engine/enginemaster.cpp:318
mixxxdj/mixxx#4916  0x00000000007e8b50 in EngineMaster::process(int) (this=0x14fe100, iBufferSize=iBufferSize@entry=2048) at src/engine/enginemaster.cpp:350
mixxxdj/mixxx#4917  0x0000000000b47d5b in SoundManager::onDeviceOutputCallback(unsigned int) (this=<optimized out>, iFramesPerBuffer=iFramesPerBuffer@entry=1024)
    at src/soundio/soundmanager.cpp:548
mixxxdj/mixxx#4918  0x0000000000b44a36 in SoundDevicePortAudio::callbackProcessClkRef(unsigned int, float*, float const*, PaStreamCallbackTimeInfo const*, unsigned long) (this=0x1e337c0, framesPerBuffer=1024, out=0x4de4f2a0, in=<optimized out>, timeInfo=<o---Type <return> to continue, or q <return> to quit---
ptimized out>, statusFlags=<optimized out>)
    at src/soundio/sounddeviceportaudio.cpp:949
mixxxdj/mixxx#4919 0x00007ffff7459454 in AdaptingOutputOnlyProcess ()
    at /usr/lib64/libportaudio.so.2
mixxxdj/mixxx#4920 0x00007ffff745aded in PaUtil_EndBufferProcessing ()
    at /usr/lib64/libportaudio.so.2
mixxxdj/mixxx#4921 0x00007ffff746391b in CallbackThreadFunc () at /usr/lib64/libportaudio.so.2
mixxxdj/mixxx#4922 0x00007ffff1d1e60a in start_thread () at /usr/lib64/libpthread.so.0
mixxxdj/mixxx#4923 0x00007fffeeeb5a4d in clone () at /usr/lib64/libc.so.6
@mixxxbot
Copy link
Collaborator Author

Commented by: ywwg
Date: 2016-04-30T19:52:25Z


in the past we've had crashes when either soundtouch or rubberband were fed "crazy" rates, like 0 or 10000000000. So this might be a case where we aren't successfully detecting an invalid rate.

@mixxxbot
Copy link
Collaborator Author

Commented by: uklotzde
Date: 2016-05-01T06:18:01Z


Before the crash it played for 2 hours without any issues so I don't think this is caused by some weird parameter. Looks more like a memory corruption issue.

@mixxxbot
Copy link
Collaborator Author

Commented by: uklotzde
Date: 2016-05-04T08:55:50Z


Might be fixed:
af99a26

@mixxxbot
Copy link
Collaborator Author

Commented by: uklotzde
Date: 2016-05-05T08:22:03Z


@rryan: Should we change the status to "Fix Committed"? I think your commit fixes this bug.

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2016-05-05T17:34:40Z


Uwe -- I could never reproduce the segfault so I'm not sure if I fixed it. But maybe we can declare it fixed and reopen if someone sees it again.

I also enabled asan in our Travis builds so we should notice memory safety bugs like this in the future at PR-time.

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2016-05-05T17:34:57Z


(assuming the tests exercise the code path :X)

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2016-05-05T17:36:32Z


The overflow was only at bootup though -- but maybe it trashed some internal soundtouch or engine state that caused your segfault.

@mixxxbot
Copy link
Collaborator Author

Commented by: wrobertson1981
Date: 2018-06-06T10:40:49Z


Thread 11 "mixxx" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff503dd700 (LWP 8345)]
0x00007ffff7892140 in soundtouch::TDStretch::overlapStereo(float, float const) const () from /usr/lib/x86_64-linux-gnu/libSoundTouch.so.1

Crash while using the library-redesign branch, 1 1/2 hours into a set. Possible regression.

How do I trigger this problem, reliably?

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2018-06-06T11:21:05Z


Could you remember what your rate slider and keylock state was just before the crash?

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2018-06-06T11:37:02Z


A similar bug is fixed here:
https://sourceforge.net/p/soundtouch/code/236
And released with Soundtouch 2.0
On which version are you?

@mixxxbot
Copy link
Collaborator Author

Commented by: wrobertson1981
Date: 2018-06-06T22:43:15Z


uhh... 1.9.2.2-2, the latest is 1.9.2-3... there is no soundtouch 2 released for ubuntu as far as i know?

@mixxxbot
Copy link
Collaborator Author

Commented by: wrobertson1981
Date: 2018-06-06T22:44:24Z


Switching to Rubberband to play it safe.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2018-06-07T05:14:48Z


So we need to provide Soundtouch ourselves for Ubuntu as well.
Or put Soundtouch into our ppa. I

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2018-06-07T05:33:09Z


The upstream bug is tracked here:
https://sourceforge.net/p/soundtouch/bugs/4/

@mixxxbot
Copy link
Collaborator Author

Commented by: janitor
Date: 2018-06-07T05:34:41Z


Status changed to 'Confirmed' because the bug affects multiple users.

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2018-06-08T18:48:22Z


So we need to provide Soundtouch ourselves for Ubuntu as well.
Or put Soundtouch into our ppa.

IMO that should only be done in extreme circumstances. It would be better to work with Ubuntu to update their Soundtouch package. Fedora 28 is shipping Soundtouch 2.0. Arch is as well.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2018-06-08T19:11:40Z


I have already assigned this bug to them. What else can we do?

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2018-06-08T19:59:36Z


According to https://launchpad.net/ubuntu/+source/soundtouch the package is maintained by the Debian Multimedia Team, so I guess contact them to notify them of the urgency of updating the Soundtouch package. I do not know if they receive notifications from Launchpad automatically, so I sent an email to <email address hidden>

@mixxxbot
Copy link
Collaborator Author

Commented by: uklotzde
Date: 2018-06-09T00:19:23Z


Why not simply increasing the minimum required version from 1.8.0 to 2.0.0?

@mixxxbot
Copy link
Collaborator Author

Commented by: wrobertson1981
Date: 2018-06-09T00:31:39Z


Huh? and break the easy installation of Mixxx until Debian/ubuntu update the package?

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2018-06-10T12:25:12Z


Why not simply increasing the minimum required version from 1.8.0 to 2.0.0?

Yes, that is the way to go here. Trusty for example has Soundtouch 1.7 so we build it with our own static library anyway. If Ubuntu has 2.0.0 one day, it will uses the system provided version again.

@mixxxbot
Copy link
Collaborator Author

Commented by: s-ramacher
Date: 2018-08-07T06:56:31Z


2.0.0 is now available in Ubuntu. FWIW, the Debian Multimedia Team does not receive notifications from Launchpad. So if you require actions from us, please file bugs in the Debian bug tracker or contact the mailing list.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2018-08-18T23:10:45Z


We now use our own sounddouch 2.0 if the distro provided version is lower.

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot added this to the 2.1.1 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant