History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-1342
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Robin Shen
Reporter: Dmitry Ivanov
Votes: 0
Watchers: 0
Operations

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

Bad script is breaking Quickbuild

Created: 15/Aug/12 08:35 AM   Updated: 18/Aug/12 01:31 AM
Component/s: None
Affects Version/s: 4.0.45
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Zip Archive backup.db.zip (17 kb)

Environment: windows, linux


 Description  « Hide
Hello, I found one bug in QB.

We have next configuration structure:
proj_name
 |---internal
 | |--linux
 | |--windows
 |
 |--release
 | |--linux
 | |--windows

Configuration "proj_name" contains version(e.g. 1.0.0.0).
 "proj_name" trigger sub configurations "internal" and "release". This configurations trigger sub conf "linux" and "windows".

For calculating new version in sub configurations owner of this config made script:
${if (vars.getValue("parentBuildVersion") != null) {vars.getValue("parentBuildVersion");\} else {configuration.getParent().getNextVersion(false);\}}

"parentBuildVersion" variable setting up when this config triggered from parent level.

If we run "proj_name" all works fine. If we run "internal" all works fine.
But when we run "windows" Quickbuild instance is taking all availabele memory and some times restarting.

In our production server we spent lot of time to find reason of this restarts.
I know this script is very messy but I hope another behaviour of QB for such errors.

P.s I'm sorry for my english

 All   Comments   Work Log   Change History      Sort Order:
Robin Shen [15/Aug/12 09:22 AM]
I tried but can not get the problem reproduced. Can you please send me a minimized database demonstrating the issue?

Thanks

Dmitry Ivanov [15/Aug/12 09:37 AM]
DB was attached.
try to run root/proj_name/internal/linux

Robin Shen [16/Aug/12 12:37 AM]
Thanks for the backup. I did get the problem reproduced now. Since when calculating next build version, QB calls "configuration.getNextVersion(false)" and in your script the "getNextVersion(false)" is called again which result in an infinite loop. Since we allow arbitrary script to run, we can not avoid such behavior and the script author needs to be careful not to introduce any infinite loops.

Dmitry Ivanov [17/Aug/12 09:10 AM]
I don't understand why it is infinity loop.
For this structure:
 root/proj_name/internal/linux

When we run linux it is execute
configuration.getParent().getNextVersion(false);

It is get version on "proj_name" configuration. For calc new version in "proj_name" execute this script again but now on "root" conf.

Or I'm miss something?

Robin Shen [18/Aug/12 01:31 AM]
Because "configuration" always refer to the configuration currently being running. So "configuration.getParent().getNextVersion(false)" calculates next version for "root/proj_name/internal", and while calculating this, it calls itself again and again.