Many many warnings

[Sat Jul 29 10:40:30 2006] [warn] mod_fcgid: stderr:
/usr/lib/ruby/1.8/cgi/session.rb:312: warning: instance variable
@write_lock not initialized
[Sat Jul 29 10:40:30 2006] [warn] mod_fcgid: stderr:
/usr/lib/ruby/1.8/cgi/session.rb:315: warning: instance variable @data
not initialized
[Sat Jul 29 10:40:30 2006] [warn] mod_fcgid: stderr:
/usr/lib/ruby/1.8/cgi/session.rb:395: warning: instance variable @hash
not initialized

I run my fcgi script under ruby -w.
I don’t think these are related to the FileStore storage that I’m using,
rather the PStore. Is this something that can be fixed or am I doing it
wrong?

Hi,

At Sun, 30 Jul 2006 01:43:47 +0900,
Tom A. wrote in [ruby-talk:204896]:

I run my fcgi script under ruby -w.
I don’t think these are related to the FileStore storage that I’m using,
rather the PStore. Is this something that can be fixed or am I doing it
wrong?

Does this make it gentle?

Index: lib/cgi/session.rb

RCS file: /cvs/ruby/src/ruby/lib/cgi/session.rb,v
retrieving revision 1.23.2.15
diff -p -u -2 -r1.23.2.15 session.rb
— lib/cgi/session.rb 7 Mar 2005 00:20:15 -0000 1.23.2.15
+++ lib/cgi/session.rb 30 Jul 2006 01:07:01 -0000
@@ -302,7 +302,5 @@ class CGI
# Retrieve the session data for key +key+.
def

  •  unless @data
    
  • @data = @dbman.restore
  •  end
    
  •  @data ||= @dbman.restore
     @data[key]
    
    end
    @@ -310,10 +308,6 @@ class CGI

    Set the session date for key +key+.

    def []=(key, val)
  •  unless @write_lock
    
  • @write_lock = true
  •  end
    
  •  unless @data
    
  • @data = @dbman.restore
  •  end
    
  •  @write_lock ||= true
    
  •  @data ||= @dbman.restore
     @data[key] = val
    
    end
    @@ -375,5 +369,5 @@ class CGI
    def initialize(session, option={})
    dir = option[‘tmpdir’] || Dir::tmpdir
  •   prefix = option['prefix'] || ''
    
  • prefix = option[‘prefix’] || ‘’
    suffix = option[‘suffix’] || ‘’
    id = session.session_id
    @@ -381,5 +375,7 @@ class CGI
    md5 = Digest::MD5.hexdigest(id)[0,16]
    @path = dir+"/"+prefix+md5+suffix
  • unless File::exist? @path
  • if File::exist? @path
  • @hash = nil
    
  • else
    unless session.new_session
    raise CGI::Session::NoSession, “uninitialized session”
    cvs diff: Diffing lib/cgi/session
    Index: lib/cgi/session/pstore.rb
    ===================================================================
    RCS file: /cvs/ruby/src/ruby/lib/cgi/session/pstore.rb,v
    retrieving revision 1.3.2.5
    diff -p -u -2 -r1.3.2.5 pstore.rb
    — lib/cgi/session/pstore.rb 15 Dec 2004 01:54:37 -0000 1.3.2.5
    +++ lib/cgi/session/pstore.rb 30 Jul 2006 01:09:17 -0000
    @@ -15,15 +15,4 @@ require ‘pstore’
    class CGI
    class Session
  • def []=(key, val)
  •  unless @write_lock
    
  • @write_lock = true
  •  end
    
  •  unless @data
    
  • @data = @dbman.restore
  •  end
    
  •  #@data[key] = String(val)
    
  •  @data[key] = val
    
  • end
  • PStore-based session storage class.

@@ -54,5 +43,5 @@ class CGI
# This session’s PStore file will be created if it does
# not exist, or opened if it does.

  •  def initialize session, option={}
    
  •  def initialize(session, option={})
    
    dir = option[‘tmpdir’] || Dir::tmpdir
    prefix = option[‘prefix’] || ‘’
    @@ -62,5 +51,7 @@ class CGI
    path = dir+"/"+prefix+md5
    path.untaint
  • unless File::exist?(path)
  • if File::exist?(path)
  • @hash = nil
    
  • else
    unless session.new_session
    raise CGI::Session::NoSession, “uninitialized session”

Hi,

In message “Re: many many warnings…”
on Sun, 30 Jul 2006 10:11:54 +0900, [email protected] writes:

|At Sun, 30 Jul 2006 01:43:47 +0900,
|Tom A. wrote in [ruby-talk:204896]:
|> I run my fcgi script under ruby -w.
|> I don’t think these are related to the FileStore storage that I’m using,
|> rather the PStore. Is this something that can be fixed or am I doing it
|> wrong?
|
|Does this make it gentle?

Hmm, can you check in?

						matz.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs