Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[GSD-13828] zeInit segfaults when ZE_AFFINITY_MASK selects no existing device (26.27.39122.11)

Abierto
#1,030 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
54/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp
Área
backend

Línea de trabajo

Start by reading the issue’s linked code in shared/source/execution_environment/execution_environment.cpp and level_zero/core/source/driver/driver.cpp, along with the referenced unit test in shared/test/unit_test/execution_environment/execution_environment_tests.cpp. Reproduce with ZE_AFFINITY_MASK=99 and the supplied zeInit program. Done means initialization returns without a segfault when the mask selects no existing device, with a regression test covering that case.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

zeInit segfaults inside the GPU driver when ZE_AFFINITY_MASK names only a device index that does not exist, instead of returning with no devices. chipStar tracking issue: https://github.com/CHIP-SPV/chipStar/issues/2038

GPU hardware: Intel Arc B570 (Battlemage, PCI 8086:e20c) plus the host's integrated GPU.

Driver version: compute-runtime 26.27.39122.11 (libze_intel_gpu.so.1.15.39122), IGC 2.38.2, gmmlib 22.10.0, Level Zero loader 1.28.2. Installed from the release .deb packages of https://github.com/intel/compute-runtime/releases/tag/26.27.39122.11.

Linux distribution: Ubuntu 24.04.2 LTS, kernel 6.17.0-14-generic, xe driver, boot parameters ro quiet splash.

Actual behavior: SIGSEGV (exit 139) inside libze_intel_gpu.so.1 during zeInit:

#0  ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#1  ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#2  ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#3  __pthread_once_slow () at ./nptl/pthread_once.c:116
#4  ?? () from /lib/x86_64-linux-gnu/libze_intel_gpu.so.1
#5  std::call_once<zeInit::{lambda()#1}> ... from /usr/local/lib/libze_loader.so.1
#7  zeInit () from /usr/local/lib/libze_loader.so.1

Expected behavior: zeInit returns (successfully with zero devices, or with an error such as ZE_RESULT_ERROR_UNINITIALIZED) and the application can report that no device is available. compute-runtime ignores an out of range mask entry (https://github.com/intel/compute-runtime/blob/26.27.39122.11/shared/source/execution_environment/execution_environment.cpp#L236), its unit test expects an empty device mapping for such a mask (https://github.com/intel/compute-runtime/blob/26.27.39122.11/shared/test/unit_test/execution_environment/execution_environment_tests.cpp#L650), and driver initialization has a no device error path (https://github.com/intel/compute-runtime/blob/26.27.39122.11/level_zero/core/source/driver/driver.cpp#L25).

Reproduction rate: every run.

Steps to reproduce:

// zeinit.c: gcc zeinit.c -lze_loader -o zeinit
#include <level_zero/ze_api.h>
#include <stdio.h>
int main(void) {
  ze_result_t r = zeInit(0);
  printf("zeInit -> 0x%x\n", r);
  uint32_t n = 0;
  if (r == ZE_RESULT_SUCCESS) { r = zeDriverGet(&n, NULL); printf("zeDriverGet -> 0x%x drivers=%u\n", r, n); }
  return 0;
}
$ ./zeinit
zeInit -> 0x0
zeDriverGet -> 0x0 drivers=2
$ ZE_AFFINITY_MASK=0 ./zeinit
zeInit -> 0x0
zeDriverGet -> 0x0 drivers=1
$ ZE_AFFINITY_MASK=99 ./zeinit
Segmentation fault (core dumped)

Is this a regression: not known.

This issue was generated using AI

Lenguaje dominante
C++
Estrellas
1.5k
Forks
304
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de intel/compute-runtime

Todos los issues de intel/compute-runtime

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.