Skip to content

TextureResize calls strlen(NULL) when no GL context is current #192

Description

@d4rken

Emulator 37.3.1 (build 16373887), Linux x86_64, RTX 4090 / NVIDIA 595.91.07, -gpu host, API 36 google_apis x86_64. The emulator segfaults a few minutes into use, windowed or -no-window. Four cores, same stack:

#0 __strlen_avx2 (libc.so.6)
#1 libgfxstream_backend.so+0x55bc08  TextureResize::TextureResize(unsigned, unsigned)

The last log line is gles_v2_imp.cpp:glGetString:2882 error null ctx. ColorBufferGl::create builds a TextureResize, whose constructor passes glGetString(GL_EXTENSIONS) to HasExtension without a null check (host/gl/texture_resize.cpp), so a color buffer created with no current context becomes strlen(NULL). I don't know why the context is missing. -gpu swangle_indirect doesn't crash.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions