taskjuggler / TaskJuggler

TaskJuggler - Project Management beyond Gantt chart drawing
http://www.taskjuggler.org
GNU General Public License v2.0
732 stars 169 forks source link

Stack overflow due to cyclic dependency #184

Open ghost opened 8 years ago

ghost commented 8 years ago

bad.tjp.txt

When I apply Ubuntu 14 tj3 (v3.5.0) to the attached project file, I'm getting a scary stack overflow:

$ tj3 bad.tjp
Fatal: stack level too deep
/var/lib/gems/1.9.1/gems/taskjuggler-3.5.0/lib/taskjuggler/PropertyTreeNode.rb:692

*******************************************************************************
You have triggered a bug in TaskJuggler version 3.5.0!
Please see the user manual on how to get this bug fixed!
http://www.taskjuggler.org/tj3/manual/Reporting_Bugs.html#Reporting_Bugs_and_Feature_Requests
*******************************************************************************

/var/lib/gems/1.9.1/gems/taskjuggler-3.5.0/lib/taskjuggler/MessageHandler.rb:301:in `addMessage': RuntimeError (RuntimeError)
    from /var/lib/gems/1.9.1/gems/taskjuggler-3.5.0/lib/taskjuggler/MessageHandler.rb:190:in `fatal'
    from /var/lib/gems/1.9.1/gems/taskjuggler-3.5.0/lib/taskjuggler/MessageHandler.rb:312:in `fatal'
    from /var/lib/gems/1.9.1/gems/taskjuggler-3.5.0/lib/taskjuggler/Tj3AppBase.rb:161:in `rescue in main'
    from /var/lib/gems/1.9.1/gems/taskjuggler-3.5.0/lib/taskjuggler/Tj3AppBase.rb:127:in `main'
    from /var/lib/gems/1.9.1/gems/taskjuggler-3.5.0/lib/tj3.rb:16:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /var/lib/gems/1.9.1/gems/taskjuggler-3.5.0/bin/tj3:4:in `<top (required)>'
    from /usr/local/bin/tj3:23:in `load'
    from /usr/local/bin/tj3:23:in `<main>'

This is due to a cyclic dependency between tasks A and B.

If I start reducing the project (remove depends, etc.) it starts to detect cycle deps:

$ tj3 bad.tjp
bad.tjp:38: Warning: Dependency loop detected at start of task B.b===84%===   ]
bad.tjp:38: Info: Loop ctnd. at end of task B.b
bad.tjp:23: Info: Loop ctnd. at start of task A.d
bad.tjp:23: Info: Loop ctnd. at end of task A.d
bad.tjp:7: Info: Loop ctnd. at end of task A
bad.tjp:30: Info: Loop ctnd. at start of task B
bad.tjp:38: Error: Aborting

So perhaps TJ should be fixed to always report loop instead of aborting?

scrapper commented 8 years ago

It should definitely be fixed instead of crashing. But I need a test project to debug this. Please try again with 3.6.0 and send me a small test case to reproduce the problem.

Thanks!

ghost commented 8 years ago

I've attached the small repro project in bugreport (bad.tjp.txt). I don't have opportunity to test it with 3.6.0 (don't know Ruby at all). If that's a problem we can simply close as can't repro.

frphoebus commented 8 years ago

Hi,

Sorry to interfere but for you information , i can reproduce with 3.6.0 and Windows 7. (i cloned the github master branch today (14/08/2016) in zip format)

X:\taskJuggler>C:\Ruby22-x64\bin\ruby.exe c:\Ruby 22-x64\bin\tj3 bad.tjp TaskJuggler v3.6.0 - A Project Management Software

Copyright (c) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 by Chris Schlaeger cs@taskjuggler.org

This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation.

Reading file bad.tjp [ Done ] bad.tjp:38: Warning: Dependency loop detected at start of task B.b===84%=== ] bad.tjp:38: Info: Loop ctnd. at end of task B.b bad.tjp:23: Info: Loop ctnd. at start of task A.d bad.tjp:23: Info: Loop ctnd. at end of task A.d bad.tjp:7: Info: Loop ctnd. at end of task A bad.tjp:30: Info: Loop ctnd. at start of task B bad.tjp:38: Error: Aborting X:\taskJuggler>

Regards,