hwcomposer: Report the Wayland disconnect reason; raise RLIMIT_NOFILE - #78
Open
MichaelMKenny wants to merge 2 commits into
Open
hwcomposer: Report the Wayland disconnect reason; raise RLIMIT_NOFILE#78MichaelMKenny wants to merge 2 commits into
MichaelMKenny wants to merge 2 commits into
Conversation
The dispatch loop's abort path logged strerror(-1), discarding the actual cause of the disconnect. Capture wl_display_get_error - including the protocol error's interface, object and code when the compositor rejected a request - log it, and append it to /data/waydroid_hwc_wayland_error.txt (bind-mounted from the host on waydroid) so the reason survives the container for post-mortem debugging. This identified an EMFILE fd-exhaustion crash in the field that a bare abort backtrace could not explain.
Graphics buffers cross the Wayland socket as fd-carrying messages and every frame consumes several fds transiently, so fd pressure in the composer process translates directly into a fatal disconnect (EMFILE) that takes the whole session down. Run with the hard limit instead of the soft default to give the process the headroom the kernel already allows it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See comment at the top of #77
Summary
Two small robustness changes that came out of debugging a session-killing
composer crash (see the fence-leak PR):
Report why the Wayland connection died before aborting. The dispatch
loop's abort path logged
strerror(-1)(retis the dispatch returnvalue, not an errno), discarding the actual cause. Now it captures
wl_display_get_error()— including the protocol error's interface,object id and code when the compositor rejected a request — logs it, and
appends it to
/data/waydroid_hwc_wayland_error.txt, which on waydroidis bind-mounted from the host, so the reason survives the container for
post-mortem debugging. In the field this immediately identified an
EMFILE fd-exhaustion crash that a bare abort backtrace could not
explain.
Raise
RLIMIT_NOFILEto the hard limit. Graphics buffers cross theWayland socket as fd-carrying messages and every frame consumes several
fds transiently, so fd pressure in the composer process translates
directly into a fatal disconnect that takes the whole session down.
Running at the soft default (1024) leaves most of the kernel-allowed
headroom unused.
Testing
Verified on lineage-20 x86_64: the error file is written on session
teardown and on real crashes (EMFILE case captured in the field);
/proc/<pid>/limitsconfirms the raised limit.