GuangchuangYu / GuangchuangYu/hexSticker

example causes R segfault

Open
#13 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
813
Forks
179
Avg merge
45m
Merged PRs (30d)
1

Description

I came across this package a while ago and finally got around to taking it for a test drive. I was quite excited about making hex stickers for several of my own packages, but, unfortunately, upon trying it out today, I discovered I cannot even run the example (for working with image files) in the README relevant to my intended use case:

❯ imgurl <- "http://www.belleamibengals.com/bengal_cat_2.png"
❯ sticker(imgurl, package="hexSticker", p_size=8, s_x=1, s_y=.75, s_width=.6, filename="./imgfile.png")

 *** caught segfault ***
address 0x0, cause 'unknown'

Traceback:
 1: grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y,     resolveHJust(x$just, x$hjust), resolveVJust(x$just, x$vjust),     x$rot, x$check.overlap)
 2: drawDetails.text(x, recording = FALSE)
 3: drawDetails(x, recording = FALSE)
 4: drawGrob(x)
 5: recordGraphics(drawGrob(x), list(x = x), getNamespace("grid"))
 6: grid.draw.grob(x$children[[i]], recording = FALSE)
 7: grid.draw(x$children[[i]], recording = FALSE)
 8: drawGTree(x)
 9: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid"))
10: grid.draw.gTree(x$children[[i]], recording = FALSE)
11: grid.draw(x$children[[i]], recording = FALSE)
12: drawGTree(x)
13: recordGraphics(drawGTree(x), list(x = x), getNamespace("grid"))
14: grid.draw.gTree(gtable)
15: grid.draw(gtable)
16: print.ggplot(x)
17: print(x)
18: grid.draw.ggplot(plot)
19: grid.draw(plot)
20: ggsave(sticker, width = 43.9, height = 50.8, filename = filename,     bg = "transparent", units = "mm")
21: save_sticker(filename, sticker)
22: sticker(imgurl, package = "hexSticker", p_size = 8, s_x = 1,     s_y = 0.75, s_width = 0.6, filename = "./imgfile.png")

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

I'm not exactly sure what might be going on internally, so some help in diagnosing and resolving this problem would be much appreciated.

Here's the relevant session information:

❯ sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin16.6.0 (64-bit)
Running under: macOS Sierra 10.12.5

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] hexSticker_0.4.1     forcats_0.2.0        stringr_1.2.0.9000  
 [4] dplyr_0.7.2          purrr_0.2.2.2        readr_1.1.1         
 [7] tidyr_0.6.3          tibble_1.3.3         ggplot2_2.2.1       
[10] tidyverse_1.1.1.9000 devtools_1.13.2.9000 nima_0.4.0          
[13] fcuk_0.1.21          colorout_1.1-2       prompt_1.0.0        

loaded via a namespace (and not attached):
 [1] locfit_1.5-9.1       Rcpp_0.12.12         stringdist_0.9.4.4  
 [4] lubridate_1.6.0.9009 lattice_0.20-35      sysfonts_0.6        
 [7] fftwtools_0.9-8      png_0.1-7            clisymbols_1.2.0    
[10] gtools_3.5.0         assertthat_0.2.0     digest_0.6.12       
[13] psych_1.7.5          tiff_0.1-5           R6_2.2.2            
[16] cellranger_1.1.0     plyr_1.8.4           httr_1.2.1          
[19] rlang_0.1.1.9000     lazyeval_0.2.0       readxl_1.0.0        
[22] data.table_1.10.4    rstudioapi_0.6       ProjectTemplate_0.7 
[25] hexbin_1.27.1        boxes_0.0.0.9000     foreign_0.8-69      
[28] munsell_0.4.3        broom_0.4.2          compiler_3.4.1      
[31] modelr_0.1.0         gridGraphics_0.2     pkgconfig_2.0.1     
[34] BiocGenerics_0.22.0  mnormt_1.5-5         pkgbuild_0.0.0.9000 
[37] gridExtra_2.2.1      showtextdb_1.0       crayon_1.3.2.9000   
[40] withr_1.0.2          grid_3.4.1           nlme_3.1-131
[43] jsonlite_1.5         gtable_0.2.0         DBI_0.7             
[46] magrittr_1.5         scales_0.4.1.9002    stringi_1.1.5       
[49] reshape2_1.4.2       ggthemes_3.4.0       bindrcpp_0.2        
[52] xml2_1.1.1           EBImage_4.18.0       tools_3.4.1         
[55] showtext_0.4-6       glue_1.1.1           jpeg_0.1-8          
[58] hms_0.3              abind_1.4-5          pkgload_0.0.0.9000  
[61] parallel_3.4.1       colorspace_1.3-2     rvest_0.3.2         
[64] ggimage_0.0.4        memoise_1.1.0        bindr_0.1           
[67] haven_1.1.0   

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the image-file example in the README and reproduce the crash using sticker() with the reported sessionInfo. Trace the failure from sticker() through ggsave() and grid drawing; done means the example completes without a segfault and writes imgfile.png.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.