bugGlobulation 2 - Bugs: bug #21275, SIGSEGV when trying to set an...

 
 

bug #21275: SIGSEGV when trying to set an unsupported fullscreen resolution

Submitted by:  Michael Ploujnikov <plouj>
Submitted on:  Sun 07 Oct 2007 02:41:24 AM UTC  
 
Severity: 3 - NormalStatus: Fixed
Assigned to: NoneOpen/Closed: Closed
Release: NoneOperating System: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 02 Apr 2008 02:58:18 AM UTC, comment #5:

Just tested it and its fixed. Now goes back to the default 800x600 if the resolution is unsupported.

Kieran <k776>
Project Administrator
Wed 06 Feb 2008 05:20:14 AM UTC, comment #4:

I tried it in 3025:25055ad3a538 and I get this:

Toolkit : can't set screen to 4096x1024 at 32 bpp
Toolkit : No video mode large enough for 4096x1024

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912514136464 (LWP 24781)]
0x000000000060dd11 in GAGCore::DrawableSurface::convertForUpload (
this=0x9ae000, source=0xb11d30) at libgag/src/GraphicContext.cpp:227
227 if (_gc->sdlsurface->format->BitsPerPixel == 32)
(gdb) print _gc->sdlsurface
Cannot access memory at address 0x0

Michael Ploujnikov <plouj>
Wed 02 Jan 2008 09:14:49 AM UTC, comment #3:

It is fixed by revision 3004, commited on 2007-12-25.

Stephane Magnenat <nct>
Project Administrator
Wed 02 Jan 2008 01:46:16 AM UTC, comment #2:

In revision 2991:b63adbd49540 the segfault is still there:

$ ./src/glob2
Toolkit : can't set screen to 4096x1024 at 32 bpp
Toolkit : No video mode large enough for 4096x1024
Segmentation fault

I have to give you credit for making the cause of the segfault more obvious. However, I would like to note my opinion that this bug will "really" be closed when the related game code is redesigned to gracefully (without crashing or segfaulting) handle such errors in the game configuration.

Thanks, and please re-open the bug if you think that a proper fix is worth developers' time.

Anonymous
Tue 25 Dec 2007 07:16:05 PM UTC, comment #1:

The returned value of SDL_SetVideoMode was checked, but too late. I have moved it just after the call. That should fix this bug. Please test with latest mercurial tree and reopen bug if the problem still persists.

Stephane Magnenat <nct>
Project Administrator
Sun 07 Oct 2007 02:41:24 AM UTC, original submission:

$ ./src/glob2
Segmentation fault

$ gdb ./src/glob2
GNU gdb Red Hat Linux (6.6-15.fc7rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) r
Starting program: /tmp/glob2-0.9.1/src/glob2
[Thread debugging using libthread_db enabled]
[New Thread 46912498449088 (LWP 2139)]
[New Thread 1084246352 (LWP 2142)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912498449088 (LWP 2139)]
0x0000000000601c6a in GAGCore::GraphicContext::setRes (this=0x953bf0, w=2560,
h=1024, flags=19) at libgag/src/GraphicContext.cpp:1903
1903 if ((optionFlags & USEGPU) && (_gc->sdlsurface->format->BitsPerPixel != 32))
(gdb) bt full
#0 0x0000000000601c6a in GAGCore::GraphicContext::setRes (this=0x953bf0,
w=2560, h=1024, flags=19) at libgag/src/GraphicContext.cpp:1903
sdlFlags = 2415919122
#1 0x0000000000604869 in GraphicContext (this=0x953bf0, w=2560, h=1024,
flags=19) at libgag/src/GraphicContext.cpp:1851
No locals.
#2 0x0000000000633ca4 in GAGCore::Toolkit::initGraphic (w=2560, h=1024,
flags=19) at libgag/src/Toolkit.cpp:51
No locals.
#3 0x00000000004d820b in GlobalContainer::load (this=0x933110)
at src/GlobalContainer.cpp:452
_PRETTY_FUNCTION_ = "void GlobalContainer::load()"
#4 0x00000000004d3deb in Glob2::run (this=0x7fff1d19199f, argc=1,
argv=0x7fff1d191a88) at src/Glob2.cpp:257
_PRETTY_FUNCTION_ = "int Glob2::run(int, char**)"
#5 0x00000000004d4ce7 in main (argc=1, argv=0x7fff1d191a88)
at src/Glob2.cpp:502
glob2 = {static verbose = false, isRunning = false}

Looks like the return value of SDL_SetVideoMode wasn't checked.

I realized that this happened after I switched from using two monitors giving me a 2560x1024 X screen to a single monitor giving me 1280x1024 X screen. However, ~/.glob2/preferences.txt still said this:

$ grep screen ~/.glob2/preferences.txt
screenWidth=2560
screenHeight=1024
screenFlags=19

This doesn't seem to be a problem in windowed mode since the game just creates a huge window.

$ ./src/glob2 --version

Globulation 2 - 0.9.1
...

The game was compiled from http://dl.sv.nongnu.org/releases/glob2/0.9.1/glob2-0.9.1.tar.gz on Fedora 7.

Michael Ploujnikov <plouj>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by genixpro (Updated the item)
  • -unavailable- added by k776 (Updated the item)
  • -unavailable- added by nct (Posted a comment)
  • -unavailable- added by plouj (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 02 Apr 2008 02:58:18 AM UTCk776StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Wed 02 Apr 2008 02:15:46 AM UTCgenixproStatusNone=>Ready For Test
    Wed 06 Feb 2008 05:20:31 AM UTCk776StatusFixed=>None
      Open/ClosedClosed=>Open
    Tue 25 Dec 2007 07:16:05 PM UTCnctStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1