From: bar.hofesh@... Date: 2015-07-29T08:36:56+00:00 Subject: [ruby-core:70170] [Ruby trunk - Bug #11400] IO.gets(/\x0d?\x0a\x0d?\x0a/, 4096) raises comparison of Fixnum with nil failed Issue #11400 has been updated by Bar Hofesh. Looking at the code it's clear the offending line is https://github.com/ruby/ruby/blob/trunk/ext/openssl/lib/openssl/buffering.rb#L216 Where sometimes size would be nil, and because of "size = [size, limit].min" or more specifically So: `[nil, 4096].min ArgumentError: comparison of Fixnum with nil failed from (pry):1:in `each'` You should use size.to_i or something :) ---------------------------------------- Bug #11400: IO.gets(/\x0d?\x0a\x0d?\x0a/, 4096) raises comparison of Fixnum with nil failed https://bugs.ruby-lang.org/issues/11400#change-53598 * Author: Bar Hofesh * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- This is my code, "socket" is a SSLSocket this is why it allows a Regexp in gets `begin http_response[:http_headers] = WEBrick::Utils.timeout(3){ socket.gets(/\x0d?\x0a\x0d?\x0a/, 4096) #\r?\n\r?\n } rescue Errno::ECONNRESET return nil rescue Timeout::Error LOGGER_SYSLOG_SYSLOG.syslog_error('e', 'Timeout when reading aware') rescue Exception => e LOGGER_SYSLOG_SYSLOG.syslog_error('e', "Error Reading Aware: #{e}") retry unless socket.eof? || socket.closed? end` The error reads like this: "Error Reading Aware: comparison of Fixnum with nil failed" Which means it comes from this begin\rescue block, but there is nothing inside it which would compare a Fixnum with nil, so, I suspect that gets does it ? -- https://bugs.ruby-lang.org/