Uzbl

Tasklist

FS#281 - uzbl-tabbed errors with certain cookies on add_cookie event

Attached to Project: Uzbl
Opened by Richard Anderson (GargoyleGrin) - 2011-09-02 11:38:14 PM
Last edited by Brendan Taylor (bct) - 2012-11-25 10:10:28 PM
Task Type Bug Report
Category uzbl-tabbed
Status Closed
Assigned To No-one
Operating System Linux
Severity Medium
Priority Normal
Reported Version Development
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This error seems to be intermittent and even when it does occur, it intermittently results in undesirable symptoms (other than printing a traceback to standard error, that is.)

Traceback (most recent call last):
File "/usr/bin/uzbl-tabbed", line 314, in _socket_recv
self._feed(self._socket.recv(1024)) #TODO: is io_add_watch edge or level-triggered ?
File "/usr/bin/uzbl-tabbed", line 339, in _feed
self.handle_event(cmd)
File "/usr/bin/uzbl-tabbed", line 342, in handle_event
cmd = parse_event(cmd)
File "/usr/bin/uzbl-tabbed", line 392, in parse_event
return [unquote(p) for p in _splitquoted.split(text) if p.strip()]
File "/usr/bin/uzbl-tabbed", line 387, in unquote
return s.encode('utf-8').decode('string_escape').decode('utf-8')
UnicodeDecodeError: 'utf8' codec can't decode byte 0x91 in position 1480: invalid start byte

There are no non-ascii characters in the offending cookies.txt file.

I found out this was an add_cookie event error by placing a "print(cmd)" in my uzbl-tabbed script on line 339 just above the "handle_event(cmd)" invocation. Here was the pertinent output:

EVENT [9060-1] COMMAND_EXECUTED add_cookie '.adnxs.com' '/' 'acb707389' 'I.#kI/7ZDOhe6!!!!!B?p+0?enc=AJhr0QI04T_M6DaX0T7dPwAAAAAAAABAzOg2l9E-3T__l2vRAjThP7xjVMwUeN5GiLph1c5TPzgfNtdNAAAAADELAQBWAAAAZAAAAAIAAAAHEgUAiWMAAAEAAABVU0QAVVNEANgCWgABDQ8Azw4BAQUCAAMAAAAAeSBS6AAAAAA.&tt_code=guest_albums_media&udj=uf%28%27a%27%2C+27%2C+1305949727%29%3Buf%28%27g%27%2C+1079%2C+1305949727%29%3Buf%28%27r%27%2C+332295%2C+1305949727%29%3Bppv%2882%2C+%275106651058207482812%27%2C+1305949727%2C+1316317727%2C+66645%2C+25481%29%3Bppv%2884%2C+%275106651058207482812%27%2C+1305949727%2C+1316317727%2C+66645%2C+25481%29%3Bppv%2811%2C+%275106651058207482812%27%2C+1305949727%2C+1316317727%2C+66645%2C+25481%29%3Bppv%2882%2C+%275106651058207482812%27%2C+1305949727%2C+1316317727%2C+66645%2C+25481%29%3Bppv%2884%2C+%275106651058207482812%27%2C+1305949727%2C+1316317727%2C+66645%2C+25481%29%3Bppv%2887%2C+%275106651058207482812%27%2C+1305949727%2C+1306036127%2C+66645%2C+25481%29%3Bppv%28619%2C+%275106651058207482812%27%2C+1305949727%2C+1306036127%2C+66645%2C+25481%29%3Bppv%28620%2C+%275106651058207482812%27%2C+1305949727%2C+1306036127%2C+66645%2C+25481%29%3Bppv%28621%2C+%275106651058207482812%27%2C+1305949727%2C+1306036127%2C+66645%2C+25481%29%3B&cnd=!DCEMvAjViAQQh6QUGAAgiccBMAM4gRpAAEhkUABYAGDwBmgAcAB4AIABAIgBAJABAZgBAaABA6gBA7ABCrkBn0d7cgM04T_BAZ9He3IDNOE_yQFSuB6F61HyP9ABANABUtABVNkBAAAAAAAA8D_gAYIQ&ccd=!QgSCIwjViAQQh6QUGInHASAA&custom_macro=ADV_FREQ%5E0%5EREM_USER%5E0%5ECP_ID%5E66645" "http" "1306036127"&longitude&-9�'

This appears to be the offending line in my cookies.txt:

.adnxs.com TRUE / FALSE 1306036127 acb707389 @[I.#kI/7ZDOhe6!!!!!B?p+0?enc=AJhr0QI04T_M6DaX0T7dPwAAAAAAAABAzOg2l9E-3T__l2vRAjThP7xjVMwUeN5GiLph1c5TPzgfNtdNAAAAADELAQBWAAAAZAAAAAIAAAAHEgUAiWMAAAEAAABVU0QAVVNEANgCWgABDQ8Azw4BAQUCAAMAAAAAeSBS6AAAAAA.&tt_code=guest_albums_media&udj=uf%28%27a%27%2C+27%2C+1305949727%29%3Buf%28%27g%27%2C+1079%2C+1305949727%29%3Buf%28%27r%27%2C+332295%2C+1305949727%29%3Bppv%2882%2C+%275106651058207482812%27%2C+1305949727%2C+1316317727%2C+66645%2C+25481%29%3Bppv%2884%2C+%275106651058207482812%27%2C+1305949727%2C+1316317727%2C+66645%2C+25481%29%3Bppv%2811%2C+%275106651058207482812%27%2C+1305949727%2C+1316317727%2C+66645%2C+25481%29%3Bppv%2882%2C+%275106651058207482812%27%2C+1305949727%2C+1316317727%2C+66645%2C+25481%29%3Bppv%2884%2C+%275106651058207482812%27%2C+1305949727%2C+1316317727%2C+66645%2C+25481%29%3Bppv%2887%2C+%275106651058207482812%27%2C+1305949727%2C+1306036127%2C+66645%2C+25481%29%3Bppv%28619%2C+%275106651058207482812%27%2C+1305949727%2C+1306036127%2C+66645%2C+25481%29%3Bppv%28620%2C+%275106651058207482812%27%2C+1305949727%2C+1306036127%2C+66645%2C+25481%29%3Bppv%28621%2C+%275106651058207482812%27%2C+1305949727%2C+1306036127%2C+66645%2C+25481%29%3B&cnd=!DCEMvAjViAQQh6QUGAAgiccBMAM4gRpAAEhkUABYAGDwBmgAcAB4AIABAIgBAJABAZgBAaABA6gBA7ABCrkBn0d7cgM04T_BAZ9He3IDNOE_yQFSuB6F61HyP9ABANABUtABVNkBAAAAAAAA8D_gAYIQ&ccd=!QgSCIwjViAQQh6QUGInHASAA&custom_macro=ADV_FREQ%5E0%5EREM_USER%5E0%5ECP_ID%5E66645

It appears that somehow extra characters were appended to the end of the cookie text, including some non-ascii characters that shouldn't be there?

So far, all of the offending cookies I've found are from .adnxs.com (which is owned by an online advertising company.)

The intermittent symptoms I referenced above are that the uzbl-tabbed window will appear as a result of running uzbl-tabbed, but uzbl-browser will not run within it. The reason I believe this to be merely a symptom of the add_cookie exception rather than an entirely separate issue is that my "print cmd" statement was not reached after the traceback. That is, no other events were handled by uzbl-tabbed after the traceback occurred. I'd find this unlikely if the UnicodeDecodeError was unrelated.

So far I have been unable to reproduce the issue by running uzbl-browser directly without uzbl-tabbed.

Thanks to bct for assistance tracking the issue down as far as it has been.

I'll try to get a chance to track this down further, but I can't promise anything for the short term. Please let me know if there's any other information I can provide.
This task depends upon

Closed by  Brendan Taylor (bct)
2012-11-25 10:10:28 PM
Reason for closing:  Works for me
Additional comments about closing:  It's been a while since I've seen this kind of corruption. Please reopen if this still occurs.

Loading...