Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pgr_lengauerTarjanDominatorTree triggers an assertion #2565

Closed
cvvergara opened this issue Sep 25, 2023 · 0 comments · Fixed by #2566
Closed

pgr_lengauerTarjanDominatorTree triggers an assertion #2565

cvvergara opened this issue Sep 25, 2023 · 0 comments · Fixed by #2566
Labels
Milestone

Comments

@cvvergara
Copy link
Member

Problem

When the vertex does not exist, it triggers an assertion on Develop mode

To Reproduce

SELECT * FROM pgr_lengauerTarjanDominatorTree(
$$SELECT id, source, source AS target, cost, reverse_cost                                                                 
FROM edges                                                                                                              
WHERE id = 1$$ , 5);
 seq | vertex_id | idom 
-----+-----------+------
   1 |         5 |    0
(1 row)

sampledata=# SELECT * FROM pgr_lengauerTarjanDominatorTree(
$$SELECT id, source, source AS target, cost, reverse_cost                                                                 
FROM edges                                                                                                              
WHERE id = 1$$ , 5);
 seq | vertex_id | idom 
-----+-----------+------
   1 |         5 |    0
(1 row)

sampledata=# SELECT * FROM pgr_lengauerTarjanDominatorTree(
$$SELECT id, source, source AS target, cost, reverse_cost                                                                 
FROM edges                                                                                                              
WHERE id = 1$$ , 6);
ERROR:  AssertFailedException: has_vertex(vid) at /home/vicky/pgrouting/pgrouting/cvvergara/include/cpp_common/pgr_base_graph.hpp:532
*** Execution path***
[bt]/usr/lib/postgresql/15/lib/libpgrouting-3.6.so(_Z13get_backtraceB5cxx11v+0x44) [0x7fa3d8efd074]
[bt]/usr/lib/postgresql/15/lib/libpgrouting-3.6.so(_ZNK9pgrouting5graph14Pgr_base_graphIN5boost14adjacency_listINS2_4vecSES4_NS2_14bidirectionalSENS_12Basic_vertexENS_10Basic_edgeENS2_11no_propertyENS2_5listSEEES6_S7_E5get_VEl+0x56) [0x7fa3d8f23142]
[bt]/usr/lib/postgresql/15/lib/libpgrouting-3.6.so(_ZN9pgrouting9functions11Pgr_LTDTreeINS_5graph14Pgr_base_graphIN5boost14adjacency_listINS4_4vecSES6_NS4_14bidirectionalSENS_12Basic_vertexENS_10Basic_edgeENS4_11no_propertyENS4_5listSEEES8_S9_EEE11pgr_ltdtreeERSD_l+0xf5) [0x7fa3d923940b]
[bt]/usr/lib/postgresql/15/lib/libpgrouting-3.6.so(do_pgr_LTDTree+0x4c3) [0x7fa3d9237f51]
[bt]/usr/lib/postgresql/15/lib/libpgrouting-3.5.so(+0xa50dea) [0x7fa3d8250dea]
[bt]/usr/lib/postgresql/15/lib/libpgrouting-3.5.so(_pgr_lengauertarjandominatortree+0xb6) [0x7fa3d8250f82]
[bt]postgres: 15/main: vicky sampledata [local] SELECT(ExecMakeTableFunctionResult+0x3d8) [0x563a837b7088]
[bt]postgres: 15/main: vicky sampledata [local] SELECT(+0x35fd4a) [0x563a837cad4a]
[bt]postgres: 15/main: vicky sampledata [local] SELECT(standard_ExecutorRun+0x10d) [0x563a837ab9fd]
[bt]postgres: 15/main: vicky sampledata [local] SELECT(+0x3888a5) [0x563a837f38a5]
[bt]postgres: 15/main: vicky sampledata [local] SELECT(SPI_execute_plan_extended+0x53) [0x563a837f3f13]
[bt]/usr/lib/postgresql/15/lib/plpgsql.so(+0x14f50) [0x7fa3e2ef5f50]
[bt]/usr/lib/postgresql/15/lib/plpgsql.so(+0x170d3) [0x7fa3e2ef80d3]
[bt]/usr/lib/postgresql/15/lib/plpgsql.so(+0x1de91) [0x7fa3e2efee91]
[bt]/usr/lib/postgresql/15/lib/plpgsql.so(plpgsql_exec_function+0x21f) [0x7fa3e2ef49ff]
[bt]/usr/lib/postgresql/15/lib/plpgsql.so(plpgsql_call_handler+0x227) [0x7fa3e2eff8f7]

HINT:  
CONTEXT:  SQL statement "SELECT a.seq, vid, a.idom
    FROM _pgr_lengauerTarjanDominatorTree(_pgr_get_statement($1),$2) AS a"
PL/pgSQL function pgr_lengauertarjandominatortree(text,bigint) line 4 at RETURN QUERY

Expectation
The least: it should not trigger an exeption

Sample Data
The sample data of the documentation

Platform/versions

SELECT pgr_version();
 pgr_version 
-------------
 3.5.0
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant