-
Notifications
You must be signed in to change notification settings - Fork 65
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
Segfault on alpine linux in alsa::pcm::PCM::open #59
Comments
The variable is set to null and the call to snd_pcm_open fills it in.
I would run the program with a debugger (such as gdb) and when the program segfaults, get a full backtrace. Are you familiar with gdb? |
I'm not super familiar with gdb but i ran it, and got the got
|
Okay, so it looks like the problem is the C library binding itself somehow? I e, the Rust code is supposed to call a C library function, I don't think alsa-rs/alsa-sys is doing anything strange in this matter, so it's probably an "alpine linux" + Rust + C-bindings issue but it's hard to know for sure. |
Side note: Have you modified alsa-rs in any way, or running an old version, or something? |
I'm at the git latest, I'd added some prints before, I just forgot about them but the bt is the same when i remove them. |
So, what about the build process? Do you cross-compile or not? Have you successfully dynamically bound to other C libraries in the same build environment? (Static linking is not supported, PRs welcome.) |
I gave a try to building with the container you mentioned, I mounted the PWD etc as the readme says and then entered the container with sh so i could install the alsa headers when try to build it in the container, once it built, i wasnt able to run it within the container as it had some sort of linking issue resulting in
|
Okay, so that's a different error as now you're actually able to call snd_pcm_open, which you weren't before. But anyhow this sounds less and less like something related to alsa-sys and more like something related to muslc/rust/toolchain/something. Can I ask you to read up a little on this and perhaps seek support from the muslc/rust-people instead? Because I'm not really qualified to help you. I am interested in having alsa-sys working on as many platforms as possible though so if you come back with more information/PR/etc I'll be happy to talk/review/merge further. |
I'm closing this due to inactivity, and because this is probably about the build process rather than alsa-sys. Feel free to reopen in case circumstances change or new information arises. Thanks! |
Just in case someone else stumbles upon this issue: In my case, this was due to a problem in this specific chain (rust, linking to shared system libraries, musl), which is described here. A workaround can be found in this comment. |
alsa::pcm::PCM::open (pcm.rs:135) due to (as far as i can tell) the variable 'r' being 0x0
I'm not sure how to proceed, the program i've been using to narrow it down was this from the synth-example
Might it be an issue from alpine using musl?
The text was updated successfully, but these errors were encountered: