libretro / libretro/libretro-common

I think I found a (segfault) bug

Open
#33 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
180
Forks
98
Avg merge
7h 16m
Merged PRs (30d)
1

Description

Using D54250WYK nuc box (intel iris HD 5000 gfx hardware).

I'm using ubuntu 16.04.01 and RetroPie 4.1 (freshly built yesterday)

Here's the bactkrace, hope it can be of use:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe0de1700 (LWP 23800)]
0x0000000000000000 in ?? ()
(gdb) bt full
#0  0x0000000000000000 in ?? ()
No symbol table info available.
#1  0x00000000004f8572 in rglgen_resolve_symbols_custom (map=0x60c840 <rglgen_symbol_map>, proc=0x0)
    at libretro-common/glsym/rglgen.c:34
        func = <optimized out>
#2  rglgen_resolve_symbols (proc=0x0) at libretro-common/glsym/rglgen.c:41
No locals.
#3  0x00000000004f2e6d in gl_init (video=0x8eeea0, input=0x874048 <current_input>,
    input_data=0x874040 <current_input_data>) at gfx/drivers/gl.c:1923
        mode = {width = 320, height = 240, fullscreen = true}
        inp = {input = 0x0, input_data = 0x0}
        interval = 1
        mip_level = 0
        full_x = <optimized out>
        full_y = <optimized out>
        shader_filter = {index = 0, smooth = 0x0}
        shader_info = {set_active = false, num = 0, idx = 0, data = 0x0}
        ident_info = {ident = 0x0}
        wrap_info = {idx = 0, type = RARCH_WRAP_BORDER}
        win_width = <optimized out>
        win_height = <optimized out>
        temp_width = 0
        temp_height = 0
        force_smooth = false
        vendor = 0x0
        renderer = 0x0
        version = 0x0
        hwr = 0x0
        error_string = 0x0
        gl = 0x7fffdc0008c0
#4  0x00000000004df4bd in video_thread_handle_packet (incoming=0x7fffe0de0a20, thr=0x8eee80)
    at gfx/video_thread_wrapper.c:342
        i = <optimized out>
        pkt = {type = CMD_INIT, data = {b = false, i = 0, f = 0, str = 0x0, v = 0x0, set_shader = {
              type = RARCH_SHADER_NONE, path = 0x0}, set_viewport = {width = 0, height = 0, force_full = false,
              allow_rotate = false}, rect = {index = 0, x = 0, y = 0, w = 0, h = 0}, image = {data = 0x0, num = 0},
            output = {width = 0, height = 0}, new_mode = {width = 0, height = 0, fullscreen = false}, filtering = {
              index = 0, smooth = false}, osd_message = {msg = '\000' <repeats 254 times>, params = {x = 0, y = 0,
                scale = 0, drop_mod = 0, drop_x = 0, drop_y = 0, drop_alpha = 0, color = 0, full_screen = false,
                text_align = TEXT_ALIGN_LEFT}}, custom_command = {method = 0x0, data = 0x0, return_value = 0},
            font_init = {method = 0x0, font_driver = 0x0, font_handle = 0x0, video_data = 0x0, font_path = 0x0,
              font_size = 0, return_value = false, api = FONT_DRIVER_RENDER_DONT_CARE}}}
        ret = false
#5  video_thread_loop (data=0x8eee80) at gfx/video_thread_wrapper.c:591
        pkt = {type = CMD_INIT, data = {b = false, i = 0, f = 0, str = 0x0, v = 0x0, set_shader = {
              type = RARCH_SHADER_NONE, path = 0x0}, set_viewport = {width = 0, height = 0, force_full = false,
              allow_rotate = false}, rect = {index = 0, x = 0, y = 0, w = 0, h = 0}, image = {data = 0x0, num = 0},
            output = {width = 0, height = 0}, new_mode = {width = 0, height = 0, fullscreen = false}, filtering = {
              index = 0, smooth = false}, osd_message = {msg = '\000' <repeats 254 times>, params = {x = 0, y = 0,
                scale = 0, drop_mod = 0, drop_x = 0, drop_y = 0, drop_alpha = 0, color = 0, full_screen = false,
                text_align = TEXT_ALIGN_LEFT}}, custom_command = {method = 0x0, data = 0x0, return_value = 0},
            font_init = {method = 0x0, font_driver = 0x0, font_handle = 0x0, video_data = 0x0, font_path = 0x0,
              font_size = 0, return_value = false, api = FONT_DRIVER_RENDER_DONT_CARE}}}
        updated = <optimized out>
        thr = 0x8eee80
#6  0x00000000004dc9cf in thread_wrap (data_=0x8d98a0) at libretro-common/rthreads/rthreads.c:105
        data = 0x8d98a0
#7  0x00007ffff74696ba in start_thread (arg=0x7fffe0de1700) at pthread_create.c:333
        __res = <optimized out>
        pd = 0x7fffe0de1700
        now = <optimized out>
---Type <return> to continue, or q <return> to quit---
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736966039296, 503386055352764156, 1, 140737488340175,
                140736966040000, 8863808, -503379172028070148, -503404258749200644}, mask_was_saved = 0}}, priv = {
            pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#8  0x00007ffff168f82d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
No locals.
(gdb)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with libretro-common/glsym/rglgen.c at rglgen_resolve_symbols_custom and gfx/drivers/gl.c at gl_init, following the null proc shown in the backtrace. Reproduce the crash on the reported Ubuntu and Intel Iris setup under gdb, then verify that the OpenGL initialization path no longer segfaults and handles the failure as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.