BambooTracker icon indicating copy to clipboard operation
BambooTracker copied to clipboard

[Linux] - Segmentation fault under Clang/Musl build

Open z-erica opened this issue 1 year ago • 1 comments

Checklist

  • [X] I am reporting exactly 1 bug with this issue.
  • [X] This bug hasn't already been reported.
  • [X] This bug hasn't already been fixed in the latest development build.

Bug Description

i am trying to package bambootracker for chimera linux, a new linux distribution which uses clang as its compiler toolchain and musl as its standard c library. both the v0.6.3 tag and the master branch immediately crash upon running the program with a segmentation fault.

lldb backtrace (for v0.6.3):

* thread #17, name = 'BambooTracker', stop reason = signal SIGSEGV: invalid permissions for mapped object (fault address: 0x7fffde3d3fd8)
  * frame #0: 0x000055555565a73b BambooTracker`chip::BlipResampler::interpolate(this=0x00007fffef6333f0, src=0x00007fffebe16ba0, nSamples=735, intrSize=924) at resampler.cpp:133
    frame #1: 0x000055555564b5ed BambooTracker`chip::OPNA::mix(this=0x00007fffebe16b20, stream=0x00007fffe9121080, nSamples=735) at opna.cpp:239:35
    frame #2: 0x00005555558d234f BambooTracker`OPNAController::getStreamSamples(this=0x00007fffeb312148, container=<unavailable>, nSamples=735) at opna_controller.cpp:191:23
    frame #3: 0x00005555556278b9 BambooTracker`AudioStream::generate(this=0x00007fffec7327f8, container=<unavailable>, nSamples=<unavailable>) at audio_stream.cpp:136:17
    frame #4: 0x00005555556298ac BambooTracker`AudioStreamRtAudio::initialize(unsigned int, unsigned int, unsigned int, QString const&, QString const&, QString*)::$_0::__invoke(void*, void*, unsigned int, double, unsigned int, void*) [inlined] AudioStreamRtAudio::initialize(unsigned int, unsigned int, unsigned int, QString const&, QString const&, QString*)::$_0::operator()(this=<unavailable>, outputBuffer=<unavailable>, (null)=<unavailable>, nFrames=<unavailable>, (null)=<unavailable>, (null)=<unavailable>, userData=<unavailable>) const at audio_stream_rtaudio.cpp:71:25
    frame #5: 0x00005555556298a4 BambooTracker`AudioStreamRtAudio::initialize(unsigned int, unsigned int, unsigned int, QString const&, QString const&, QString*)::$_0::__invoke(outputBuffer=<unavailable>, (null)=<unavailable>, nFrames=<unavailable>, (null)=<unavailable>, (null)=<unavailable>, userData=<unavailable>) at audio_stream_rtaudio.cpp:68:5
    frame #6: 0x00007ffff7f8ae89 librtaudio.so.7`RtApiPulse::callbackEvent() + 265
    frame #7: 0x00007ffff7f8ab1d librtaudio.so.7`pulseaudio_callback(void*) + 253

a git bisect shows https://github.com/BambooTracker/BambooTracker/commit/b1a6d2ea2319527e760afb8c74453d9dc025f21e as the commit which introduces this crash

How to reproduce

build bambootracker normally, then run the resulting binary

System Information

  • Operating System: Chimera Linux
  • BambooTracker Version: v0.6.3
  • Build Type: local

z-erica avatar Mar 17 '24 17:03 z-erica

clang as its compiler toolchain and musl as its standard c library

I tried to replicate that configuration, but it would require too many patches to other packages to get working on my distro. Musl support is not very widely maintained there...

  • frame #0: 0x000055555565a73b BambooTracker`chip::BlipResampler::interpolate(this=0x00007fffef6333f0, src=0x00007fffebe16ba0, nSamples=735, intrSize=924) at resampler.cpp:133

That just points at the start of that function afaict. https://github.com/BambooTracker/BambooTracker/blob/ca31c5d6aba966736b2e727d262feed2a80c230a/BambooTracker/chip/resampler.cpp#L132-L134

Not sure how to interpret that. Is that as accurate as you can get the stack trace? Would it be possible for you to debug this any further?

OPNA2608 avatar Mar 19 '24 12:03 OPNA2608

turns out it was just a matter of raising the default stack size! sorry for the confusion

z-erica avatar Aug 14 '24 14:08 z-erica

No problem! Glad you managed to resolve this.

OPNA2608 avatar Aug 14 '24 14:08 OPNA2608