Skip to content

Segfault when config file is missing #8583

Open
@sertonix

Description

Please read the following before submitting:

  • Please do NOT submit bug reports for questions. Ask questions on IRC at #sway on Libera Chat.
  • Proprietary graphics drivers, including nvidia, are not supported. Please use the open source equivalents, such as nouveau, if you would like to use Sway.
  • Please do NOT submit issues for information from the github wiki. The github wiki is community maintained and therefore may contain outdated information, scripts that don't work or obsolete workarounds.
    If you fix a script or find outdated information, don't hesitate to adjust the wiki page.

Please fill out the following:

00:00:00.051 [wlr] [backend/headless/backend.c:60] Creating headless backend
00:00:00.051 [sway/config.c:460] missing not found
00:00:00.051 [sway/main.c:377] Shutting down sway
Segmentation fault
  • Configuration File: It's missing...

  • Stack Trace:

(gdb) bt full
#0  0x000055555557840c in handle_seat_destroy (listener=0x7fffe81dca18, data=0x7fffe80e93d0) at ../sway/input/seat.c:76
        seat = 0x7fffe81dc7f0
        seat_device = <optimized out>
        next = <optimized out>
        seat_node = <optimized out>
        next_seat_node = <optimized out>
#1  0x00007ffff79dd827 in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
#2  0x00007ffff7ee4400 in wlr_seat_destroy (seat=0x7fffe80e93d0) at ../subprojects/wlroots/types/seat/wlr_seat.c:231
        point = <optimized out>
        client = <optimized out>
        tmp = <optimized out>
        point = <optimized out>
        __func__ = {<optimized out> <repeats 17 times>}
        client = <optimized out>
        tmp = <optimized out>
#3  wlr_seat_destroy (seat=0x7fffe80e93d0) at ../subprojects/wlroots/types/seat/wlr_seat.c:216
        point = <optimized out>
        client = <optimized out>
        tmp = <optimized out>
        __func__ = "wlr_seat_destroy"
#4  0x00007ffff79deac3 in ??? () at /usr/lib/libwayland-server.so.0
#5  0x00007ffff79df2da in wl_display_destroy () at /usr/lib/libwayland-server.so.0
#6  0x0000555555563cee in server_fini (server=0x5555555c0160 <server>) at ../sway/server.c:489
#7  main (argc=<optimized out>, argv=<optimized out>) at ../sway/main.c:379
        config_path = 0x7ffff78703c0 "missing"
        c = <optimized out>
        validate = false
        debug = false
        verbose = false
  • Description:

Just running sway --config missing (when missing doesn't exit) is enough to trigger the segfault.

In handle_seat_destroy config is dereferenced but config is NULL when the config file couldn't be found.

if (seat == config->handler_context.seat) {

config is only initialized later in the code:
config = calloc(1, sizeof(struct sway_config));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugNot working as intended

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions