# Many many warnings

**URL:** <https://www.ruby-forum.com/t/many-many-warnings/100507>\
**Category:** Ruby\
**Created:** [July 29, 2006, 6:45pm UTC](https://www.ruby-forum.com/t/many-many-warnings/100507 "2006-07-29T18:45:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@tma](https://www.ruby-forum.com/u/tma)\
**Post date:** [July 29, 2006, 6:45pm UTC](https://www.ruby-forum.com/t/many-many-warnings/100507/1 "2006-07-29T18:45:41Z")

</div>

[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?

---

<div class="post-metadata">

**Author:** ![tma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@tma](https://www.ruby-forum.com/u/tma)\
**Post date:** [July 30, 2006, 3:14am UTC](https://www.ruby-forum.com/t/many-many-warnings/100507/2 "2006-07-30T03:14:42Z")

</div>

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”

---

<div class="post-metadata">

**Author:** ![tma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@tma](https://www.ruby-forum.com/u/tma)\
**Post date:** [July 30, 2006, 3:26pm UTC](https://www.ruby-forum.com/t/many-many-warnings/100507/3 "2006-07-30T15:26:41Z")

</div>

Hi,

In message “Re: many many warnings…”  
on Sun, 30 Jul 2006 10:11:54 +0900, removed\_email\_address@domain.invalid 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.
```
