libsdl-org / SDL-1.2

Simple Directmedia Layer, 1.2 branch ... ***DEPRECATED***, please use https://github.com/libsdl-org/SDL for new projects!
https://libsdl.org
GNU Lesser General Public License v2.1
98 stars 81 forks source link

DirectFB causes apps to crash. #859

Closed fifteenhex closed 2 years ago

fifteenhex commented 2 years ago

I'm still trying to work out the root cause of this but this is what I have so far:

FWIW: I know SDL1 is dead, DirectFB was basically dead too (it's recently been forked and getting some love again), the target platform can only run SDL2 with the DirectFB backend because it doesn't have a GPU to run the KMSDRM backend. I also want to run some SDL1 apps that haven't been ported... so getting the DirectFB backend working is the easiest route to having both SDL2 and SDL1 working on this machine.

sezero commented 2 years ago

The directfb backend in SDL1.2 hasn't been touched since 10 years. Do you have a patch? Does the directfb backend in SDL2 work properly?

fifteenhex commented 2 years ago

The directfb backend in SDL1.2 hasn't been touched since 10 years. Do you have a patch? Does the directfb backend in SDL2 work properly?

I don't have a patch yet. I will send something once I figure it out. Not tried SDL2 yet.

fifteenhex commented 2 years ago

Small update: SDL2 works ok. https://twitter.com/linux_chenxing/status/1492708033763635202

sezero commented 2 years ago

Is the crash a segfault? Any backtrace?

I don't have a patch yet. I will send something once I figure it out.

Would be appreciated.

fifteenhex commented 2 years ago

Is the crash a segfault? Any backtrace?

Yeah, segfault from trying to do memset() to 0x0.

sezero commented 2 years ago

Yeah, segfault from trying to do memset() to 0x0.

A backtrace ?

fifteenhex commented 2 years ago

Sorry, don't have a backtrace yet. The original system is a bit too small to install everything with debug symbols etc. So I've been getting the whole stack working on to of QEMU to chase down the issue.

Anyhow I think I might have found it, it looks like some apps want to get the memory mapped address of the framebuffer to write directly into it. With the drmkms backend for directfb that is currently unsupported and returns 0. If the app doesn't check the return value things go badly. Once I get gdb etc working I'll confirm that... potentially I can fix directfb.