FIX: Stack overflow when running railroad
Reported by phedders | June 12th, 2008 @ 10:16 PM | in Hobo 0.8
This problem may be linked to: http://hobocentral.net/forum/viewtopic.php?t=4264
It can be demonstrated by just creating an empty hobo app. Do a hobo_migration and setup the db.
Now run railroad -M ie
railroad -M |neato -Tpng >> diagram-models.png
And get this error as it tries to parse the models:
/home/prh/gits/iadb-3/vendor/rails/activerecord/lib/../../activesupport/lib/active_support/core_ext/array/extract_options.rb:14:in
extract_options!': stack level too deep (SystemStackError)
from
/home/prh/gits/iadb-3/vendor/plugins/hobo/lib/hobo/model.rb:185:in
attr_accessor_without_rich_types'
from
/home/prh/gits/iadb-3/vendor/plugins/hobofields/lib/hobo_fields/model_extensions.rb:48:in
attr_accessor_without_creator_metadata' from
/home/prh/gits/iadb-3/vendor/plugins/hobo/lib/hobo/model.rb:194:in
attr_accessor_without_rich_types'
from
/home/prh/gits/iadb-3/vendor/plugins/hobofields/lib/hobo_fields/model_extensions.rb:48:in
attr_accessor_without_creator_metadata' from
/home/prh/gits/iadb-3/vendor/plugins/hobo/lib/hobo/model.rb:194:in
attr_accessor_without_rich_types'
from
/home/prh/gits/iadb-3/vendor/plugins/hobofields/lib/hobo_fields/model_extensions.rb:48:in
attr_accessor_without_creator_metadata' from
/home/prh/gits/iadb-3/vendor/plugins/hobo/lib/hobo/model.rb:194:in
attr_accessor_without_rich_types'
from
/home/prh/gits/iadb-3/vendor/plugins/hobofields/lib/hobo_fields/model_extensions.rb:48:in
attr_accessor_without_creator_metadata' ... 4028 levels...
from
/var/lib/gems/1.8/gems/railroad-0.5.0/bin/railroad:36:in
new'
from /var/lib/gems/1.8/gems/railroad-0.5.0/bin/railroad:36 from
/var/lib/gems/1.8/bin/railroad:19:in `load' from
/var/lib/gems/1.8/bin/railroad:19
git-submodule
ebab8306335bf653d97094013373ac6390149340 vendor/hobo
(v0.7.5-199-gebab830) c8da518bbfedc2a06b1d96912ddae00e57f21748
vendor/rails (v2.0.2)
Comments and changes to this ticket
-
Tom Locke July 29th, 2008 @ 10:22 AM
- Assigned user set to Tom Locke
- State changed from new to open
- Tag cleared.
- Milestone set to Hobo 0.8
-
Tom Locke August 5th, 2008 @ 10:14 AM
- Title changed from attribute accessor weirdy to Stack overflow when running railroad
- Tag set to defect, misc
-
Matt Jones August 8th, 2008 @ 12:09 PM
This is caused by Railroad reloading all the files in app/models. It calls require for each file, which has already been loaded by the auto-routing code.
Quick fix for this is to comment out the Hobo.add_routes line from routes.rb, and then run railroad.
However, this also occurs if you do an explicit require of any model - you can get a stack overflow by doing
require 'app/models/user'
in a default Hobo script/console.
-
Matt Jones August 8th, 2008 @ 01:51 PM
- Title changed from Stack overflow when running railroad to FIX: Stack overflow when running railroad
One further note; this behavior is consistent with Rails, which will double-include a model if you autoload it and then explicitly require it.
One can also patch the railroad file models_diagram.rb, line 40 to use the correct loading mechanism:
files.each {|m| Dependencies.require_or_load m }
rather than just 'require'.
Following up to Railroad tracker as well.
--Matt
-
Tom Locke August 8th, 2008 @ 05:10 PM
- State changed from open to wontfix
Thanks for looking into this Matt. Looks like this is a wontfix
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป