Aníbal Rojas
2005-Nov-02 14:36 UTC
Windows, Segmentation Faults, config.load_paths and config.cache_classes
I am doing some testing with the rails trunk, version I switched to because of memory leaks in 0.13.1 under linux environment. Right now the application is running fast and steady under linux, with no memory leaks using SCGI Rails Runner 0.4.3 from Zed, BUT it has become unusable under Windows (our main development environment) where I am getting a lot of segmentation faults. BUT the problem started under windows with Rails being unable finding the libraries I added into the load path: config.load_paths += %W( #{RAILS_ROOT}/app/services #{RAILS_ROOT}/vendor/feedtools/lib #{RAILS_ROOT}/vendor/uuidtools/lib ) As Rails can''t find these libraries, it generates a "uninitialized constant Blog" wich is the first Model it tries to load. We got rid of this problem setting config.cache_classes = false in the environment.rb, but then came the problem with the segmentation faults as I am describing below: SCGI 0.4.3 under Windows 2k ========================== At first request I got the "uninitialized constant Blog" mentioned above Subsequent requests are handled ok, until a few request after, when SCGI crashes with: ./config/../vendor/rails/actionpack/lib/action_controller/code_generation.rb:87: [BUG] Segmentation fault ruby 1.8.2 (2004-12-25) [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. Webrick under Windows 2k ======================= In environment.rb I tried uncommenting the ENV to force production mode: # Uncomment below to force Rails into production mode # (Use only when you can''t set environment variables through your web/app server) ENV[''RAILS_ENV''] = ''production'' But the log generated is development.log, so it actually didn''t force the production mode, under development mode: At first request I first got the same "uninitialized constant Blog" One subsequent requests is handled ok, on the next request webrick crashes: 127.0.0.1 - - [02/Nov/2005:09:29:55 Hora estßndar de SudamÚrica O.] "GET /javasc ripts/prototype.js HTTP/1.1" 200 28979 http://localhost:3000/blogs/updated -> /javascripts/prototype.js ./script/../config/../vendor/rails/actionpack/lib/action_controller/code_generat ion.rb:68: [BUG] Segmentation fault ruby 1.8.2 (2004-12-25) [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. Finally I setted RAILS_ENV=production, and the Rails did started in production mode with the same result. This behavior is repeated each time, and it looks like the problem is somewhere in code_generation.rb, but I am not really sure how to troubleshoot this... -- Aníbal Rojas anibalrojas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Aníbal Rojas
2005-Nov-02 18:18 UTC
Re: Windows, Segmentation Faults, config.load_paths and config.cache_classes
Update, we set up the app in a different Windows 2000 box and it did no generated Segmentation Fault. We are going to keep testing in order to find the differences between the environments that are producing the crashes. -- Aníbal Rojas anibalrojas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org On 11/2/05, Aníbal Rojas <anibalrojas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am doing some testing with the rails trunk, version I switched to > because of memory leaks in 0.13.1 under linux environment. > > Right now the application is running fast and steady under linux, with > no memory leaks using SCGI Rails Runner 0.4.3 from Zed, BUT it has > become unusable under Windows (our main development environment) where > I am getting a lot of segmentation faults. > > BUT the problem started under windows with Rails being unable finding > the libraries I added into the load path: > > config.load_paths += %W( #{RAILS_ROOT}/app/services > #{RAILS_ROOT}/vendor/feedtools/lib > #{RAILS_ROOT}/vendor/uuidtools/lib > ) > > As Rails can''t find these libraries, it generates a "uninitialized > constant Blog" wich is the first Model it tries to load. > > We got rid of this problem setting config.cache_classes = false in the > environment.rb, but then came the problem with the segmentation faults > as I am describing below: > > > SCGI 0.4.3 under Windows 2k > ==========================> > At first request I got the "uninitialized constant Blog" mentioned above > > Subsequent requests are handled ok, until a few request after, when > SCGI crashes with: > > ./config/../vendor/rails/actionpack/lib/action_controller/code_generation.rb:87: > [BUG] Segmentation fault > ruby 1.8.2 (2004-12-25) [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. > > > Webrick under Windows 2k > =======================> > In environment.rb I tried uncommenting the ENV to force production mode: > > # Uncomment below to force Rails into production mode > # (Use only when you can''t set environment variables through your > web/app server) > ENV[''RAILS_ENV''] = ''production'' > > But the log generated is development.log, so it actually didn''t force > the production mode, under development mode: > > At first request I first got the same "uninitialized constant Blog" > > One subsequent requests is handled ok, on the next request webrick crashes: > > 127.0.0.1 - - [02/Nov/2005:09:29:55 Hora estßndar de SudamÚrica O.] "GET /javasc > ripts/prototype.js HTTP/1.1" 200 28979 > http://localhost:3000/blogs/updated -> /javascripts/prototype.js > ./script/../config/../vendor/rails/actionpack/lib/action_controller/code_generat > ion.rb:68: [BUG] Segmentation fault > ruby 1.8.2 (2004-12-25) [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. > > Finally I setted RAILS_ENV=production, and the Rails did started in > production mode with the same result. > > This behavior is repeated each time, and it looks like the problem is > somewhere in code_generation.rb, but I am not really sure how to > troubleshoot this... > > -- > Aníbal Rojas > anibalrojas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org >