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

Crash when downloading logs from element desktop #6480

Closed
HarHarLinks opened this issue Sep 4, 2021 · 11 comments
Closed

Crash when downloading logs from element desktop #6480

HarHarLinks opened this issue Sep 4, 2021 · 11 comments
Labels
bug Not working as intended

Comments

@HarHarLinks
Copy link

Please fill out the following:

#0  0x00007fec6866bd22 in raise () at /usr/lib/libc.so.6
#1  0x00007fec68655862 in abort () at /usr/lib/libc.so.6
#2  0x00007fec68655747 in _nl_load_domain.cold () at /usr/lib/libc.so.6
#3  0x00007fec68664616 in  () at /usr/lib/libc.so.6
#4  0x00007fec688a5443 in wlr_texture_from_pixels () at /usr/lib/libwlroots.so.9
#5  0x0000562fb0574885 in  ()
#6  0x0000562fb0577d0e in  ()
#7  0x0000562fb054a4c8 in  ()
#8  0x0000562fb0585abb in  ()
#9  0x00007fec688f11ee in wlr_signal_emit_safe () at /usr/lib/libwlroots.so.9
#10 0x00007fec688e9b2b in  () at /usr/lib/libwlroots.so.9
#11 0x00007fec68044acd in  () at /usr/lib/libffi.so.7
#12 0x00007fec6804403a in  () at /usr/lib/libffi.so.7
#13 0x00007fec68944124 in  () at /usr/lib/libwayland-server.so.0
#14 0x00007fec6893f57c in  () at /usr/lib/libwayland-server.so.0
#15 0x00007fec6894207a in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#16 0x00007fec6893fbe7 in wl_display_run () at /usr/lib/libwayland-server.so.0
#17 0x0000562fb053297b in  ()
#18 0x00007fec68656b25 in __libc_start_main () at /usr/lib/libc.so.6
#19 0x0000562fb0532cee in  ()
  1. main menu -> feedback
  2. submit logs
  3. download logs
@HarHarLinks HarHarLinks added the bug Not working as intended label Sep 4, 2021
@emersion
Copy link
Member

emersion commented Sep 4, 2021

Please provide a stack trace. You can do so by compiling from source, reproducing the crash and then running coredumpctl gdb and then bt full.

Here are some instructions to compile from source: https://github.com/swaywm/sway/wiki/Development-Setup#compiling-as-a-subproject

@HarHarLinks
Copy link
Author

I'm having a bit of trouble here: I cloned, built, ran as instructed, but there is no dump. I tried running sway with and without -d even though I believe that's just for logging.

$ coredumpctl gdb
           PID: 3716 (sway)
           UID: 1000 (hhl)
           GID: 1000 (hhl)
        Signal: 6 (ABRT)
     Timestamp: Sun 2021-09-05 13:17:08 CEST (1min 42s ago)
  Command Line: build/sway/sway -d
    Executable: /home/hhl/git/sway/build/sway/sway
 Control Group: /user.slice/user-1000.slice/session-5.scope
          Unit: session-5.scope
         Slice: user-1000.slice
       Session: 5
     Owner UID: 1000 (hhl)
       Boot ID: 100e7c8015404aac865e688145c8a022
    Machine ID: a1cf1427e8374546b8b0605bfca0c00f
      Hostname: ARCH-9000
       Storage: none
       Message: Process 3716 (sway) of user 1000 dumped core.

Coredump entry has no core attached (neither internally in the journal nor externally on disk).
$ coredumpctl
TIME                            PID  UID  GID SIG     COREFILE     EXE                                                                                                         SIZE
Sun 2021-09-05 13:17:08 CEST   3716 1000 1000 SIGABRT none         /home/hhl/git/sway/build/sway/sway                                                                           n/a

@Xiretza
Copy link

Xiretza commented Sep 11, 2021

Here's a backtrace:

(gdb) bt full
#0  0x00007fcded42ad22 in raise () at /usr/lib/libc.so.6
#1  0x00007fcded414862 in abort () at /usr/lib/libc.so.6
#2  0x00007fcded414747 in _nl_load_domain.cold () at /usr/lib/libc.so.6
#3  0x00007fcded423616 in  () at /usr/lib/libc.so.6
#4  0x00007fcded664557 in wlr_texture_from_pixels (renderer=<optimized out>, fmt=<optimized out>, stride=<optimized out>, width=<optimized out>, height=<optimized out>, data=<optimized out>) at ../wlroots-0.14.1/render/wlr_texture.c:29
        __PRETTY_FUNCTION__ = "wlr_texture_from_pixels"
#5  0x000055faaefaafd5 in update_title_texture (con=con@entry=0x55fab1030b10, texture=texture@entry=0x55fab1030cd8, class=<optimized out>) at ../sway-1.6.1/sway/tree/container.c:560
        output = 0x55fab0b30a10
        scale = <optimized out>
        width = 106496
        height = 32
        dummy_surface = <optimized out>
        c = <optimized out>
        fo = <optimized out>
        surface = 0x7fcdedcf9cc0
        cairo = 0x7fcdedcfcfb8
        pango = 0x55fab0d63040
        data = 0x0
        stride = 425984
        renderer = <optimized out>
#6  0x000055faaefae4d2 in container_update_title_textures (container=0x55fab1030b10) at ../sway-1.6.1/sway/tree/container.c:568
#7  0x000055faaef806f8 in container_discover_outputs (con=0x55fab1030b10) at ../sway-1.6.1/sway/tree/container.c:1284
        new_output = <optimized out>
        new_scale = <optimized out>
        con_box = {x = 357, y = 86, width = 1205, height = 921}
        old_output = 0x0
        old_scale = <optimized out>
        view = <optimized out>
        instruction = 0x7ffd7b4aa4f0
        node = <optimized out>
        i = <optimized out>
#8  apply_container_state (state=0x7ffd7b4aa500, container=<optimized out>) at ../sway-1.6.1/sway/desktop/transaction.c:286
        view = <optimized out>
        instruction = 0x7ffd7b4aa4f0
        node = <optimized out>
        i = <optimized out>
#9  transaction_apply (transaction=0x55fab10317b0) at ../sway-1.6.1/sway/desktop/transaction.c:322
        instruction = 0x7ffd7b4aa4f0
        node = <optimized out>
        i = <optimized out>
#10 transaction_progress () at ../sway-1.6.1/sway/desktop/transaction.c:342
#11 0x000055faaefbc55b in transaction_notify_view_ready_by_geometry (view=<optimized out>, view=0x55fab101ccb0, height=<optimized out>, width=<optimized out>, y=<optimized out>, x=<optimized out>) at ../sway-1.6.1/sway/desktop/transaction.c:520
        instruction = <optimized out>
        xwayland_view = 0x55fab101ccb0
        view = 0x55fab101ccb0
        xsurface = 0x55fab102f860
        state = 0x55fab1032c88
        new_size = <optimized out>
#12 handle_commit (listener=0x55fab101cdf8, data=<optimized out>) at ../sway-1.6.1/sway/desktop/xwayland.c:421
        xwayland_view = 0x55fab101ccb0
        view = 0x55fab101ccb0
        xsurface = 0x55fab102f860
        state = 0x55fab1032c88
        new_size = <optimized out>
#13 0x00007fcded6b1a6e in wlr_signal_emit_safe (signal=<optimized out>, data=0x55fab1032c20) at ../wlroots-0.14.1/util/signal.c:29
        pos = 0x55fab101cdf8
        l = 0x55fab101cdf8
        cursor = {link = {prev = 0x55fab101cdf8, next = 0x7ffd7b4aa5a0}, notify = 0x7fcded6aa330 <handle_noop>}
        end = {link = {prev = 0x7ffd7b4aa5c0, next = 0x55fab1032fa8}, notify = 0x7fcded6aa330 <handle_noop>}
#14 0x00007fcded6aa1eb in surface_commit_pending (surface=0x55fab1032c20) at ../wlroots-0.14.1/types/wlr_surface.c:489
        surface = 0x55fab1032c20
        subsurface = <optimized out>
#15 surface_commit (client=<optimized out>, resource=<optimized out>) at ../wlroots-0.14.1/types/wlr_surface.c:559
        surface = 0x55fab1032c20
        subsurface = <optimized out>
#16 0x00007fcdece01acd in  () at /usr/lib/libffi.so.7
#17 0x00007fcdece0103a in  () at /usr/lib/libffi.so.7
#18 0x00007fcded705124 in  () at /usr/lib/libwayland-server.so.0
#19 0x00007fcded70057c in  () at /usr/lib/libwayland-server.so.0
#20 0x00007fcded70307a in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#21 0x00007fcded700be7 in wl_display_run () at /usr/lib/libwayland-server.so.0
#22 0x000055faaef68980 in server_run (server=0x55faaefdd0a0 <server>) at ../sway-1.6.1/sway/server.c:254
        config_path = 0x0
        usage = 0x55faaefc0218 "Usage: sway [options] [command]\n\n  -h, --help", ' ' <repeats 13 times>, "Show help message and quit.\n  -c, --config <config>  Specify a config file.\n  -C, --validate         Check the validity of the config file, th"...
        c = <optimized out>
        long_options =
            {{name = 0x55faaefbf308 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x55faaefc3b97 "config", has_arg = 1, flag = 0x0, val = 99}, {name = 0x55faaefbf30d "validate", has_arg = 0, flag = 0x0, val = 67}, {name = 0x55faaefbf316 "debug", has_arg = 0, flag = 0x0, val = 100}, {name = 0x55faaefbeecd "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x55faaefbe8cf "verbose", has_arg = 0, flag = 0x0, val = 86}, {name = 0x55faaefbf31c "get-socketpath", has_arg = 0, flag = 0x0, val = 112}, {name = 0x55faaefbf32b "unsupported-gpu", has_arg = 0, flag = 0x0, val = 117}, {name = 0x55faaefbf33b "my-next-gpu-wont-be-nvidia", has_arg = 0, flag = 0x0, val = 117}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
        validate = 0
        debug = 1
        allow_unsupported_gpu = 0
        verbose = 0
#23 main (argc=<optimized out>, argv=0x7ffd7b4aadd8) at ../sway-1.6.1/sway/main.c:433
        config_path = 0x0
        usage = 0x55faaefc0218 "Usage: sway [options] [command]\n\n  -h, --help", ' ' <repeats 13 times>, "Show help message and quit.\n  -c, --config <config>  Specify a config file.\n  -C, --validate         Check the validity of the config file, th"...
        c = <optimized out>
        long_options = {{name = 0x55faaefbf308 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x55faaefc3b97 "config", has_arg = 1, flag = 0x0, val = 99}, {name = 0x55faaefbf30d "validate", has_arg = 0, flag = 0x0, val = 67}, {name = 0x55faaefbf316 "debug", has_arg = 0, flag = 0x0, val = 100}, {name = 0x55faaefbeecd "version", has_arg = 0, flag = 0x0, val = 118}, {name = 0x55faaefbe8cf "verbose", has_arg = 0, flag = 0x0, val = 86}, {name = 0x55faaefbf31c "get-socketpath", has_arg = 0, flag = 0x0, val = 112}, {name = 0x55faaefbf32b "unsupported-gpu", has_arg = 0, flag = 0x0, val = 117}, {name = 0x55faaefbf33b "my-next-gpu-wont-be-nvidia", has_arg = 0, flag = 0x0, val = 117}, {name = 0x0, has_arg = 0, flag = 0x0, val = 0}}
        validate = 0
        debug = 1
        allow_unsupported_gpu = 0
        verbose = 0

Arch Linux, sway 1.6.1, wlroots 0.14.1.

@Xiretza
Copy link

Xiretza commented Sep 11, 2021

I updated the comment to include wlroots debugging info (and to fix a paste fail).

@Xiretza
Copy link

Xiretza commented Sep 11, 2021

It looks like the container title is a huge 8kB string:

(gdb) p con->formatted_title
$7 = 0x55fab10337c0 "data:application/octet-stream;base64,bG9nLTAubG9n", 'A' <repeats 121 times>, "DAwMDA3NzcAMDAwMDAwMAAwMDAwMDA"...
(gdb) find /1 con->formatted_title, +10000, '\0'
0x55fab10357c0
1 pattern found.
(gdb) p (char*)$_ - con->formatted_title
$8 = 8192

@HarHarLinks
Copy link
Author

Element dumps its log(s) into a zip and handles that as a base64 string. That could be the string you mention?

@Xiretza
Copy link

Xiretza commented Sep 13, 2021

Yes, probably. Don't ask me how it ends up in a window title though.

@HarHarLinks
Copy link
Author

I want to remark that it crashes not only in Xwayland, but also wayland native (--enable-features=UseOzonePlatform --ozone-platform=wayland) electron.

@novocaine
Copy link

Yes, probably. Don't ask me how it ends up in a window title though.

The code does this

const dl = document.createElement('a');
dl.href = `data:application/octet-stream;base64,${btoa(uint8ToString(tape.out))}`;
dl.download = 'rageshake.tar';
document.body.appendChild(dl);
dl.click();
document.body.removeChild(dl);

I guess something at some point uses the .href as a window title

@Xyene
Copy link
Member

Xyene commented Oct 11, 2021

This sounds like #6531, which has a tentative fix in #6556.

@emersion
Copy link
Member

Closing as a duplicate. Please re-open if the mentioned pull request doesn't fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

5 participants