-
-
Notifications
You must be signed in to change notification settings - Fork 203
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
igraph bfs/dfs segmentation faults #253
Comments
I found a similar issue to call an igraph function in callbacks. The following code crashes in igraph 1.2.4.1. library(igraph)
f <- function(h,v,e){
igraph::neighbors(h,1)
FALSE
}
g <- igraph::graph_from_data_frame(data.frame(from=1,to=2))
igraph::bfs(graph=g,root=1,neimode="all",callback=f) Here is my environment to run the code shown above.
|
@vtraag Still crashed in the dev version, we should investigate. |
With 1.3 dev version:
|
The callbacks of the
I'll have to look into how the callbacks are implemented to see if any of these is easy to fix. |
Vertex IDs and ranks are now 1-based in the bfs() and dfs() callbacks bfs() and dfs() callback return values are coerced to a logical
Vertex IDs and ranks are now 1-based in the bfs() and dfs() callbacks bfs() and dfs() callback return values are coerced to a logical [Triggered by 380f381]
Why do we need |
BTW OP's example no longer seems to crash in dev version. |
|
I'm just trying to understand the reason for The progress bar seems to be an oerthogonal issue. |
I don't know; I'm not that familiar with the R internals either, but calling |
I just tried the current development version and the example still crashes for me. I hope the issue can be solved soon! And thanks for the library, it's great : )
environment:
|
Small copyable test case: library('igraph')
g <- make_tree(10)
f.in <- function(graph, data, extra) { print(graph); FALSE }
bfs(g, root=1, "out",callback=f.in) Stack trace:
It appears that Note that using igraph functions from callbacks is not currently supported. It is possible that |
Addition: using |
Okay, so it's simple and it will be solved in future versions when we switch the C core to 0.10, where we have the multi-level error stack available. The problem appears not only with
Since igraph 0.10 on the C side is still far away in the pipeline, I'll try to think about alternative solutions. |
@krlmlr Fixing this is unrealistic within the timeframe we have for 2.0.0. Removing from blocker list, re-add if you disagree. |
Hi, I am just playing with
dfs
/bfs
functions and Im trying to access vertex attributes in callback function but everytime it crashes R vm:Even printing graph structure in callback function breaks everything...
The error I got:
The text was updated successfully, but these errors were encountered: