Issue Details (XML | Word | Printable)

Key: WARBLER-21
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Major Major
Assignee: Nick Sieger
Reporter: jpshackelford
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
warbler

War created on Linux Breaks on Windows with RackInitializationException: stack level too deep

Created: 19/Jan/11 03:57 PM   Updated: 04/Mar/11 07:11 AM   Resolved: 21/Jan/11 02:54 PM
Component/s: None
Affects Version/s: 1.2.1
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. File Gemfile (1 kB) 19/Jan/11 04:00 PM - jpshackelford
2. File Gemfile.lock (5 kB) 19/Jan/11 04:00 PM - jpshackelford
3. Text File rails3-warbler-win32.log (278 kB) 19/Jan/11 03:59 PM - jpshackelford
4. Text File test-outside-warbler.log (199 kB) 19/Jan/11 04:06 PM - jpshackelford
5. File warbler.rake (2 kB) 19/Jan/11 04:01 PM - jpshackelford

Environment:

Ubunutu 10.04, Windows XP


Tags:


 Description  « Hide

I have been creating a WAR with Warbler on Ubuntu and have had no problem running the executable WAR on Windows for the past few months. Just recently I ceased to be able to boot the application on Windows and I suspect it has something to do with a dependency that was introduced because we have added gems to the Gemfile and the error appears to be happening in the Bundler resolver.

I have turned on debugging both for jruby-rack and the bundler resolver and I have a attached the log.

I created a test project to attempt reproduce outside of Warbler but without success. On the Windows box where the War start up failed, I took the files Gemfile and Gemfile.lock and the gem directory from the WAR, put them into a test directory where the WAR start-up failed and ran the following:

puts path    = File.expand_path('../gems', __FILE__ )
puts gemfile = File.expand_path('../Gemfile', __FILE__)

ENV['GEM_HOME'] = path
ENV['GEM_PATH'] = path
ENV['DEBUG_RESOLVER'] = 'true'
ENV['BUNDLE_WITHOUT'] = 'development:test'

require 'rubygems'

begin
  ENV['BUNDLE_GEMFILE'] = gemfile
  require 'bundler'
  Bundler.setup
rescue Bundler::GemNotFound => e
  STDERR.puts e.message
  STDERR.puts "Try running `bundle install`."
  exit!
end if File.exist?(gemfile)

This code successfully activates the gems so it doesn't appear to be related to the specific gems on the Windows platform, but must instead have something to do with Warbler, JRuby-Rack or the specific version of JRuby bundled in the WAR.

Next I will try to drop my Gemfile, Gemfile.lock, and warbler.rake files into a brand new rails app to see if I get the same results. If so you should be able to reproduce in your own environment.



jpshackelford added a comment - 19/Jan/11 03:59 PM

By the way, I did rule out spaces in file names by placing the war at C:\ and setting TMP and TEMP to C:\temp. You will notice no spaces in any of the paths in the attached log.


Nick Sieger added a comment - 20/Jan/11 07:08 PM

We've heard increased reports of "stack level too deep" with Bundler lately. In fact, we bumped up the default stack size to -Xss2048k in JRuby master as of ea20ac17. Can you try running Warbler as follows:

jruby -J-Xss2048k -S warble ...

jpshackelford added a comment - 21/Jan/11 02:35 PM - edited

I started up my executable WAR as follows with success. Thanks!

java -Xss2048 -jar a_rails.war

Nick Sieger added a comment - 21/Jan/11 02:54 PM

Marking as won't fix since the only resolution is to bump up stack size (-Xss2048k).


elskwid added a comment - 04/Mar/11 07:11 AM

I just wanted to add something here in case people wind up at this issue from a search for stack problems on Windows (x64).

It is possible that the error is related to a problem with procron (Apache Commons Daemon). Versions prior to 1.0.4 had some issues running on Windows 64 and would expose this error - if you're running under Tomcat <= 6.0.29 you have an old version of procrun and need to upgrade.

I have a full write up over here: http://techblog.amphora-research.com/2011/03/tomcat-6-stack-level-too-deep-error-on-windows/