[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: One test of brio test suite seems to run into endless loop on some hardware architectures



Andreas,

Looking at the code I think the issue is I was storing the results of `fgetc()` as a `char` and then checking if it matched `EOF`. This works on x86, but non-intel architectures must use a different value of `EOF` that doesn't fit in `char` storage.

In https://github.com/r-lib/brio/commit/f1d6329bc6261ad72489550bc21b53ef271b5062 I switched to using `int`, as the `fgetc()` type signature shows, so I believe that should fix the problem.

I will release a new version of brio to CRAN in the next day or two with this change.

Jim

On Tue, Jan 19, 2021 at 2:22 AM Andreas Tille <andreas@an3as.eu> wrote:
Hi Jim,

the R packaging team in Debian has packaged brio.  There is a CI
infrastructure which is running the test suite on several architectures.
The test suite runs nicely on Intel architectures.  However, there was
an issue with arm64, armhf and ppc64el (which are the only non-Intel
architectures currently so this list might not be complete).  The test
suite simply never ended and the tests were manually stopped by the
admins.

Yesterday I bisected the tests to find out what actual test is
responsible for the issue and I was successful with excluding a
single test[1].  So for whatever reason this code


test_that("file_line_endings detects Unix line endings", {
  tmp <- tempfile()
  on.exit(unlink(tmp))

  writeBin(charToRaw("foo\n"), tmp)

  expect_equal(file_line_endings(tmp), "\n")

  writeBin(charToRaw(""), tmp)

  expect_identical(file_line_endings(tmp), NA_character_)
})


works only on Intel architectures but does not end on other
test architectures in the Debian CI pool.

Kind regards

       Andreas.

[1] https://salsa.debian.org/r-pkg-team/r-cran-brio/-/blob/master/debian/tests/run-unit-test#L17

--
http://fam-tille.de

Reply to: