| Summary: | bitbake is unable to handle exceptions past the clean_environment() call | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] BitBake | Reporter: | Benjamin Esquivel <benjamin.esquivel> |
| Component: | bitbake | Assignee: | Aníbal Limón <anibal.limon> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | critical | ||
| Priority: | High | CC: | brian.avery, poky.bs.watcher, poky.watcher |
| Version: | unspecified | ||
| Target Milestone: | 2.2 M4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| See Also: | https://bugzilla.yoctoproject.org/show_bug.cgi?id=10397 | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
|
Description
Benjamin Esquivel
2016-10-07 22:10:20 UTC
An induced example of this bug can be found at the poky-contrib branch besquive/such-clean: http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=besquive/such-clean which places a handled exception right after the point where it will loop endlessly. it is worth noting that the exception could happen on further lines than this induced example, like with bug 10397. Forgot to add the steps to reproduce: 1. clone the git repo 2. get the code from the besquive/such-clean branch (stimulates an exception) http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=besquive/such-clean 3. run the init build env script 4. start a bitbake server, i.e. $ bitbake --server-only -t xmlrpc -B localhost:1234 5. watch the fireworks The loop is on,
File "/home/alimon/repos/pokyro/bitbake/lib/bb/event.py", line 158, in print_ui_queue
Due of that function is called atexit, if you move the registry of bb.event.LogHandler after bb.utils.clean_environment() it will fix the problem because clean_environment() is calling logger.debug, more investigation is needed.
diff --git a/bitbake/lib/bb/main.py b/bitbake/lib/bb/main.py
index 19ee729..992e879 100755
--- a/bitbake/lib/bb/main.py
+++ b/bitbake/lib/bb/main.py
@@ -435,19 +435,15 @@ def bitbake_main(configParams, configuration):
bb.msg.init_msgconfig(configParams.verbose, configuration.debug,
configuration.debug_domains)
+ # Clear away any spurious environment variables while we stoke up the cooker
+ cleanedvars = bb.utils.clean_environment()
+
# Ensure logging messages get sent to the UI as events
handler = bb.event.LogHandler()
if not configParams.status_only:
# In status only mode there are no logs and no UI
logger.addHandler(handler)
The bug is caused because bb.event.LogHandler adds events to ui_queue when is called causing an infinite loop when interate over ui_queue at print_ui_queue. Also happens in bitbake proceess not only server mode. |