Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ on:
- release
- next
- cran-*
- claude/**
pull_request:
branches:
- main
- master
- claude/**
workflow_dispatch:
inputs:
ref:
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/build-and-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- cran-*
- claude/**
schedule:
- cron: '0 2 * * *'
workflow_dispatch:
Expand All @@ -21,7 +22,7 @@ jobs:
name: Sanitizer

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
with:
fetch-depth: 0

Expand All @@ -34,7 +35,11 @@ jobs:
- name: run sanitizer
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/cynkra/docker-images/r-debug-csan-igraph:latest
# Built daily from https://github.com/cynkra/r-debug, so R-devel is
# at most a day old.
# The images under ghcr.io/cynkra/docker-images are no longer
# rebuilt; their R-devel is stale.
image: ghcr.io/cynkra/r-debug/r-debug-csan-igraph:latest
options: --rm --platform linux/amd64 -v ${{ github.workspace }}:/rigraph
run: |
set -e
Expand Down
20 changes: 18 additions & 2 deletions src/rinterface_extra.c
Original file line number Diff line number Diff line change
Expand Up @@ -6157,8 +6157,14 @@ SEXP Rx_igraph_is_chordal(SEXP graph, SEXP alpha, SEXP alpham1,
SEXP result, names;
/* Convert input */
Rz_SEXP_to_igraph(graph, &c_graph);
if (!Rf_isNull(alpha)) { Rz_SEXP_to_vector_int_copy(alpha, &c_alpha); }
if (!Rf_isNull(alpham1)) { Rz_SEXP_to_vector_int_copy(alpham1, &c_alpham1); }
if (!Rf_isNull(alpha)) {
IGRAPH_R_CHECK(Rz_SEXP_to_vector_int_copy(alpha, &c_alpha));
IGRAPH_FINALLY_PV(igraph_vector_int_destroy, &c_alpha);
}
if (!Rf_isNull(alpham1)) {
IGRAPH_R_CHECK(Rz_SEXP_to_vector_int_copy(alpham1, &c_alpham1));
IGRAPH_FINALLY_PV(igraph_vector_int_destroy, &c_alpham1);
}
if (LOGICAL(pfillin)[0]) {
if (0 != igraph_vector_int_init(&c_fillin, 0)) {
igraph_error("", __FILE__, __LINE__, IGRAPH_ENOMEM);
Expand Down Expand Up @@ -6187,6 +6193,16 @@ SEXP Rx_igraph_is_chordal(SEXP graph, SEXP alpha, SEXP alpham1,
} else {
PROTECT(newgraph=R_NilValue);
}
/* Unwound in reverse order of registration, so that IGRAPH_FINALLY_CLEAN()
* pops the entry that belongs to the vector being destroyed. */
if (!Rf_isNull(alpham1)) {
igraph_vector_int_destroy(&c_alpham1);
IGRAPH_FINALLY_CLEAN(1);
}
if (!Rf_isNull(alpha)) {
igraph_vector_int_destroy(&c_alpha);
IGRAPH_FINALLY_CLEAN(1);
}
SET_VECTOR_ELT(result, 0, chordal);
SET_VECTOR_ELT(result, 1, fillin);
SET_VECTOR_ELT(result, 2, newgraph);
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-foreign.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ test_that("graph_from_graphdb works", {
skip_on_cran()

# Bug in base R? Checked with 2024-11-01 r87285:
# docker run --rm -ti -v $PWD:/rigraph -e MAKEFLAGS=-j4 ghcr.io/cynkra/docker-images/rigraph-san:latest RDcsan -q -e 'filename <- "/rigraph/DESCRIPTION"; gz_file_con <- file(filename, open = "rb"); file_con <- gzcon(gz_file_con); close(file_con); gc()'
# docker run --rm -ti -v $PWD:/rigraph -e MAKEFLAGS=-j4 ghcr.io/cynkra/r-debug/r-debug-csan-igraph:latest RDcsan -q -e 'filename <- "/rigraph/DESCRIPTION"; gz_file_con <- file(filename, open = "rb"); file_con <- gzcon(gz_file_con); close(file_con); gc()'
skip_if(Sys.getenv("R_SANITIZER") == "true")

expect_silent(graph_from_graphdb(nodes = 1000))
Expand Down
Loading