Bug 2401791 - SDL3-0:3.2.24-1.fc44 breaks perl-SDL: t/core.t:69: SDL::get_error() stopped reporting errors
Summary: SDL3-0:3.2.24-1.fc44 breaks perl-SDL: t/core.t:69: SDL::get_error() stopped r...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-SDL
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-10-06 08:09 UTC by Petr Pisar
Modified: 2026-09-30 01:10 UTC (History)
8 users (show)

Fixed In Version: perl-SDL-2.548-31.fc44 perl-SDL-2.548-33.fc43
Clone Of:
Environment:
Last Closed: 2025-10-09 13:38:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
test code with debugging for all four cases (1.89 KB, text/x-csrc)
2025-10-06 16:28 UTC, Tom "spot" Callaway
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github PerlGameDev SDL pull 311 0 None open Adapt to SDL 3.2.24 2025-10-07 12:33:25 UTC

Description Petr Pisar 2025-10-06 08:09:18 UTC
SDL3-0:3.2.24-1.fc44 breaks perl-SDL-2.548-30.fc44 tests:


#   Failed test '[get_error] got error '
#   at t/core.t line 69.
#          got: ''
#     expected: anything else
# Looks like you failed 1 test of 28.
t/core.t ........................ Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/28 subtests 
        (3 TODO tests unexpectedly succeeded)
[...]

E.g. the t/core.t:69 attempts to set an obviously unsupported video mode of 232 bits-per-pixel depth: 

my $display = SDL::Video::set_video_mode( 640, 480, 232, SDL_ANYFORMAT );

and that checks that an error was reported by SDL:

isnt( SDL::get_error(), '', '[get_error] got error ' . SDL::get_error() );

This error test fails with SDL3 3.2.24. It passes with 
SDL3-0:3.2.20-1.fc43.x86_64.

Comment 1 Petr Pisar 2025-10-06 11:03:20 UTC
I bisected the regression to this SDL3 commit:

commit 5594d03da086ab255b1d7ace1496f3a0c109a83d (HEAD)
Author: Sam Lantinga <slouken>
Date:   Tue Sep 2 20:11:00 2025 -0700

    Leave letterbox borders set to the frame clear color
    
    Fixes https://github.com/libsdl-org/sdl2-compat/issues/483
    
    (cherry picked from commit fbbc29159a25f26d789694a74c2d1d3216dfb49d)


The Perl reproducer is:

$ cat t/test.t 
#!/usr/bin/perl -w
use SDL;
use SDL::Video;
use Test::More tests => 1;
$ENV{SDL_VIDEODRIVER} = 'dummy';
my $display = SDL::Video::set_video_mode( 640, 480, 232, SDL_ANYFORMAT );
isnt( SDL::get_error(), '', '[get_error] got error ' . SDL::get_error() );

$ LD_LIBRARY_PATH=/tmp/SDL/redhat-linux-build perl -Iblib/{lib,arch} t/test.t 
1..1
not ok 1 - [get_error] got error 
#   Failed test '[get_error] got error '
#   at t/test.t line 7.
#          got: ''
#     expected: anything else
# Looks like you failed 1 test of 1.

Comment 2 Tom "spot" Callaway 2025-10-06 16:10:58 UTC
It has been a while since I've looked at perl-SDL, but it looks like it it's using the SDL 1.2 compatibility layer and not SDL2 or SDL3, which is fine, but makes this ... trickier for me to reproduce in C code?

I tried this reproducer case:

*****

#include <SDL.h>

int main(int argc, char* argv[]) {
   SDL_Surface* screen;

   SDL_Init(SDL_INIT_EVERYTHING);

   // This should work
   screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);

   // This should fail
   // screen = SDL_SetVideoMode(640, 480, 232, SDL_SWSURFACE);

   if (!screen) {
        printf("the mode could not be set\n");
        SDL_Quit();
        return 1;
   }

   // Flip the screen to make the surface visible (essential for SDL 1.2)
   SDL_Flip(screen);

   // Wait for 2 seconds before quitting
   SDL_Delay(2000);
   
   // Clean up SDL resources and exit
   SDL_Quit();
   return 0;
}

*****

I _think_ that's doing the same thing roughly as the perl-SDL testcode, but it fails when it is supposed to (comment out the first case, uncomment the second). A bit stumped.

Comment 3 Tom "spot" Callaway 2025-10-06 16:12:30 UTC
And of course, when I type it in, I see my mistake. :P I'm using SDL_SWSURFACE, not SDL_ANYFORMAT. Switching to that and I can reproduce.

Comment 4 Tom "spot" Callaway 2025-10-06 16:25:01 UTC
Okay, now I'm back to being confused (a fairly normal state for me). I downgraded to SDL3 3.2.20 to test things, but I get the same behavior there as I do on 3.2.24:

SDL_SetVideoMode(640, 480, 32, SDL_ANYFORMAT); <= works
SDL_SetVideoMode(640, 480, 232, SDL_ANYFORMAT); <= works
SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE); <= works
SDL_SetVideoMode(640, 480, 232, SDL_SWSURFACE); <= fails

Comment 5 Tom "spot" Callaway 2025-10-06 16:28:46 UTC
Created attachment 2108855 [details]
test code with debugging for all four cases

gcc -I/usr/include/SDL -o SDL-example SDL-example.c -lSDL-1.2

Comment 6 Petr Pisar 2025-10-07 11:54:28 UTC
For me SDL_SetVideoMode() passes with both SDL3 versions, but SDL_GetError() stopped reporting the error. My reproducer:

#include <SDL.h>

int main(int argc, char* argv[]) {
    SDL_Surface *screen;
    char *error;

    if (SDL_Init(SDL_INIT_VIDEO)) {
       printf("SDL_Init() failed\n");
       return 1;
    }

    screen = SDL_SetVideoMode(640, 480, 232, SDL_ANYFORMAT);
    if (!screen) {
        printf("SDL_SetVideoMode() failed\n");
        SDL_Quit();
        return 1;
    }

    error = SDL_GetError();
    if (error)
       printf("Last error = %s\n", error);
    else
       printf("SDL_GetError() did not return any error\n");

    SDL_Quit();
    return 0;
}

Old behavior:


$ SDL_VIDEODRIVER=dummy ./a.out; echo $?
Last error = rect has a negative size
0

New behavior:

$ SDL_VIDEODRIVER=dummy ./a.out; echo $?
Last error = 
0

The new behavior is at least consistent. But I worry that it actually returns a buggy SDL_Surface. Inspecting its details shows, in both versions:

w=640 h=480 bpp=32

I don't know whether SDL_SetVideoMode() always (since SDL 1.2) succeeded and only signalled an error with SDL_GetError().
It's quite possible that the perl-SDL test wanted to test SDL::get_error(), and SDL::Video::set_video_mode(640, 480, 232, SDL_ANYFORMAT) was only a tool for it. Then I could change the test to use call SDL::Video::set_video_mode(-1, ...).

Comment 7 Petr Pisar 2025-10-07 12:14:15 UTC
(In reply to Petr Pisar from comment #6)
> It's quite possible that the perl-SDL test wanted to test SDL::get_error(),
> and SDL::Video::set_video_mode(640, 480, 232, SDL_ANYFORMAT) was only a tool
> for it. Then I could change the test to use call
> SDL::Video::set_video_mode(-1, ...).

I could not find anything helpful in the perl-SDL history. Then judging from the current test, the test is based on wrong assumptions and I will correct it.

Comment 8 Fedora Update System 2026-09-17 12:11:35 UTC
FEDORA-2026-5f81f7180c (perl-SDL-2.548-33.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-5f81f7180c

Comment 9 Fedora Update System 2026-09-18 01:33:19 UTC
FEDORA-2026-5f81f7180c has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-5f81f7180c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-5f81f7180c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2026-09-30 01:10:42 UTC
FEDORA-2026-5f81f7180c (perl-SDL-2.548-33.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.


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