<< Back to previous view

[QB-1342] Bad script is breaking Quickbuild
Created: 15/Aug/12  Updated: 18/Aug/12

Status: Resolved
Project: QuickBuild
Component/s: None
Affects Version/s: 4.0.45
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Dmitry Ivanov Assigned To: Robin Shen
Resolution: Fixed Votes: 0
Remaining Estimate: Unknown Time Spent: Unknown
Original Estimate: Unknown
Environment: windows, linux

File Attachments: Zip Archive backup.db.zip    

 Description   
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

 Comments   
Comment by 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
Comment by Dmitry Ivanov [ 15/Aug/12 09:37 AM ]
DB was attached.
try to run root/proj_name/internal/linux
Comment by 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.
Comment by 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?
Comment by 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.
Generated at Mon May 20 23:34:33 UTC 2024 using JIRA 189.