igraph / rigraph

igraph R package
https://r.igraph.org
532 stars 200 forks source link

ci: run examples with sanitizer #1288

Closed Antonov548 closed 4 months ago

Antonov548 commented 4 months ago

Closes: https://github.com/igraph/rigraph/issues/1195

Proof that it detects memory leaks in examples: https://github.com/igraph/rigraph/pull/1286

aviator-app[bot] commented 4 months ago

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes. Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged using Aviator.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.
szhorvat commented 4 months ago

So does this mean that we're good, no crashes or leaks triggered by examples?

Antonov548 commented 4 months ago

So does this mean that we're good, no crashes or leaks triggered by examples?

Sanitizer showed some warnings about undefined behavior (or similar), but it doesn't cause the crash.

Yes, examples good.

szhorvat commented 4 months ago

Sanitizer showed some warnings about undefined behavior

That may still indicate a real issue, though not with certainty. Would you be able to extract the full message? I can only see a partial thing here:

https://github.com/igraph/rigraph/actions/runs/8221181042/job/22481341484#step:5:6601

We can then fine-tune the specific checks UBSan does so that it only warns about real issues.

szhorvat commented 4 months ago

Never mind, I looked at line 80. We cast a real to integer and back to see if the real is representable as an integer. We do this on purpose, not an issue.

maelle commented 4 months ago

@Antonov548 a limitation to R2dex() that I just realized is that it does not run the examples that are wrapped in \dontrun{}. I'll make a PR.