Re: Address Sanitizer with Ruby Nokogiri module/Gem

2018-05-19 Thread MK
OK got it to work. Compiled everything using GCC using these flags: -fsanitize=address to CFLAGS, CXXFLAGS and LDFLAGS On Saturday, May 19, 2018 at 1:52:12 PM UTC+2, MK wrote: > > Thanks! Ok so I should try to build everything either in gcc or clang. Can > you specify which configure flags I

Re: Address Sanitizer with Ruby Nokogiri module/Gem

2018-05-19 Thread Marcin Kozlowski
Thanks! Ok so I should try to build everything either in gcc or clang. Can you specify which configure flags I should use in gcc and which in clang? In Internet there is so many confusing answers. On Sat, 19 May 2018, 11:26 Yuri Gribov, wrote: > On Fri, May 18, 2018 at 11:05 PM, Konstantin Sereb

Re: Address Sanitizer with Ruby Nokogiri module/Gem

2018-05-19 Thread Yuri Gribov
On Fri, May 18, 2018 at 11:05 PM, Konstantin Serebryany wrote: > > > On Fri, May 18, 2018 at 2:30 PM MK wrote: >> >> Hi kcc, >> >> Thanks for your hint. It did get me further to some point. >> >> I successfully compiled Ruby, libxml2, libxst and Nokogiri with ASan, but >> when I run it I still g

Re: Address Sanitizer with Ruby Nokogiri module/Gem

2018-05-18 Thread Konstantin Serebryany
On Fri, May 18, 2018 at 2:30 PM MK wrote: > Hi kcc, > > Thanks for your hint. It did get me further to some point. > > I successfully compiled Ruby, libxml2, libxst and Nokogiri with ASan, but > when I run it I still get: > > ./ruby ../script.rb > Traceback (most recent call last): >

Re: Address Sanitizer with Ruby Nokogiri module/Gem

2018-05-18 Thread MK
Hi kcc, Thanks for your hint. It did get me further to some point. I successfully compiled Ruby, libxml2, libxst and Nokogiri with ASan, but when I run it I still get: ./ruby ../script.rb Traceback (most recent call last): 7: from ../script.rb:1:in `' 6: from /usr/loca

Re: Address Sanitizer with Ruby Nokogiri module/Gem

2018-05-18 Thread Konstantin Serebryany
I have zero experience with Ruby, but if it is any similar to Python then my recommendation is to build Ruby with AddressSanitizer. If the build breaks with an LSAN report, just disable LSAN during the build (ASAN_OPTIONS=detect_leaks=0) --kcc On Fri, May 18, 2018 at 3:15 AM MK wrote: > Hi al

Address Sanitizer with Ruby Nokogiri module/Gem

2018-05-18 Thread MK
Hi all, I am trying to compile Address Sanitizer in nokogiri Ruby gem. Compiled libxml2 and libxslt with Address Sanitizer like this: ./configure CFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" CXXFLAGS="-fsanitize=address,undefined -Wformat -Werr