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

External texture segmentation fault #426

Closed
barribarrier opened this issue Sep 27, 2024 · 2 comments · Fixed by #427
Closed

External texture segmentation fault #426

barribarrier opened this issue Sep 27, 2024 · 2 comments · Fixed by #427
Labels
bug Something isn't working plugin Topics of flutter plugins for embedded linux

Comments

@barribarrier
Copy link
Contributor

I found a segmentation fault in external texture.

I triggered a crash by playing and disposing video over and over again really fast. It eventually crashes.

gdb

Thread 9 "io.flutter.rast" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffdc4006c0 (LWP 154435)]
0x00005555555ee615 in flutter::ExternalTexturePixelBuffer::PopulateTexture (this=0x555555b98070, width=1280, height=720, 
    opengl_texture=0x7fffc01dd510)
    at /home/ubuntu/flutter-embedded-linux/src/flutter/shell/platform/linux_embedded/external_texture_pixelbuffer.cc:38
39        opengl_texture->name = state_->gl_texture;

This is because UnregisterTexture and PopulateTexture are called from a different thread.
It was fixed on upstream: flutter/engine#33688. I applied the changes in that PR to my local flutter-embedded-linux and I can confirm it no longer crashes.
I can create a PR based on this but it uses fml::closure.

@barribarrier
Copy link
Contributor Author

I can confirm it no longer crashes

Well, it did crash on CopyPixelBuffer but I think its a separate issue. I might open a new issue for it later.

@barribarrier
Copy link
Contributor Author

If implemented, I think this will require a proper thread synchronization in the pixelbuffer callback functions (copy_buffer_callback). Since it will now get called from a raster thread. video_player and camera

@HidenoriMatsubayashi HidenoriMatsubayashi added bug Something isn't working plugin Topics of flutter plugins for embedded linux labels Sep 30, 2024
@HidenoriMatsubayashi HidenoriMatsubayashi linked a pull request Sep 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin Topics of flutter plugins for embedded linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants