NotHimmel opened a new issue, #2519:
URL: https://github.com/apache/age/issues/2519
**Describe the bug**
Calling `ag_catalog.age_create_barbell_graph()` with only its first three
arguments crashes the backend with a segmentation fault. `node_label` is
declared `name = NULL` in the signature, so leaving it out is a supported call.
Because a backend segfault makes the postmaster reinitialize, every other
session on the instance is disconnected as well, and the database briefly goes
into recovery.
**How are you accessing AGE (Command line, driver, etc.)?**
`psql`
**What is the command that caused the error?**
```sql
LOAD 'age';
SET search_path = ag_catalog, "$user", public;
SELECT create_graph('barbell_test');
SELECT age_create_barbell_graph('barbell_test', 5, 0);
```
Client:
```
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
connection to server was lost
```
Server log:
```
LOG: client backend (PID 312566) was terminated by signal 11: Segmentation
fault
LOG: all server processes terminated; reinitializing
```
Passing `NULL` explicitly for `node_label` crashes the same way, even with
the later arguments supplied:
```sql
SELECT age_create_barbell_graph('barbell_test', 5, 0, NULL, NULL, 'E');
```
What crashes and what does not:
| call | result |
| --- | --- |
| `age_create_barbell_graph('g', 5, 0)` | **SIGSEGV** |
| `age_create_barbell_graph('g', 5, 0, 'V')` | `ERROR: edge label can not be
NULL` |
| `age_create_barbell_graph('g', 5, 0, 'V', NULL, 'E')` | works |
| `age_create_barbell_graph('g', 5, 0, NULL, NULL, 'E')` | **SIGSEGV** |
So the crash happens whenever `node_label` is NULL, whether that comes from
the declared default or from an explicit NULL.
**Expected behavior**
`node_label` has a default in the signature, so it should either fall back
to the default vertex label or fail with a normal `ERROR`. No argument
combination should be able to terminate the backend.
**Environment:**
- Version: PostgreSQL 18.4 (built from source), Apache AGE `master` @
`8014174` (1.8.0)
- The same code is present on `release/PG18/1.7.0`, so other branches are
likely affected too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]