Skip to content
Prev 14939 / 15075 Next

quartz hanging

Okay, it took me a while, but I now have a very small reprex for quartz 
(not xquartz) failing. I cannot repro this on linux with R-4.4.3 and the 
same package versions.

This is using emacs/ess, though it behaves the same on the console. I do 
not have RStudio installed.

|R.version # _ # platform aarch64-apple-darwin20 # arch aarch64 # os 
darwin20 # system aarch64, darwin20 # status # major 4 # minor 4.3 # 
year 2025 # month 02 # day 28 # svn rev 87843 # language R # 
version.string R version 4.4.3 (2025-02-28) # nickname Trophy Case 
Sys.info()[c("release","version")] # release # "24.5.0" # version # 
"Darwin Kernel Version 24.5.0: Tue Apr 22 19:53:27 PDT 2025; 
root:xnu-11417.121.6~2/RELEASE_ARM64_T6041" plot(1:10) |

(This can also be reproduced using |ggplot(mtcars, aes(mpg, disp)) + 
geom_point()|.)

At this point, change to the quartz window, it looks fine. Press |cmd-p| 
and a print dialog comes up, normal. Escape out. Press |cmd-p| again, 
and a bunch of rows dump all at once:

|2025-07-03 22:12:31.320 R[85631:98913917] The behavior of the 
UICollectionViewFlowLayout is not defined because: 2025-07-03 
22:12:31.320 R[85631:98913917] the item width must be less than the 
width of the UICollectionView minus the section insets left and right 
values, minus the content insets left and right values. 2025-07-03 
22:12:31.320 R[85631:98913917] The relevant UICollectionViewFlowLayout 
instance is <NSCollectionViewFlowLayout: 0x15b623740>, and it is 
attached to <NSCollectionView: 0x15b623000>. 2025-07-03 22:12:31.320 
R[85631:98913917] Make a symbolic breakpoint at 
UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the 
debugger. 2025-07-03 22:12:31.322 R[85631:98913917] The behavior of the 
UICollectionViewFlowLayout is not defined because: 2025-07-03 
22:12:31.322 R[85631:98913917] the item width must be less than the 
width of the UICollectionView minus the section insets left and right 
values, minus the content insets left and right values. 2025-07-03 
22:12:31.322 R[85631:98913917] The relevant UICollectionViewFlowLayout 
instance is <NSCollectionViewFlowLayout: 0x15b623740>, and it is 
attached to <NSCollectionView: 0x15b623000>. 2025-07-03 22:12:31.322 
R[85631:98913917] Make a symbolic breakpoint at 
UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the 
debugger. 2025-07-03 22:12:31.324 R[85631:98913917] The behavior of the 
UICollectionViewFlowLayout is not defined because: 2025-07-03 
22:12:31.324 R[85631:98913917] the item width must be less than the 
width of the UICollectionView minus the section insets left and right 
values, minus the content insets left and right values. 2025-07-03 
22:12:31.324 R[85631:98913917] The relevant UICollectionViewFlowLayout 
instance is <NSCollectionViewFlowLayout: 0x15b623740>, and it is 
attached to <NSCollectionView: 0x15b623000>. 2025-07-03 22:12:31.324 
R[85631:98913917] Make a symbolic breakpoint at 
UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the 
debugger. |

(Repeating the |cmd-p| for the above messages is not required, it?s just 
an oh-by-the-way. Not sure why it?s complaining, and I don?t entirely 
understand what the messages are really saying. But since it?s neither a 
warning nor a device-breaking error, I have been ignoring them.)

Now, load |kableExtra|. I haven?t tried many other packages, so far it 
is just this one package.

|library(kableExtra) |

That?s all, no more code/expressions/evaluation required. Back to the 
quartz window and press again |cmd-p|, and on the R console one of these 
errors appears. I say ?one of? because it varies slightly based on base 
graphics or ggplot2, or CRAN-vs-P3M ggplot2. Since the message-component 
is the same, I believe it to be the same underlying problem.

|### with base graphics alone, I see this: Error in 
getNamespace("grDevices") : Start tag expected, '<' not found [4] ### 
using ggplot2 from P3M, this is the only message I see Error in 
diff.default(xscale) : Start tag expected, '<' not found [4] ### using 
ggplot2 from CRAN, I see the p3m-error above or one of these two Error 
in length(x) : Start tag expected, '<' not found [4] Error in is.unit(y) 
: Start tag expected, '<' not found [4] |

The quartz window for that R process is now unresponsive, R will plot 
nothing more, and R will not open a new quartz window. I can |dev.off() 
; dev.list()| and it suggests there are no windows, but the window is 
still present and unresponsive. |dev.new()| does nothing. Additional 
plot expressions (base or grid) do nothing, no error or warning, no 
rendering.

Interestingly, when I do this with base graphics, the print dialog 
remains up and is now unresponsive. (Does it matter that it says ?no 
printer found??) When I repro this using |ggplot2|, the print dialog 
does go away when the error hits, suggesting it is slightly later in 
code execution?

Variations attempted:

  * R is just the default R installer, I have not compiled it or any of
    its components manually;
  * base graphics vs |ggplot2| grid, barely-different behavior, same failure
  * |ggplot2_3.5.2| installed from CRAN (source) and from p3m.dev (mac
    binary), same behavior
  * |kableExtra_1.4.0| installed from p3m.dev, and
    |remotes::install_github("haozhu233/kableExtra")| installed
    |1.4.0.15|, same behavior
  * R from the shell and R from emacs/ess
  * I tried |library(kableExtra); detach("package:kableExtra",
    unload=TRUE)| (no attempt to print) and it still erred/broke
  * though I think it was a red-herring, I have uninstalled XQuartz, no
    change
  * this has been in multiple versions of R-4.4, not just 4.4.3, and not
    just one download/install; I have not yet tried R-4.5
  * XCode updated itself to 16.2 (I don?t recall upgrading it), though I
    would not expect this to be an issue if I compiled neither R nor the
    packages using its compilers; I?m happy to be wrong here!

I do not think that the two packages have any collisions, 
|intersect(ls(getNamespace("ggplot2")), ls(getNamespace("kableExtra")))| 
yields nothing in common. But since this repros with base graphics 
without |ggplot2| loaded, that?s a non-player anyway.

I?m hoping someone here can help with a couple requests/questions:

  * can anyone else repro this on their machine, or is it just me?
  * any ideas of what I might try to recompile, reinstall, or otherwise
    debug or deep-dive to see if there are any clear markers of what is
    causing the error?

Thanks!
Bill
On 6/2/25 17:28, Kasper Daniel Hansen wrote:

            
&#8203;