[Win32utils-devel] [ win32utils-Bugs-21272 ] File.basename bug smoked out by WEBrick, Rails

noreply at rubyforge.org noreply at rubyforge.org
Sun Jul 27 15:19:44 EDT 2008


Bugs item #21272, was opened at 2008-07-18 14:48
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=411&aid=21272&group_id=85

Category: win32-file
Group: Code
Status: Open
Resolution: None
Priority: 5
Submitted By: Daniel Berger (djberg96)
Assigned to: Daniel Berger (djberg96)
Summary: File.basename bug smoked out by WEBrick, Rails

Initial Comment:
It looks like there's a bug in File.basename somewhere:

C:\>ruby script\server
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2008-07-18 15:29:55] INFO  WEBrick 1.3.1
[2008-07-18 15:29:55] INFO  ruby 1.8.6 (2007-09-24) [i386-mswin32]
[2008-07-18 15:29:55] INFO  WEBrick::HTTPServer#start: pid=2036 port=3000
c:/ruby/lib/ruby/gems/1.8/gems/win32-file-0.5.4/lib/win32/file.rb:434: [BUG] Segmentation fault
ruby 1.8.6 (2007-09-24) [i386-mswin32]


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

It was hard to track this down because adding print statemetns seemed to alter the behavior, but I did notice something like this:

♦¿d≈♥╚T≈♥security.so e_support/d

Regards,

me

----------------------------------------------------------------------

>Comment By: Daniel Berger (djberg96)
Date: 2008-07-27 12:19

Message:
Not sure what's happening now. I tried Rails 2.1 with win32-file 0.5.5, windows-pr 0.9.0 and win32-file-stat 1.2.7. With some debug print statements added to win32-file-stat, I narrowed it down to:

ERROR IN 'get_file_type' ON: C:\Documents and Settings\djberge\workspace\gym_tracker\config\routes.rb

This is strange because I can definitely stat that file. Thread issue perhaps?

Dan



----------------------------------------------------------------------

Comment By: Daniel Berger (djberg96)
Date: 2008-07-18 15:25

Message:
This error, which I pulled out of the debugger, may be related:

c:/ruby/lib/ruby/gems/1.8/gems/win32-file-stat-1.2.7/lib/win32/file/stat.rb:576: `unknown error - T' (SystemCa
llError)
        from c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/filters.rb:684:in `process
_without_session_management_support'
        from c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/session_management.rb:114:
in `process'
        from c:/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/rescue.rb:18:in `process_w
ith_exception'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/dispatcher.rb:46:in `dispatch'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/dispatcher.rb:136:in `failsafe_response'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/dispatcher.rb:44:in `dispatch'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/webrick_server.rb:113:in `handle_dispatch'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/webrick_server.rb:79:in `service'
        from c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
        from c:/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
        from c:/ruby/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
        from c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start'
        from c:/ruby/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
        from c:/ruby/lib/ruby/1.8/webrick/server.rb:95:in `start'
        from c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `each'
        from c:/ruby/lib/ruby/1.8/webrick/server.rb:92:in `start'
        from c:/ruby/lib/ruby/1.8/webrick/server.rb:23:in `start'
        from c:/ruby/lib/ruby/1.8/webrick/server.rb:82:in `start'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/webrick_server.rb:63:in `dispatch'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/commands/servers/webrick.rb:59
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `req
uire'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new
_constants_in'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `req
uire'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/commands/server.rb:39
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from script/server:3
c:/ruby/lib/ruby/gems/1.8/gems/win32-file-stat-1.2.7/lib/win32/file/stat.rb:576:            raise SystemCallEr
ror, get_last_error(error_num)

----------------------------------------------------------------------

Comment By: Daniel Berger (djberg96)
Date: 2008-07-18 15:01

Message:
Quick update - it's line 436 in 0.5.5:

file = file.split(0.chr).first

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=411&aid=21272&group_id=85


More information about the win32utils-devel mailing list