After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 704554 - FIX mmap fails when getting root_window
FIX mmap fails when getting root_window
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.9.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 704425 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-07-19 14:40 UTC by Thibaud Hulin
Modified: 2013-07-24 17:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Set width, height to 1 to avoid mmap fails (527 bytes, patch)
2013-07-19 14:40 UTC, Thibaud Hulin
none Details | Review
backtrace of wxWidgets sample execution (10.33 KB, text/x-log)
2013-07-24 08:24 UTC, Thibaud Hulin
  Details

Description Thibaud Hulin 2013-07-19 14:40:47 UTC
Created attachment 249635 [details] [review]
Set width, height to 1 to avoid mmap fails

Hi,

As I was trying some samples(caret and controls) of wxWidgets on Wayland, I met this error at launch:

"(controls:2962): Gdk-CRITICAL **: gdkwindow-wayland.c:578: mmap'ping temporary file failed: Invalid argument"

It comes from gdk_screen_get_root_window() which returned a GtkWindow with height and width set to 0.

But GtkWindow doc(https://developer.gnome.org/gtk3/3.5/GtkWindow.html#gtk-window-set-default-size) indicates that it should be set to 1. I did that it fixes my issue.

The patch joined corrects the bug.
Comment 1 Zeeshan Ali 2013-07-23 15:00:39 UTC
*** Bug 704425 has been marked as a duplicate of this bug. ***
Comment 2 Rob Bradford 2013-07-23 15:04:54 UTC
Under Wayland we don't have a concept of a root window. I admit the dimensions of the root window could be better - perhaps the sum of the outputs?

I'm more worried about why we're getting that warning that's indicating we're trying to create a backing buffer for the window. Can you break on that error message and generate a backtrace?
Comment 3 Rob Bradford 2013-07-23 15:15:39 UTC
I'm quite happy to make the screen have the sum of the dimensions of the monitors and make the root window those dimensions

But then the code path to create the similar window would potentially allocate a really large buffer - that seems kinda wrong.
Comment 4 Thibaud Hulin 2013-07-24 08:24:12 UTC
Created attachment 250002 [details]
backtrace of wxWidgets sample execution

As you can see, it comes from wxCairoRenderer::CreateMeasuringContext, which only do this:

{
    return CreateContextFromNativeWindow(gdk_get_default_root_window());
}
Comment 5 Rob Bradford 2013-07-24 17:34:24 UTC
commit 16e43733b96163c6365a6c04f5097722360ec5b2
Author: Rob Bradford <rob@linux.intel.com>
Date:   Wed Jul 24 18:30:19 2013 +0100

    wayland: Create a cairo surface for the root window
    
    Many parts of GTK+ assume that all windows have a cairo surface
    assoicated with them. This change provides a logically 1x1 cairo surface
    (respecting scale) for the root window.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704554