Skip to content

igraph bfs/dfs segmentation faults #253

@ludwikbukowski

Description

@ludwikbukowski

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:

library('igraph')
g <- make_tree(10)
g<- set_vertex_attr(g, "xx", value = 10:19)
f.in <- function(graph, data, extra) {
## print(V(graph)[data[1]]$xx) $## I tried something like this but doesnt work
print(graph) ## even this crashes R
FALSE
}
tmp <- bfs(g, root=1, "out",callback=f.in)

Even printing graph structure in callback function breaks everything...
The error I got:


 *** caught segfault ***
address 0x8, cause 'memory not mapped'

Traceback:
 1: .Call(C_R_igraph_bfs, graph, root, roots, neimode, unreachable,     restricted, as.logical(order), as.logical(rank), as.logical(father),     as.logical(pred), as.logical(succ), as.logical(dist), callback,     extra, rho)
 2: bfs(g, root = 1, "out", callback = f.in)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions