From: Akinori MUSHA Date: 2004-12-07T15:14:54+09:00 Subject: [ruby-dev:25096] double free problem  ご無沙汰しております。  最近の ruby 1.8 で、以下のようなスクリプトで double free が起きて います。プラットフォームは FreeBSD 4.10-STABLE 及び 5.3-STABLE です。 1.8.2-preview2 までは発生せず、間はわかりませんが 1.8.2-preview3 以降は発生しています。 knu@daemon[2]% cat test.rb require 'dl/import' module LIBC PATH_MAX = 1024 extend DL::Importable dlload "libc.so" extern "char *realpath(char *, char *)" end def File.realpath(path) return LIBC.realpath(path[0...(LIBC::PATH_MAX - 1)], "\0" * LIBC::PATH_MAX) || File.expand_path(path) end p File.realpath("/home/knu/tmp/foo") knu@daemon[2]% ruby test.rb ruby in free(): warning: chunk is already free "/home/knu/tmp/bar" -- / /__ __ Akinori.org / MUSHA.org / ) ) ) ) / FreeBSD.org / Ruby-lang.org Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp "It seems to me as we make our own few circles 'round the sun We get it backwards and our seven years go by like one"