Bug 825678

Summary: SDL::App->new() on console framebuffer segfaults
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: perl-SDLAssignee: Hans de Goede <hdegoede>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: hdegoede, perl-devel, ppisar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: perl-SDL-2.540-2.fc18.x86_64 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-04 09:58:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test case
none
Test case in C
none
Back-trace
none
Test case
none
Test case
none
Proposed fix none

Description Petr Pisar 2012-05-28 08:17:10 UTC
SDL is compiled with fbcon video back-end. When starting an SDL application (e.g. frozen-bubble), the application segfaults in the SDL library. When running under root, it segfaults in perl-SDL.

SDL-1.2.14-13.fc16.x86_64

Comment 1 Petr Pisar 2012-05-28 08:24:11 UTC
Plain SDL works under root, but one must request current framebuffer resolution. It looks like a perl-SDL is unable to cope with unsupported resolution.

Comment 2 Petr Pisar 2013-01-14 16:38:50 UTC
Created attachment 678295 [details]
Test case

Reproducer: Querying screen width directly works both with X11 and with FB. Querying via SDL::App segfaults with FB only.

Comment 3 Petr Pisar 2013-01-14 17:04:38 UTC
Created attachment 678299 [details]
Test case in C

This is equivalent program in C which works even on FB.

Comment 4 Petr Pisar 2013-01-14 17:07:41 UTC
Created attachment 678300 [details]
Back-trace

This is back-trace of segfaulting SDL::App->width(). The segfault is due to NULL pointer dereference here.

int
SurfaceW ( surface )
    SDL_Surface *surface
    CODE:
→       RETVAL = surface->w;
    OUTPUT:
        RETVAL

Something clobbers the `surface' argument. No idea how is it possible.

Comment 5 Petr Pisar 2013-01-14 17:09:33 UTC
Just noting F17 is still affected:

$ rpm -q SDL perl-SDL perl
SDL-1.2.14-16.fc17.x86_64
perl-SDL-2.2.6-6.fc17.x86_64
perl-5.14.3-220.fc17.x86_64

Comment 6 Petr Pisar 2013-01-14 17:22:23 UTC
Created attachment 678316 [details]
Test case

Corrected perl test case (wrong height argument).

Comment 7 Petr Pisar 2013-01-14 17:36:01 UTC
Created attachment 678331 [details]
Test case

Set depth explicitly to 0.

Problem is SDL::App::new() overries 0 depth to 16 which not suitable for my 32bpp FB. Then SDL_SetVideoMode() returns NULL, but SDL::App::new() stores and checks reference to NULL, which is never false.

Proposed fixes:

(1) The default SDL::App -depth should be 0, not 16.
(2) The check should be done on dereferenced value.

Comment 8 Petr Pisar 2013-01-15 16:52:03 UTC
Created attachment 678879 [details]
Proposed fix

Comment 9 Fedora End Of Life 2013-01-16 22:42:58 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 10 Petr Pisar 2013-01-17 12:01:56 UTC
Still broken in F17.

Comment 11 Fedora End Of Life 2013-07-04 05:49:50 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 12 Petr Pisar 2013-07-04 09:58:36 UTC
It does not segfault in F18 anymore. But it does not work either. I will file new bug report.