YupingLu / biclique

Maximal Biclique Enumeration in Bipartite Graphs
https://github.com/YupingLu/biclique
GNU General Public License v2.0
21 stars 10 forks source link

devtools::run_examples() pass but devtools::check() fail on OSX #4

Closed YupingLu closed 7 years ago

YupingLu commented 7 years ago

Check Details

Version: 1.0.0 Check: examples Result: ERROR Running examples in ‘biclique-Ex.R’ failed The error most likely occurred in:

> ### Name: bi.clique
> ### Title: Biclique enumeration
> ### Aliases: bi.clique
> 
> ### ** Examples
> 
> bicliques = bi.clique(system.file("extdata", "example1.el", package = "biclique")) 

clang-UBSAN

bicliques = bi.clique(system.file("extdata", "example4.bmat", package = "biclique"), filetype = 1) bigraph.c:235:29: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' SUMMARY: AddressSanitizer: undefined-behavior bigraph.c:235:29 in bigraph.c:235:29: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' SUMMARY: AddressSanitizer: undefined-behavior bigraph.c:235:29 in biclique.c:164:17: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' SUMMARY: AddressSanitizer: undefined-behavior biclique.c:164:17 in biclique.c:176:21: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' SUMMARY: AddressSanitizer: undefined-behavior biclique.c:176:21 in biclique.c:194:21: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' SUMMARY: AddressSanitizer: undefined-behavior biclique.c:194:21 in

gcc-UBSAN

bicliques = bi.clique(system.file("extdata", "example4.bmat", package = "biclique"), filetype = 1) bigraph.c:235:29: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' bigraph.c:235:29: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' biclique.c:164:17: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' biclique.c:176:21: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' biclique.c:194:21: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

I have spent two days on this without any clue. Sigh :(

YupingLu commented 7 years ago

left shift error can be fixed with 1U << ((bit) & XBM) (change int 1 to unsigned int). devtools::check(check_dir = ".") works, but devtools::check() still fails. Why???

YupingLu commented 7 years ago

I finally find the bug. I used C's strcpy function in the code. The char array I defined is too short to store the temp filename which is longer than regular file.