waddlesplash / xlibe

An Xlib compatibility layer implemented on top of the Haiku API, in order to run X11 applications on Haiku without an X server.
MIT License
92 stars 3 forks source link

qemu 6 & 7.1 crash at qemu_xkeymap_mapping_table(), (built with gtk) #13

Closed khallebal closed 1 year ago

khallebal commented 2 years ago

From what i have understood of the trace is that qemu searchs for a (X)server X11;quartz,win32 or broadway and doesn't find any? is this a good assumption? Anyway the trace report is include.

    thread 1200: pthread func 
    thread 1201: pthread func 
    thread 1202: Xlibe BApplication 
    thread 1206: team 1199 debug task 
    thread 1199: qemu-system-x86_64 (main)
        state: Exception (Segment violation)

        Frame       IP          Function Name
        -----------------------------------------------
        0x7f99997ad040  0x1f33b2784c9   qemu_xkeymap_mapping_table(Display*, size_t*) + 0x5e (../ui/x_keymap.c:-1)
            Disassembly:
                qemu_xkeymap_mapping_table(Display*, size_t*):
                0x000001f33b27846b:               55  push %rbp
                0x000001f33b27846c:           4889e5  mov %rsp, %rbp
                0x000001f33b27846f:         4883ec30  sub $0x30, %rsp
                0x000001f33b278473:         48897dd8  mov %rdi, -0x28(%rbp)
                0x000001f33b278477:         488975d0  mov %rsi, -0x30(%rbp)
                0x000001f33b27847b: 48c745e800000000  mov $0x0, -0x18(%rbp)
                0x000001f33b278483:         488b45d8  mov -0x28(%rbp), %rax
                0x000001f33b278487:       ba00010000  mov $0x100, %edx
                0x000001f33b27848c:       beff000000  mov $0xff, %esi
                0x000001f33b278491:           4889c7  mov %rax, %rdi
                0x000001f33b278494:       e8877cd3ff  call 0x1f33afb0120
                0x000001f33b278499:         488945f8  mov %rax, -0x8(%rbp)
                0x000001f33b27849d:       48837df800  cmp $0x0, -0x8(%rbp)
                0x000001f33b2784a2:     0f8480000000  jz 0x1f33b278528
                0x000001f33b2784a8:         488b55f8  mov -0x8(%rbp), %rdx
                0x000001f33b2784ac:         488b45d8  mov -0x28(%rbp), %rax
                0x000001f33b2784b0:       be01000000  mov $0x1, %esi
                0x000001f33b2784b5:           4889c7  mov %rax, %rdi
                0x000001f33b2784b8:       e8636dd3ff  call 0x1f33afaf220
                0x000001f33b2784bd:             85c0  test %eax, %eax
                0x000001f33b2784bf:             7551  jnz 0x3b278512
                0x000001f33b2784c1:         488b45f8  mov -0x8(%rbp), %rax
                0x000001f33b2784c5:         488b4030  mov 0x30(%rax), %rax
                0x000001f33b2784c9:           488b10  mov (%rax), %rdx <--

            Frame memory:
                [0x7f99997ad000]  ...<............   f8 8b 05 3c f3 01 00 00 a0 c9 f0 86 92 11 00 00
                [0x7f99997ad010]  0.z.............   30 d0 7a 99 99 7f 00 00 00 00 00 00 00 00 00 00
                [0x7f99997ad020]  .%..............   10 25 ee 86 92 11 00 00 90 92 fd 86 92 11 00 00
                [0x7f99997ad030]  p.z......F';....   70 d0 7a 99 99 7f 00 00 07 46 27 3b f3 01 00 00
            Variables:
            dpy: 0x119286f0c9a0 {
                ext_data: 0
                free_funcs: 0x119286ea3ee0
                fd: 11
                conn_checker: 12
                proto_major_version: 11
                proto_minor_version: 4
                vendor: Xlibe
                resource_base: 0
                resource_mask: 0
                resource_id: 0
                resource_shift: 0
                resource_alloc: 0
                byte_order: 0
                bitmap_unit: 0
                bitmap_pad: 0
                bitmap_bit_order: 0
                nformats: 0
                pixmap_format: 0
                vnumber: 0
                release: 0
                head: 0
                tail: 0
                qlen: 3
                last_request_read: 3
                request: 4
                last_req: Invalid Argument
                buffer: Invalid Argument
                bufptr: Invalid Argument
                bufmax: Invalid Argument
                max_request_size: 4096
                db: 0
                synchandler: 0
                display_name: Xlibe
                default_screen: 0
                nscreens: 1
                screens: 0xc9d7cb0600
                motion_buffer: 0
                flags: 0
                min_keycode: 8
                max_keycode: 255
                keysyms: 0
                modifiermap: 0
                keysyms_per_keycode: 0
                xdefaults: Invalid Argument
                scratch_buffer: Invalid Argument
                scratch_length: 0
                ext_number: 0
                ext_procs: 0
                event_vec: Unavailable
                wire_vec: Unavailable
                lock_meaning: 0
                lock: 0
                async_handlers: 0
                bigreq_size: 4096
                lock_fns: 0
                idlist_alloc: 0
                key_bindings: 0
                cursor_font: 0
                atoms: 0
                mode_switch: 0
                num_lock: 0
                context_db: 0
                error_vec: 0
                im_filters: 0
                qfree: 0
                next_event_serial_num: 0
                flushes: 0
                im_fd_info: 0
                im_fd_length: 0
                conn_watchers: 0
                watcher_count: 0
                filedes: Invalid Argument
                savedsynchandler: 0
                resource_max: 0
                xcmisc_opcode: 0
                xkb_info: 0
                trans_conn: 0x119286ea3e80
                xcb: 0
                next_cookie: 0
                generic_event_vec: Unavailable
                generic_event_copy_vec: Unavailable
                cookiejar: 0
            }
            maplen: 0x1f33c058bf8 {
                *maplen: 0
            }
            desc: 0x119286fd9290 {
                dpy: 0
                flags: 0
                device_spec: 256
                min_key_code: 1
                max_key_code: 0
                ctrls: 0
                server: 0
                map: 0
                indicators: 0
                names: 0
                compat: 0
                geom: 0
            }
            keycodes: Invalid Argument
            map: 0x119286ee2510 {
                *map: 39232
            }

        0x7f99997ad080  0x1f33b274602   gd_get_keymap(size_t*) + 0xa0 (../ui/gtk.c:45)
            Variables:
            maplen: 0x1f33c058bf8 {
                *maplen: 0
            }
            dpy: 0x119286fc3010 {
                parent_instance
                queued_events: 0
                queued_tail: 0
                multiple_click_info: 0x119286ed50c0
                event_pause_count: 0
                closed: No such file or directory
                touch_implicit_grabs: 0x119286c01af0
                device_grabs: 0x119286ed51e0
                motion_hint_info: 0x119286ed5240
                device_manager: 0x119286c01b50
                input_devices: 0
                pointers_info: 0x119286ed52a0
                last_event_time: 0
                double_click_time: 250
                double_click_distance: 5
                has_gl_extension_texture_non_power_of_two: No such file or directory
                has_gl_extension_texture_rectangle: No such file or directory
                debug_updates: No such file or directory
                debug_updates_set: No such file or directory
                rendering_mode: GDK_RENDERING_MODE_SIMILAR
                seats: 0x119286dadd20
            }

        0x7f99997ad0b0  0x1f33b2777bc   early_gtk_display_init(DisplayOptions*) + 0xaf (../ui/gtk.c:47)
            Variables:
            opts: 0x1f33c057a40 {
                type: DISPLAY_TYPE_GTK
                has_full_screen: false
                full_screen: false
                has_window_close: false
                window_close: false
                has_show_cursor: false
                show_cursor: false
                has_gl: false
                gl: DISPLAYGL_MODE_OFF
            }
            __PRETTY_FUNCTION__: early_gtk_display_init

        0x7f99997ad0d0  0x1f33afbc52c   qemu_display_early_init(DisplayOptions*) + 0x13e (../ui/console.c:79)
            Variables:
            opts: 0x1f33c057a40 {
                type: DISPLAY_TYPE_GTK
                has_full_screen: false
                full_screen: false
                has_window_close: false
                window_close: false
                has_show_cursor: false
                show_cursor: false
                has_gl: false
                gl: DISPLAYGL_MODE_OFF
            }
            __PRETTY_FUNCTION__: qemu_display_early_init

        0x7f99997ad0f0  0x1f33b20ba19   qemu_create_early_backends(void) + 0x70 (../softmmu/vl.c:31)
            Variables:
            machine_class: 0x119286d79360 {
                family: pc_piix
                name: pc-i440fx-7.1
                alias: pc
                desc: Standard PC (i440FX + PIIX, 1996)
                deprecation_reason: Invalid Argument
                init: 0x1f33b2a7562
                reset: 0x1f33b2c4b00
                wakeup: 0x1f33b2c4ba4
                kvm_type: 0
                block_default_type: IF_IDE
                units_per_default_bus: 0
                max_cpus: 255
                min_cpus: 1
                default_cpus: 1
                no_serial: 0
                no_parallel: 0
                no_floppy: 0
                no_cdrom: 0
                no_sdcard: 0
                pci_allow_0_address: 0
                legacy_fw_cfg_order: 0
                is_default: true
                default_machine_opts: firmware=bios-256k.bin
                default_boot_order: cad
                default_display: std
                compat_props: 0x119286c867a0
                hw_version: Invalid Argument
                default_ram_size: 134217728
                default_cpu_type: qemu64-x86_64-cpu
                default_kernel_irqchip_split: false
                option_rom_has_mr: false
                rom_file_has_mr: true
                minimum_page_bits: 0
                has_hotpluggable_cpus: true
                ignore_memory_transaction_failures: false
                numa_mem_align_shift: 23
                valid_cpu_types: 0
                auto_enable_numa_with_memhp: true
                auto_enable_numa_with_memdev: true
                ignore_boot_device_suffixes: false
                smbus_no_migration_support: false
                nvdimm_supported: true
                numa_mem_supported: false
                auto_enable_numa: false
                smp_props
                default_ram_id: pc.ram
                get_hotplug_handler: 0x1f33b2c420f
                hotplug_allowed: 0x1f33b2c4bc9
                cpu_index_to_instance_props: 0x1f33b29b9aa
                possible_cpu_arch_ids: 0x1f33b29bb80
                get_default_cpu_node_id: 0x1f33b29ba98
                fixup_ram_size: 0
            }
            use_sdl: false
            use_gtk: true

        0x7f99997ad280  0x1f33b20fdf7   qemu_init(int, char**, char**) + 0x266c (../softmmu/vl.c:-1)
            Variables:
            argc: 1
            argv: 0x7f99997ae648 {
                *argv: ./qemu-system-x86_64
            }
            envp: 0 {
                *envp: Invalid Argument
            }
            opts: 0x36fca805c0 {
                id: Bad address
                list: 0x62696c2f6d657473
                loc
            }
            icount_opts: 0 {
                id: Invalid Argument
                list: Bad address
                loc
            }
            accel_opts: 0 {
                id: Invalid Argument
                list: Bad address
                loc
            }
            olist: 0x36fca80c90 {
                name: Bad address
                implied_opt_name: Bad address
                merge_lists: true
                desc: Unavailable
            }
            optind: 1
            optarg: /boot/system/lib/libpcre2-8.so.0.10.4
            machine_class: 0xca766d5ad0 {
                family: Invalid Argument
                name: Invalid Argument
                alias: `r
                desc:  
                deprecation_reason: Bad address
                init: 0
                reset: 0x4300000000
                wakeup: 0
                kvm_type: 0
                block_default_type: IF_NONE
                units_per_default_bus: 0
                max_cpus: 871673872
                min_cpus: 10
                default_cpus: 1499961056
                no_serial: 0
                no_parallel: 0
                no_floppy: 0
                no_cdrom: 0
                no_sdcard: 0
                pci_allow_0_address: 0
                legacy_fw_cfg_order: 0
                is_default: false
                default_machine_opts: Invalid Argument
                default_boot_order: MMOC
                default_display: 
                compat_props: 0x11e9bf3ee20
                hw_version: Invalid Argument
                default_ram_size: 0
                default_cpu_type: Invalid Argument
                default_kernel_irqchip_split: false
                option_rom_has_mr: false
                rom_file_has_mr: false
                minimum_page_bits: 0
                has_hotpluggable_cpus: false
                ignore_memory_transaction_failures: false
                numa_mem_align_shift: 0
                valid_cpu_types: 0
                auto_enable_numa_with_memhp: false
                auto_enable_numa_with_memdev: false
                ignore_boot_device_suffixes: false
                smbus_no_migration_support: false
                nvdimm_supported: false
                numa_mem_supported: false
                auto_enable_numa: false
                smp_props
                default_ram_id: Invalid Argument
                get_hotplug_handler: 0
                hotplug_allowed: 0
                cpu_index_to_instance_props: 0
                possible_cpu_arch_ids: 0
                get_default_cpu_node_id: 0
                fixup_ram_size: 0
            }
            userconfig: true
            vmstate_dump_file: 0 {
                _flags: Invalid Argument
                _IO_read_ptr: Bad address
                _IO_read_end: Bad address
                _IO_read_base: Bad address
                _IO_write_base: Bad address
                _IO_write_ptr: Bad address
                _IO_write_end: Bad address
                _IO_buf_base: Bad address
                _IO_buf_end: Bad address
                _IO_save_base: Bad address
                _IO_backup_base: Bad address
                _IO_save_end: Bad address
                _markers: Bad address
                _chain: Bad address
                _fileno: Bad address
                _flags2: Bad address
                _old_offset: Bad address
                _cur_column: Bad address
                _vtable_offset: Bad address
                _shortbuf: Bad address
                _offset: Bad address
                _codecvt: Bad address
                _wide_data: Bad address
                _mode: Bad address
                _unused2: Bad address
            }
            __func__: qemu_init
            __PRETTY_FUNCTION__: qemu_init

        0x7f99997ad2c0  0x1f33afb0d99   qemu_main(int, char**, char**) + 0x23 (../softmmu/main.c:-1)
            Variables:
            argc: 1
            argv: 0x7f99997ae648 {
                *argv: ./qemu-system-x86_64
            }
            envp: 0 {
                *envp: Invalid Argument
            }
            status: 115125334

        0x7f99997ad2e0  0x1f33afb0dd0   main(int, char**) + 0x20 (../softmmu/main.c:-1)
            Variables:
            argc: 1
            argv: 0x7f99997ae648 {
                *argv: ./qemu-system-x86_64
            }

        0x7f99997ad300  0x1f33afb0d6a   _start + 0x3a 
        0x7f99997ad340  0xca764c7ae3    runtime_loader + 0x103 
        00000000    0x7ffd6b746258  commpage_thread_exit + 0 

        Registers:
              rip:  0x000001f33b2784c9
              rsp:  0x00007f99997ad000
              rbp:  0x00007f99997ad030
              rax:  0x0000000000000000
              rbx:  0x0000000000000000
              rcx:  0x0000000000000000
              rdx:  0x0000119286fd9290
              rsi:  0x0000000000000001
              rdi:  0x0000119286f0c9a0
               r8:  0x0000119286fd9290
               r9:  0x0000000000000007
              r10:  0x0000119286b8c8bc
              r11:  0x0000000000000001
              r12:  0x00007f99997ae648
              r13:  0x0000000000000001
              r14:  0x00007f99997ae658
              r15:  0x0000000000000000
               cs:  0x002b
               ds:  0x0000
               es:  0x0000
               fs:  0x0000
               gs:  0x0000
               ss:  0x0023
              st0:  0
              st1:  0
              st2:  0
              st3:  0
              st4:  0
              st5:  0
              st6:  0
              st7:  0
              mm0:  {0, 0, 0, 0}
              mm1:  {0, 0, 0, 0}
              mm2:  {0, 0, 0, 0}
              mm3:  {0, 0, 0, 0}
              mm4:  {0, 0, 0, 0}
              mm5:  {0, 0, 0, 0}
              mm6:  {0, 0, 0, 0}
              mm7:  {0, 0, 0, 0}
             xmm0:  {0, 0, 0, 0, 0, 0, 0, 0}
             xmm1:  {0, 0, 0, 0, 0, 0, 0, 0}
             xmm2:  {0, 0, 0, 0, 0, 0, 0, 0}
             xmm3:  {0, 0, 0, 0, 0, 0, 0, 0}
             xmm4:  {0x7640, 0x86ee, 0x1192, 0, 0x7640, 0x86ee, 0x1192, 0}
             xmm5:  {0, 0, 0, 0, 0, 0, 0, 0}
             xmm6:  {0, 0, 0, 0, 0, 0, 0, 0}
             xmm7:  {0, 0, 0, 0, 0, 0, 0, 0}
             xmm8:  {0, 0, 0, 0, 0, 0, 0, 0}
             xmm9:  {0, 0, 0, 0, 0, 0, 0, 0}
            xmm10:  {0, 0, 0, 0, 0, 0, 0, 0}
            xmm11:  {0, 0, 0, 0, 0, 0, 0, 0}
            xmm12:  {0, 0, 0, 0, 0, 0, 0, 0}
            xmm13:  {0, 0, 0, 0, 0, 0, 0, 0}
            xmm14:  {0, 0, 0, 0, 0, 0, 0, 0}
            xmm15:  {0, 0, 0, 0, 0, 0, 0, 0}
khallebal commented 2 years ago

It has nothing to do with Xlibe, sorry for the noise.

khallebal commented 2 years ago

Can't close this thing?

waddlesplash commented 2 years ago

It likely does have to do with Xlibe. QEMU probably expects to be able to get a full keymap, which Xlibe doesn't provide, and it doesn't expect this to fail (which is reasonable, Xlibe isn't really "within specifications" in doing this.) Whether we can or should do something about it is another matter.

khallebal commented 2 years ago

Ah okay i didn't know that, but still that doesn't explain the crash at start up, it should just go through the checks and then issue the warning at the end of the gd_get_keymap() function and return NULL, why does it [crash?.] I wonder how @X547 dealt with this keymap issue in wayland?

waddlesplash commented 1 year ago

Wayland uses real keymaps. Since GTK now uses the Wayland layer instead of Xlibe, I think we can close this.

khallebal commented 1 year ago

No problem, you have more important things to do.