Bug 372094 - "No more handles" is a confusing/wrong error message on Gtk+
Summary: "No more handles" is a confusing/wrong error message on Gtk+
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: Other Linux-GTK
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2012-02-21 05:07 EST by Mickael Istria CLA
Modified: 2022-02-28 06:02 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mickael Istria CLA 2012-02-21 05:07:08 EST
When running SWT on Linux, for exampele with DISPLAY not set or any issue with DISPLAY, and Display.createDisplay() will tell you on line 905 "No more handles".

This error is quite confusing, and as far as I know, a fail of gtk_init_check on Linux/GTK is never related to handles. So the error message is always inaccurate and confusing.
Since a "No more handle" error is generally annoying to debug, it would be convenient to add in the case this error occur some diagnostic to help in debugging (for instance, checking DISPLAY property and checking the ability to consume an X server on the specified DISPLAY). As I am not expert of Gtk, I don't know whether it is possible to get more insight on this issue when it appears. If possible, it would be convenient to have Gtk telling why it fails to init.
Comment 1 Leo Ufimtsev CLA 2018-03-19 09:44:33 EDT
(In reply to Mickael Istria from comment #0)
> When running SWT on Linux, for exampele with DISPLAY not set or any issue
> with DISPLAY, and Display.createDisplay() will tell you on line 905 "No more
> handles".
> 
> This error is quite confusing, and as far as I know, a fail of
> gtk_init_check on Linux/GTK is never related to handles. So the error
> message is always inaccurate and confusing.
> Since a "No more handle" error is generally annoying to debug, it would be
> convenient to add in the case this error occur some diagnostic to help in
> debugging (for instance, checking DISPLAY property and checking the ability
> to consume an X server on the specified DISPLAY). As I am not expert of Gtk,
> I don't know whether it is possible to get more insight on this issue when
> it appears. If possible, it would be convenient to have Gtk telling why it
> fails to init.

In what scenario do you normally run into this issue?

I noticed on Wayland this issue doesn't seem to occur when I do:
export DISPLAY=:5
./eclipse 

It'll complaint a bit, but eclipse fires up. Haven't tested on X11 yet.
Comment 2 Mickael Istria CLA 2018-03-19 09:47:08 EDT
When I open this bug a while ago, I believe the issue was that on some CI machine, I saw this message and it took me a lot of time to understand that a X server was missing.
Comment 3 Alexander Kurtakov CLA 2022-02-21 09:52:35 EST
"No more handles" is general inability to create native resource. Changing it is out of scope but it makes sense to improve in given cases when we can give better message. This should be handled in their own separate bugs with clear goals.
Comment 4 Mickael Istria CLA 2022-02-28 06:02:27 EST
I imagine the message could be different if some handle could already be created or not:
if at least 1 handle was successfully created: `Could not acquire extra system resource handle. That may mean that application got disconnected from windowing System, or that the current application is suffering from a resource handle leak and fails to dispose some handles.`
if 0 handle was successfully created: `Could not acquire any system handle. That usually means this application could not connect to the windowing system."