Integer division by -1 on INT64_MIN raises a misclassified floating-point exception (22P01) instead of bigint out of range
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 74/100
Línea de trabajo
Empieza por la reproducción: ejecuta la consulta Cypher RETURN (-9223372036854775807 - 1) / -1 después de LOAD 'age' y observa el error de punto flotante 22P01. Busca la división entera en la aritmética de agtype de AGE en C, que es donde se realiza la división sin comprobar. Compárala con int84div en int8.c de PostgreSQL, que genera 22003 bigint out of range en este caso. Está terminado cuando la consulta Cypher falla con un error de bigint fuera de rango y el comportamiento existente de la aritmética no cambia en lo demás.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
AGE Version: Apache AGE extension 1.8.0 on PostgreSQL 18.6
Installation Method: Docker
API: Cypher
Steps to reproduce
LOAD 'age';
SET search_path = ag_catalog, public;
SELECT * FROM ag_catalog.create_graph('gdbug');
SELECT * FROM cypher('gdbug', $$ RETURN (-9223372036854775807 - 1) / -1 $$) AS (r agtype);
Expected behavior
+9223372036854775808 is outside the signed 64-bit range, so this should fail with a range error. The host database already does exactly that for the identical expression, and AGE inherits that behaviour everywhere except in its own agtype arithmetic:
SELECT (-9223372036854775807 - 1) / -1;
-- ERROR: 22003: bigint out of range
-- LOCATION: int84div, int8.c:986
Actual behavior
The Cypher path does not report a range error. The integer division is executed unchecked; the hardware raises #DE/SIGFPE, and PostgreSQL's signal handler converts it into a floating-point exception:
ERROR: 22P01: floating-point exception
DETAIL: An invalid floating-point operation was signaled. This probably means
an out-of-range result or an invalid operation, such as division by zero.
LOCATION: FloatExceptionHandler, postgres.c:3077
- Lenguaje dominante
- C
- Estrellas
- 4.9k
- Forks
- 532
- Merge medio
- 9 d 18 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/age
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 2 días
-
Performance regression in 1.8.0: every Cypher DELETE costs ~1 ms per edge label in the graphAbiertobug
Dificultad 4/5 3-5 días Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 50/100
Los mantenedores suelen responder en 2 días
Todos los issues de apache/age
Issues similares
-
UB: (int) cast of a user double outside int range in dispatch / vm_index_is_int / flat_index_atAbiertoarea:runtime-vm
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
InauguralSystems/EigenScript#1748 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
wasm-micro-runtime/wasm-micro-runtime#5159 ·
Los mantenedores suelen responder en 7 días
-
chore: update release scheduleAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 4 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 Medio día Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día