Permalink
Commits on Feb 15, 2011
  1. Free vasprintf() results with Ruby Enterprise Edition's system_free()…

    FooBarWidget committed Feb 15, 2011
    … API if possible, and fix some potential memory leaks while we're at it.
    
    REE uses tcmalloc by default, but on OS X libc's vasprintf() allocates
    memory with the system's malloc() function instead of tcmalloc's. If we
    were to free its result with tcmalloc's free(), it will cause a crash.
    This commit makes use of REE system_free() function to free vasprintf()
    results. More info: https://github.com/FooBarWidget/rubyenterpriseedition187-330/blob/release/system_allocator.c
    
    Some functions also leak string memory if an exception is raised. This
    patch makes sure those strings are freed no matter what.
Commits on Feb 4, 2011
  1. Fix Memory Leak in xml_io.c

    ender672 authored and tenderlove committed Feb 4, 2011
    This example will use up all system memory:
    
      require 'nokogiri'
    
      class BadIO
        def read(*args)
          raise 'hell'
        end
      end
    
      100000000.times do
        Nokogiri::XML.parse(BadIO.new) rescue nil
      end
    
    The example above is obscure, but imagine an HTTP object raising TimeoutError. Nokogiri leaks memory every time this happens.
    
    I became suspicious of this when looking at ext/nokogiri/xml_io.c. io_read_callback() is invoked in the middle of some libxml operation, which may not behave well when a ruby exception is thrown and it gets interrupted. It seems that the safe way to handle this is to wrap the method call in rb_rescue.
    
    Note that the same applies to io_write_callback() in xml_io.c. Although I did not notice a memory leak with io_write_callback(), wrapping with rb_rescue() seems like the correct thing to do in both cases.
    
    A side effect of this fix is that IO errors will be silently discarded.
Commits on Feb 2, 2011
  1. opting in to .gemtest

    tenderlove committed Feb 2, 2011
  2. updating readme, fixes #411

    tenderlove committed Feb 2, 2011
Commits on Feb 1, 2011
  1. Added test for exception handling code

    dparnell authored and yokolet committed Jan 4, 2011
Commits on Jan 31, 2011
  1. Fix typo

    drbrain committed Jan 31, 2011
  2. Shorten long lines

    drbrain committed Jan 31, 2011
  3. Work around rake not understanding platforms, allows Nokogiri to buil…

    drbrain committed Jan 31, 2011
    …d on jruby with rubygems 1.4+
Commits on Jan 28, 2011
  1. nodoc jruby?

    tenderlove committed Jan 28, 2011
  2. specify the lib_dir

    tenderlove committed Jan 28, 2011
  3. no needto check for java

    tenderlove committed Jan 28, 2011
  4. switch to RbConfig

    tenderlove committed Jan 28, 2011
  5. removing unused codes

    tenderlove committed Jan 28, 2011
Commits on Jan 27, 2011
  1. bumping to beta 4

    tenderlove committed Jan 27, 2011
  2. updating gitignore

    tenderlove committed Jan 27, 2011
  3. add `check_extra_deps` as a prerequisite to `test`. Deveopment depend…

    tenderlove committed Jan 24, 2011
    …encies will be installed automatically if they do not exist
  4. Reword.

    knu authored and tenderlove committed Jan 20, 2011
  5. Translate.

    knu authored and tenderlove committed Jan 20, 2011
  6. Use better, realistic approach for detecting the end of <head> part i…

    knu authored and tenderlove committed Jan 20, 2011
    …n encoding detection.
    
    Since </head> and <body> are easily forged by libxml2's HTML parser,
    we cannot reliably use those events to see when <head> part actually
    ends.
Commits on Jan 26, 2011
Commits on Jan 25, 2011