buildd-manager crashes on ASCII NUL in build logtail
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
High
|
Colin Watson |
Bug Description
If a build emits ASCII NUL to its log, then buildd-manager fails the build with this traceback in the log:
Traceback (most recent call last):
File "/srv/launchpad
_inlineCall
File "/srv/launchpad
result = g.send(result)
File "/srv/launchpad
self.
File "/srv/launchpad
return _inlineCallback
--- <exception caught here> ---
File "/srv/launchpad
result = g.send(result)
File "/srv/launchpad
vitals.
File "/srv/launchpad
value = self.populate(
File "/srv/launchpad
bfj = self._build_
File "/srv/launchpad
self.
File "/srv/launchpad
self.flush()
File "/srv/launchpad
self.
File "/srv/launchpad
self.
File "/srv/launchpad
return Connection.
File "/srv/launchpad
raw_cursor = self.raw_
File "/srv/launchpad
return Connection.
File "/srv/launchpad
self.
File "/srv/launchpad
statement, params or ())
File "/srv/launchpad
return function(*args, **kwargs)
File "/srv/launchpad
attr(*args, **kwargs)
File "/srv/launchpad
statement, tuple(connectio
exceptions.
As far as I know, PostgreSQL's text type can't hold NUL bytes at all, so this isn't just a question of different escaping. We could migrate buildqueue.logtail to be a binary type instead, but its sole purpose is to be rendered in the web UI so I don't think there's much point in doing that. We should perhaps just remove NUL bytes before storing them instead.
Related branches
- William Grant (community): Approve (code)
-
Diff: 68 lines (+34/-2)2 files modifiedlib/lp/buildmaster/model/buildqueue.py (+5/-1)
lib/lp/buildmaster/tests/test_manager.py (+29/-1)
Changed in launchpad: | |
status: | Triaged → In Progress |
assignee: | nobody → Colin Watson (cjwatson) |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
Fixed in stable r18978 <http:// bazaar. launchpad. net/~launchpad- pqm/launchpad/ stable/ revision/ 18978>.