Hello list,

I experience a crash when calling the first drawing function, after a call to 
Flip() with a double buffered primary surface.

The test code is this: (it is a little modification to the tutorial at 
http://www.directfb.org/docs/DirectFB_Tutorials/simple.html ):
----------
#include <stdio.h>
#include <unistd.h>    
#include <directfb.h>    
static IDirectFB *dfb = NULL;      // This is the super interface, it's the 
entry point to all functionality.
static IDirectFBSurface *primary = NULL;   // The primary surface, i.e. the 
"screen".
             // In cooperative level DFSCL_FULLSCREEN it's the surface of the 
primary layer.

static int screen_width  = 0;      // Store the width and height of the primary 
surface here to support all resolutions.
static int screen_height = 0;

// An error checking macro for a call to DirectFB.
// It is suitable for very simple apllications or tutorials.
// In more sophisticated applications this general error checking should not be 
used.
#define DFBCHECK(x...) {          \
 DFBResult err = x;           \
 if (err != DFB_OK) {          \
  fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
  DirectFBErrorFatal( #x, err );       \
 }               \
}

int main (int argc, char **argv) {
 DFBSurfaceDescription dsc;           // A surface description is needed to 
create a surface.
 DFBCHECK(DirectFBInit (&argc, &argv));        // Initialize DirectFB passing 
argc and argv
                  // to support the standard DirectFB command line options.
                  // DirectFB command line options will be stripped out 
automatically.

 DFBCHECK(DirectFBCreate (&dfb));         // Create the super interface.
 DFBCHECK(dfb->SetCooperativeLevel(dfb, DFSCL_FULLSCREEN));   // We want to go 
fullscreen,
                  // the primary surface will be exclusive access to the 
surface of the primary layer.
                  // If you disable this call a window will be created 
implicitly,
                  // no further changes needed, flipping the surface updates 
the window.

 dsc.flags = DSDESC_CAPS;           // Specify which fields of the struct are 
set.
 dsc.caps  = DSCAPS_PRIMARY | DSCAPS_FLIPPING;      // Fill out fields, in this 
example we want to have a flippable primary surface.

 DFBCHECK(dfb->CreateSurface( dfb, &dsc, &primary ));    // Create the primary 
surface by passing our surface description.
 DFBCHECK(primary->GetSize (primary, &screen_width, &screen_height)); // We 
have exclusive access to the primary layer's surface now,
                   // get the width and height of the surface, i.e. the screen 
resolution.

 unsigned int y=0;

while (1) {
 DFBCHECK (primary->SetColor (primary, 0x00, 0x00, 0x00, 0xff));
 DFBCHECK(primary->FillRectangle (primary, 0, 0, screen_width, screen_height)); 
// Clear the screen by filling a rectangle with the size of the surface.
                     // Default color is black, default drawing flags are 
DSDRAW_NOFX.

 DFBCHECK (primary->SetColor (primary, 0x80, 0x80, 0xff, 0xff));     // Current 
color is black, so we have to set another one before.
 DFBCHECK (primary->DrawLine (primary,
        0, y,
        screen_width - 1, y)
        );             // Draw a horizontal line in the middle of the screen.

 DFBCHECK (primary->Flip (primary, NULL, 0));         // Now flip the whole 
surface to make things visible.
 sleep (5);                  // Wait a bit to see the result before exiting the 
example application.

 y++;
 if (y >= screen_height)
  y=0;
}

 // Cleanup in a stack like style.
 primary->Release( primary );
 dfb->Release( dfb );

 return 23;
}
----------

The full output of the program is:
----------
root@deb-n2800:/mnt/directfb_test# ./directfb_test_mod

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.2.10 |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2001-2008  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2012-05-20 13:17)
(*) Direct/Thread: Started 'VT Switcher' (-1) [CRITICAL OTHER/OTHER 0/0] 
<8388608>...
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: DELL DELL USB Keyboard (1) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: HID 413c:3010 (2) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: Power Button (3) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: Sleep Button (4) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: Power Button (5) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: HDA Digital PCBeep (6) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: HDA Intel Rear Mic (7) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: HDA Intel Line Out (8) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: HDA Intel HDMI/DP,pcm=3 (9) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: PC Speaker (10) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: Video Bus (11) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Keyboard Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: Keyboard 0.9 (directfb.org)
(*) Direct/Thread: Started 'PS/2 Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: IMPS/2 Mouse (1) 1.0 (directfb.org)
(*) Direct/Thread: Started 'PS/2 Input' (-1) [INPUT OTHER/OTHER 0/0] 
<8388608>...
(*) DirectFB/Input: IMPS/2 Mouse (2) 1.0 (directfb.org)
(*) DirectFB/Genefx: MMX detected and enabled
(*) DirectFB/Graphics: MMX Software Rasterizer 0.6 (directfb.org)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(*) FBDev/Surface: Allocated 1280x1024 32 bit RGB32 buffer (index 0) at offset 
0 and pitch 6144.
(*) FBDev/Surface: Allocated 1280x1024 32 bit RGB32 buffer (index 0) at offset 
0 and pitch 6144.
(*) FBDev/Mode: Setting 1280x1024 RGB32
(*) FBDev/Mode: Switched to 1280x1024 (virtual 1280x2048) at 32 bit (RGB32), 
pitch 6144
 (!!!)  *** WARNING [unable to adjust heap offset] *** 
[../../../systems/fbdev/surfacemanager.c:167 in 
dfb_surfacemanager_adjust_heap_offset()]
(*) FBDev/Surface: Allocated 1280x1024 32 bit RGB32 buffer (index 1) at offset 
6291456 and pitch 6144.
(!) [ 2428:    0.000] --> Caught signal 11 (at 0xb6d29000, invalid permissions) 
<--
 (!!!)  *** WARNING [still objects in 'Layer Region Pool'] *** 
[../../../lib/fusion/object.c:241 in fusion_object_pool_destroy()]
 (!!!)  *** WARNING [still objects in 'Layer Context Pool'] *** 
[../../../lib/fusion/object.c:241 in fusion_object_pool_destroy()]
 (!!!)  *** WARNING [still objects in 'Surface Pool'] *** 
[../../../lib/fusion/object.c:241 in fusion_object_pool_destroy()]
Annullato
----------

This is on Debian Wheezy i386, on Atom N2800, kernel 3.8 from Debian 
Experimental
DirectFB is version 1.2.10 from Debian: 
http://packages.debian.org/wheezy/libdirectfb-1.2-9
I can reproduce the same behavior with Debian Squeeze i386, on Atom N270+intel 
945GSE
and on Debian Squeeze amd64, on Core 2 Quad Q9300+GeForce 6200LE

How can I fix this?


Thanks,

Diego Guella
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to