-
Notifications
You must be signed in to change notification settings - Fork 95
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 iterating stream #64
Comments
What version of ffmpeg do you have installed on the system? This crate is still on ffmpeg-2.8, still trying to figure out the best way to support multiple versions of ffmpeg, what's happening looks like a stack overflow because some struct definitions are different in 3.0 from 2.8. If that's not the case I'll look into it, segfaults definitely shouldn't happen. |
Thanks! I was thinking from a quick glance at Okay, so if I understand correctly Rust FFI code has to duplicate the definition of structs used across the interface boundary and basically hope that they're in sync with the canonical C version? Hmm, that sucks. And in my particular case, yes, I have a funny version installed on my system. It's some git version (it says "ffmpeg version N-77403-g70f13ab") that's probably halfway between 2.8 and 3.0. A few ideas:
|
Ah yeah, I had to stop using the pre-release style I was using and I forgot to fix the About using a generator, it's not that easy sadly, ffmpeg has a gazillion configure flags that may or may not change the shape of structs and presence of functions, so generating the whole bindings automatically would be even more painful. There are some checks based on the headers to know what fields should be, but that's as far as it goes. I'll fix the |
Alright the |
I have the exact same segfault on the same line, using ffmpeg 3.0 from the Arch repos. |
Then it's definitely 3.0, I haven't had the time to update the changes between 2.8 and 3.0, which means it's a struct having differently sized fields and corrupting the stack. |
In my project, I just switched to using a C wrapper around ffmpeg that provides a more stable API, and then using that from Rust rather than accessing members of ffmpeg's giant structs directly. I wrapped a very small part of ffmpeg and without as nice an API as your crate, but it's enough to see what the approach looks like. |
@scottlamb have you had a chance to try with the latest stuff? @retrry worked on using bindgen to generate stuff and that should have at least made things safer wrt ABI. |
Sigh. No. One would think that I would have looked at the latest status of the project before implementing something myself but I'd been using an old fork for a while (before versions that stopped working with ffmpeg 2.x, iirc) and was only watching this project through this bug. I suppose one upside of what I did is that it works without having to have bindgen installed, which I remember is a bit of a pain on older platforms. |
@scottlamb from what I know you don't really need to have anything installed for bindgen to work now, it's just a library the build script can use like any other. |
@meh you need to have clang installed for bindgen. |
@retrry ah, forgot about that, I just assumed everyone has that 🐼 |
I'm probably doing something dumb, but even so I think a
SIGSEGV
in safe code is supposed to be impossible.When run with some URL (for example,
rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov
), it crashes with a segfault.GDB says this:
which I guess means that the location where the
self
pointer is stored is invalid? Not sure why that would be but I'll poke at it a bit.I tried a couple versions of rust in case it's a problem with the compiler/runtime:
The text was updated successfully, but these errors were encountered: