[R-pkg-devel] IFC package - Solaris error polygon edge not found (zero-width or zero-height?)

git demont g|t@demont @end|ng |rom gm@||@com
Fri Sep 24 09:05:19 CEST 2021


I had very hard time with this error. But I think I have solved it now.
I made several tests recently trying to identify where it came from.
This cryptic error was not random, I was able to reproduce it.

It only appeared on rhub  Oracle Solaris 10, x86, 32 bit, R-release and not
on rhub  Oracle Solaris 10, x86, 32 bit, R release, Oracle Developer Studio
12.6

It happened when I try to grid.draw a gtable object produced by
gridExtra::arrangeGrob
This gtable object is produced without any errors and consists of a lattice
plot (transformed with grob()) + a tableGrob() of a small matrix.

If I grid.draw the lattice plot (transformed with grob()) alone, I got no
error
If I grid.draw the tableGrob() alone, I got no error
However, when I tried to draw the combination of both, I was getting the
error:
grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  :
  polygon edge not found (zero-width or zero-height?)
Calls: [my function name] ... <Anonymous> -> heightDetails ->
heightDetails.text -> grid.Call

This error only occurred with one of the graphs I wanted to produce (number
5).
In my tests, I also included another graph (number 4) which did not lead to
any error.

Luckily, I found a blog by Dana Paige Seidel
https://www.danaseidel.com/2018-09-01-ATidySummer/ with a chapter called
"The bug of grid destiny" that pointed to scales "this particular error is
triggered when special characters are used in axis tick labels". This was
really helpful because the scale was indeed one of the differences between
graph4 and graph5.
graph5 has a log-like scale whereas graph4 has a linear scale. To further
test this I produced graph4 with a log-like scale and graph5 with a linear
scale and this time the error happened with graph4.

All this was a long quest, because each time I had to tweak my code,
reupload it to rhub and wait for the artifacts to look at all the print and
str, ... things I had to introduce to understand were the bug came from. By
the way, many thanks to rhub people for providing us their amazing platform
to test our packages !

Looking deeper at the scales... For log-like, several ticks are drawn but
only main ticks are labelled with values, whereas for linear all ticks that
are displayed are labelled.
In the log-like scale the labels of the non-main ticks were labelled with
"".

My guess was that in some circumstances those "" produced text grobs with
non.finite height that triggered the error. Replacing the "" by " " (with a
whitespace) solved the issue

Though, I still can't explain why this only happened on Solaris nor why the
error is not triggered when the plot is drawn alone without the tableGrob.

FWIW,
Yohann


On Thu, Sep 16, 2021 at 3:14 PM git demont <git.demont using gmail.com> wrote:

> Replying to myself and with some additional investigations
>
> I just tried once again on rhub - Oracle Solaris 10, x86, 32 bit,
> R-release and got the same error with a conditional font family
> modification where when
> Sys.info()["sysname"] == "SunOS",
> - pdf(), family argument is set to its default value "Helvetica"
> - gridExtra::ttheme_default, base_family argument is se to its default
> value ""
> Otherwise, "serif" is used
>
> In addition, the error in solaris shares "polygon edge not found" lately
> reported by Iñaki Úcar
> Though, I don't have the warning part, and mine is not happening during
> vignette rebuilding
>
> 2021-Aug-10, [R-pkg-devel] "polygon edge not found" on macos-arm64
> >Dear CRAN maintainers,
> >
> >I see there's a new WARN on the recently added macos-arm64 platform
> >for quite a number of packages. Specifically, vignette rebuilding
> >fails with "polygon edge not found" (example in [1]). In addition,
> >there are a number of warnings like this:
> >
> >Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)) :
> >     no font could be found for family "Arial"
> >
> >Is this something package authors should worry about in submissions?
> >
> >[1] https://cran.r-project.org/web/checks/check_results_simmer.html
>
> On Thu, Sep 16, 2021 at 12:15 PM git demont <git.demont using gmail.com> wrote:
>
>> Hello community,
>>
>> I plan to submit a new version of IFC package to CRAN.
>>
>> I checked it locally, on win-builder and on rhub. Almost everything looks
>> OK except for:
>> - Debian Linux, R-devel, GCC ASAN/UBSAN
>> - Oracle Solaris 10, x86, 32 bit, R-release
>>
>> On Debian Linux, R-devel, GCC ASAN/UBSAN, I get a PREPERROR, I suspect it
>> is a false pos since it says that xml2 package can not be installed.
>> My main concern is about Oracle Solaris 10, x86, 32 bit, R-release where
>> the function ExportToReport leads to the error reported in the title see:
>> https://artifacts.r-hub.io/IFC_0.1.2.tar.gz-0e84aed564a1488894eb7e34990443af/IFC.Rcheck/IFC-Ex.Rout
>>
>> However I got no error on  Oracle Solaris 10, x86, 32 bit, R release,
>> Oracle Developer Studio 12.6
>>
>> Some googling points to https://github.com/tidyverse/ggplot2/issues/2252.
>> The code of ExportToReport, is here
>> https://github.com/gitdemont/IFC/blob/master/R/ExportToReport.R,
>> The issue links this solaris error to ggplot but threads also mention
>> grid / font...
>> So my guess is that it could be related with the fact that I apply font
>> modifications through gridExtra::ttheme_default and in pdf() by using
>> "serif" in ExportToReport
>>
>> Do you think, this is only on rhub but will not happen on CRAN ?
>> I did several modifications since last CRAN update, but previous CRAN
>> version of IFC package already included those font family modifications in
>> ExportToReport (
>> https://github.com/cran/IFC/blob/master/R/ExportToReport.R)
>> and did not produce solaris error in CRAN results (
>> https://cran.r-project.org/web/checks/check_results_IFC.html)
>>
>> Nonetheless should it be safer to use other font family only for solaris ?
>> In such case what would you be your recommendations to check it (e.g.
>> Sys.info()["sysname"], I don't know the returned value on solaris) and to
>> apply another font family (but which one)
>>
>> Maybe, it is something else. But, in such case, I have absolutely no idea
>> where it comes from what I can do.
>>
>> Best,
>> Yohann
>>
>>
>>
>>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list