Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#21929 closed defect (fixed)

buildings_tools constantly creates new cursors causing XWayland to crash

Reported by: anonymous Owned by: Upliner
Priority: normal Milestone:
Component: Plugin buildings_tools Version: latest
Keywords: wayland Cc:

Description

JOSM: 18389
buildings_tools: 35916

The problem is caused by buildings_tools plugin in JOSM – it generates a new cursor for every mouse movement while over the JOSM drawing area and every new cursor causes a new open file in Wayland eventually causing it to run out of file descriptors and crash.

How to reproduce in Gnome Wayland session:

  1. Choose buildings_tools tool with "B".
  2. Move cursor over JOSM drawing area.
  3. See constant increase of open files in Gnome (Wayland): watch -n 1 -d 'ls -l /proc/`pidof gnome-shell`/fd/ | wc -l'.
  4. Choose any other tool, e. g. with "W".
  5. Move cursor over JOSM drawing area and see no open file increase.

More details about this problem on Wayland side: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1306

Problem is probably caused by something in DrawBuildingAction.java updCursor():

    private void updCursor() {
        if (!MainApplication.isDisplayingMapView())
            return;

        if (!ctrl && (mousePos != null)) {
            Node n = MainApplication.getMap().mapView.getNearestNode(mousePos, OsmPrimitive::isSelectable);
            if (n != null) {
                setCursor(cursorJoinNode);
                return;
            } else {
                Way w = MainApplication.getMap().mapView.getNearestWay(mousePos, OsmPrimitive::isSelectable);
                if (w != null && w.get("building") != null) {
                    setCursor(cursorJoinWay);
                    return;
                }
            }
        }
        if (customCursor != null && (!ctrl || isRectDrawing()))
            setCursor(customCursor);
        else
            setCursor(getCursor());

    }

I tried to follow DevelopersGuide/DevelopingPlugins to debug this, but for some reason couldn't even checkout JOSM plugins repository over SVN (svn co https://josm.openstreetmap.de/osmsvn/applications/editors/josm – nothing happens for hours) and did not find a git mirror of this repository...

Attachments (0)

Change History (4)

comment:1 by taylor.smock, 3 years ago

Depending upon when you tried to clone the JOSM plugins repository, the server may have been down. See https://lists.openstreetmap.org/pipermail/josm-dev/2022-March/008420.html .

But thank you for an explanation of the problem -- I've been meaning to debug what is happening (I've run into this at home), and I just never got around to it.

comment:2 by taylor.smock, 3 years ago

Other possible problem areas:

Last edited 3 years ago by taylor.smock (previous) (diff)

comment:3 by taylor.smock, 3 years ago

Resolution: fixed
Status: newclosed

In 35929/osm:

fix #21929: buildings_tools creating unnecessary file descriptors

This causes XWayland to crash (Java uses XWayland at this time, when run under
Wayland). buildings_tools causes this problem by constantly creating new
cursors in the EDT thread.

comment:4 by taylor.smock, 3 years ago

In 35930/osm:

buildings_tools (dist): see #21929: creating unnecessary file descriptors

This causes XWayland to crash (Java uses XWayland at this time, when run under
Wayland). buildings_tools causes this problem by constantly creating new
cursors in the EDT thread.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Upliner.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.