Need help with igraph error:[ igraph_error.c:186: Assertion `no < 100’ failed.’]

I have the same error information as in this topic:

But I’m working under windows, and this error always appear when I iteratively add vertices, edges and edge/vertices weights to a graph. For example, I have 50 graphs, I loop each graphs and add around 1000 vertices and 10000 edges. It always shows this error at the 46th graph, but if I simply do the operation on 46th graph, it works fine.

Error code

igraph_attribute_combination_t comb;
igraph_attribute_combination(&comb, "weight", IGRAPH_ATTRIBUTE_COMBINE_SUM, "", IGRAPH_ATTRIBUTE_COMBINE_FIRST, IGRAPH_NO_MORE_ATTRIBUTES);
igraph_simplify(&sourceGraph, 1, 1, &comb); /*  <---- error */
Assertion failed: no < 100, file D:\igraph-0.8.2-msvc\src\igraph_error.c, line 186

Error trace:
igraph_simplify () --> igraph_create() --> igraph_empty_attrs() --> igraph_i_cattributes_init() -->
IGRAPH_FINALLY_REAL().

I have two questions:

  1. if this is also due to the parallel problem as that topic, where should I add the args? I work on windows and I only have igraph msvc project file.

  2. Cound it be a problem with the igraph_simplify? I add multiply edges to the graph and I expect that the simplify function can sum the “weight” attributes while keep the vertex attributes.

Thank you!

This possibly points to a real bug, where there is a problem in error handling, possibly due to mismatching FINALLY calls. Could you please provide the exact code that reproduces the exact problem? That way we could look into it in more detail.

Thanks for your reply. The error code is in my image matching project which has a long pipeline. The error appears only when handles around hundreds of images. I will try to reproduce it with simple example code.

1 Like

@d9y1kk Indeed, a minimal example would very much be appreciated, if you can construct one.

If you use ./configure --enable-verify-finally, igraph will do additional checks (but it will be noticeably slower). This should help in teasing out the error. However, the configure script is not available with MSVC. You could only try this on a Unix-like system or if using MSYS2/MinGW.

A final note: please do upgrade to igraph 0.8.3. I see you have 0.8.2.

1 Like

@vtraag @szhorvat I updated the igraph to 0.8.3 and the bug magically disappeared. I build a test case by repeatly building same graph and adding same vertices/edges/attris and then delete it, this crashed (no<100) at 40-50 rounds for 0.8.2. But for 0.8.3 it success for testing more than 100 rounds.

I think this bug might be fixed in 0.8.3. Thank you for advice.

2 Likes

That’s great to hear! We did fix a number of similar issues in 0.8.3, thanks to @vtraag’s --enable-verify-finally tool, so it’s quite likely that whatever caused this for you was fixed too.