Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix restart crash #2148

Closed
wants to merge 2 commits into from
Closed

Conversation

roberthoffmann
Copy link

Do not close inotify desciptors when restarting the server. This
may lead to crashes in glib.

Fixes crash in libglib/libgio with GLib-GIO-ERROR : inotify read(): Bad file descriptor

See also src/tests/ibus-bus.c: start_exit_async():
/* When ./runtest ibus-bus runs, ibus-daemon sometimes failed to
* restart because closing a file descriptor was failed in
* bus/server.c:_restart_server() with a following error:
* "inotify read(): Bad file descriptor"

Test plan:
Run
$ ibus restart
several times. Without the patch ibus-daemon will crash occasionally.

Do not close inotify desciptors when restarting the server. This
may lead to crashes in glib.

Fixes crash in libglib/libgio with GLib-GIO-ERROR : inotify read(): Bad file descriptor

See also src/tests/ibus-bus.c: start_exit_async():
    /* When `./runtest ibus-bus` runs, ibus-daemon sometimes failed to
     * restart because closing a file descriptor was failed in
     * bus/server.c:_restart_server() with a following error:
     *     "inotify read(): Bad file descriptor"

Test plan:
Run
$ ibus restart
several times. Without the patch ibus-daemon will crash occasionally.
Copy link
Member

@fujiwarat fujiwarat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your patch.
I got some reports about inotify but I didn't know how to reproduce the issue.
I added some comments.

bus/server.c Outdated Show resolved Hide resolved
bus/server.c Outdated Show resolved Hide resolved
bus/server.c Show resolved Hide resolved
bus/server.c Outdated Show resolved Hide resolved
bus/server.c Outdated Show resolved Hide resolved
bus/server.c Outdated Show resolved Hide resolved
bus/server.c Outdated Show resolved Hide resolved
fujiwarat pushed a commit that referenced this pull request Nov 1, 2019
Do not close inotify desciptors when restarting the server. This
may lead to crashes in glib.

Fixes crash in libglib/libgio with
GLib-GIO-ERROR : inotify read(): Bad file descriptor

See also src/tests/ibus-bus.c: start_exit_async():
    /* When `./runtest ibus-bus` runs, ibus-daemon sometimes failed to
     * restart because closing a file descriptor was failed in
     * bus/server.c:_restart_server() with a following error:
     *     "inotify read(): Bad file descriptor"

Test plan:
Run
$ ibus restart
several times. Without the patch ibus-daemon will crash occasionally.

BUG=#2148
@fujiwarat fujiwarat added this to the 1.5.22 milestone Nov 1, 2019
@fujiwarat
Copy link
Member

Thank you for the patch.

@fujiwarat fujiwarat closed this Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants