Bug 825678 - SDL::App->new() on console framebuffer segfaults
SDL::App->new() on console framebuffer segfaults
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: perl-SDL (Show other bugs)
17
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Hans de Goede
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-28 04:17 EDT by Petr Pisar
Modified: 2014-06-17 03:42 EDT (History)
3 users (show)

See Also:
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 05:58:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test case (781 bytes, text/plain)
2013-01-14 11:38 EST, Petr Pisar
no flags Details
Test case in C (788 bytes, text/plain)
2013-01-14 12:04 EST, Petr Pisar
no flags Details
Back-trace (4.86 KB, text/plain)
2013-01-14 12:07 EST, Petr Pisar
no flags Details
Test case (781 bytes, text/plain)
2013-01-14 12:22 EST, Petr Pisar
no flags Details
Test case (806 bytes, text/plain)
2013-01-14 12:36 EST, Petr Pisar
no flags Details
Proposed fix (1.20 KB, patch)
2013-01-15 11:52 EST, Petr Pisar
no flags Details | Diff

  None (edit)
Description Petr Pisar 2012-05-28 04:17:10 EDT
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 04:24:11 EDT
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 11:38:50 EST
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 12:04:38 EST
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 12:07:41 EST
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 12:09:33 EST
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 12:22:23 EST
Created attachment 678316 [details]
Test case

Corrected perl test case (wrong height argument).
Comment 7 Petr Pisar 2013-01-14 12:36:01 EST
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 11:52:03 EST
Created attachment 678879 [details]
Proposed fix
Comment 9 Fedora End Of Life 2013-01-16 17:42:58 EST
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 07:01:56 EST
Still broken in F17.
Comment 11 Fedora End Of Life 2013-07-04 01:49:50 EDT
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 05:58:36 EDT
It does not segfault in F18 anymore. But it does not work either. I will file new bug report.

Note You need to log in before you can comment on or make changes to this bug.