On Thursday 09 April 2009 10:25:29 Gonéri Le Bouder wrote:
> On Thu, Apr 09, 2009 at 09:59:19AM -0500, Raphael Geissert wrote:
> Works fine here:
[...]
> I've the 
> feeling the problem come from your libgl1-mesa-glx from experimental. Can
> you please upgrade your sysetem.
>

Did that a couple of days ago, no difference.

> > I tried to get the debug symbols of the package from debug.d.n but it
> > they are not available for i386.
>
> It's probably because I built the package on my own machin. Is there
> anything I can do to avoid that?

No, it is unrelated to whether you built the package or a buildd did. I've 
already pinged the right person for that.

I rebuilt the package with DEB_BUILD_OPTIONS=nostrip and got a better 
backtrace:
(gdb) bt
#0  0xb7f06756 in glViewport () from /usr/lib/libGL.so.1
#1  0x0804d348 in window::OpenWindow (this=0x807c820, w=1024, h=768, b=32, 
flags=-2147483646)
    at src/window.cpp:59
#2  0x0804ab95 in main (argc=1, argv=Cannot access memory at address 0x5
) at src/main.cpp:211


By the way, like I mentioned to Barry via IRC, the package doesn't have an 
un/patch target and doesn't respect the debug and noopt DEB_BUILD_OPTIONS 
options; you should fix that.


One of the obvious errors on the code is that while SDL_SetVideoMode takes a 
Uint32 for the flags, the code passes an integer which, as soon as 
SDL_FULLSCREEN is added, is overflowed, turning into a negative integer.
Attached is the fix for that bug.

While this doesn't fix the segfault it is one bug less (although I expect 
many, similar, bugs to be there on the code). What did help get the game's 
screen was commenting out the SDL_FULLSCREEN-related line in main.cpp; 
although after a few seconds the screen got corrupted and had to SIGTERM it.

This is the backtrace from the code with the attached patch applied:

(gdb) bt
#0  0xb7e13756 in glViewport () from /usr/lib/libGL.so.1
#1  0x0804d348 in window::OpenWindow (this=0x807c820, w=1024, h=768, b=32, 
flags=2147483650) at src/window.cpp:59
#2  0x0804ab95 in main (argc=1, argv=Cannot access memory at address 0x5
) at src/main.cpp:211

Cheers,
-- 
Raphael Geissert - Debian Maintainer
www.debian.org - get.debian.net
Index: bloboats-1.0.1.dsfg/src/window.cpp
===================================================================
--- bloboats-1.0.1.dsfg.orig/src/window.cpp
+++ bloboats-1.0.1.dsfg/src/window.cpp
@@ -36,7 +36,7 @@ window::~window(){}
 
 
 
-SDL_Surface * window::OpenWindow(int w, int h, int b, int flags) {
+SDL_Surface * window::OpenWindow(int w, int h, int b, Uint32 flags) {
 	if (!flags) {
 		flags = oldflags^SDL_FULLSCREEN;
 	}
Index: bloboats-1.0.1.dsfg/src/window.h
===================================================================
--- bloboats-1.0.1.dsfg.orig/src/window.h
+++ bloboats-1.0.1.dsfg/src/window.h
@@ -31,7 +31,7 @@ class window
 		window();
 		~window();
 
-		SDL_Surface * OpenWindow(int width, int height, int bpp, int flags);
+		SDL_Surface * OpenWindow(int width, int height, int bpp, Uint32 flags);
 		void SetTitle(char *text, char *icon);
 		bool Iconify();
 
@@ -52,7 +52,7 @@ class window
 
 		int xlast, ylast;
 
-		int oldflags;
+		Uint32 oldflags;
 
 	private:
 		SDL_Surface *screen;

Reply via email to