From: Alex Fenton Date: 2009-01-06T08:54:03+09:00 Subject: [ruby-core:21161] [Bug #985] profile lib + iterator => 'NULL pointer given' (ArgumentError) Bug #985: profile lib + iterator => 'NULL pointer given' (ArgumentError) http://redmine.ruby-lang.org/issues/show/985 Author: Alex Fenton Status: Open, Priority: High Reproducible Version: 1.9.1 RC1 This simple piece of code works as expected: iter = 'abc'.each_char p iter.next => "a" However, if the profile library is required before this (either by -rprofile on the command line or require 'profile') it crashes with an unexpected 'NULL pointer given' error: ruby -rprofile bug.rb % cumulative self self total time seconds seconds calls ms/call ms/call name 0.00 0.00 0.00 2 0.00 0.00 IO#set_encoding 0.00 0.00 0.00 1 0.00 0.00 String#each_char 0.00 0.00 0.00 1 0.00 0.00 Kernel.proc 0.00 0.00 0.00 1 0.00 0.00 Exception#backtrace 0.00 0.00 0.00 1 0.00 0.00 Exception#set_backtrace 0.00 0.01 0.00 1 0.00 10.00 #toplevel bug.rb:2:in `next': NULL pointer given (ArgumentError) from bug.rb:2:in `
' Thanks. ---------------------------------------- http://redmine.ruby-lang.org