Hello, guest. We have noticed that you are not registered at this bug tracker. Your experience will be greatly enhanced if you log in. To do so, you first must register by clicking on the Register tab at the top. If you are already registered, you can login at the Login tab.
Syndicate Syndicate Listing Display Search Login/Register
Bug Id ?
220
Reporter ?
Alan Pinstein
MacGDBp / 1.4
Status ?
Unconfirmed
Severity ?
Critical
Duplicate Of ?
- none -
Fixed in Revision ?
Mstone ?
Summary ?
MagGDBp is "hanging" frequently while debugging
Report Time ?
March 18, 2011 03:22 PM
Assignment ?
Resolution ?
Open
Priority ?
Normal
Dependencies ?
- none -
Mstone (old) ?


Votes
For: 3 (100%)
Against: 0 (0%)
Total: 3

March 18, 2011 03:22 PM Alan Pinstein
While debugging, I am often running into situations where "stepping" stops working. It looks like it's getting confused on a "step" as the variable inspector goes blank, and then stepping no longer works. The stack looks accurate, though. There is no beach ball, just it's hung. Hitting STOP works in that the STOP button will be greyed out but PHP is still stuck. If you then QUIT, it works though, no need to force-quit, and at that point the PHP process under debug "continues".

It seems to be repeatable; that is if you completely restart MacGDBp it will hang in the exact same spot.

I've gotten some info from the connection log for you that will hopefully help.

This is the XML of the last successful RECV.
<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="source"
transaction_id="27"
encoding="base64"><![CDATA[PD9waHAKCmludGVyZmFjZSBXRk1vZGVsQnVpbGRlcgp7CiAgICAvLyBnZXQgYSBXRk1vZGVsRW50aXR5IGZvciB0aGUgZ2l2ZW4gZW50aXR5IG5hbWUKICAgIGZ1bmN0aW9uIGJ1aWxkRW50aXR5TW9kZWwoJGVudGl0eSk7Cn0KCi8vIFBIT0NPQSBXRk1vZGVsIENsYXNzIFN0cnVjdHVyZSAtLSBpbnRlcm5hbCByZXByZXNlbnRhdGlvbiBvZiB0aGUgb2JqZWN0IG1vZGVsLiBEZWNvdXBsZWQgZnJvbSB0aGUgaW1wbGVtZW50YXRpb25zLgpjbGFzcyBXRk1vZGVsIGV4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F0aW9uc2hpcHM6CiAgICAgICAgICAgIC8vICAgICBCbG9nUHJlZmVyZW5jZXM6CiAgICAgICAgICAgIC8vICAgICAgIG1pbkNvdW50OiAwCiAgICAgICAgICAgIC8vICAgICAgIG1heENvdW50OiBOVUxMCiAgICAgICAgICAgIC8vICAgICAgIGlzRXh0ZW5zaW9uOiB0cnVlCgogICAgICAgICAgICAvLyBhcHBseSBjb25maWcKICAgICAgICAgICAgZm9yZWFjaCAoJGNvbmZpZyBhcyAkZW50aXR5TmFtZSA9PiAkZW50aXR5Q29uZmlnKSB7CiAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICRlbnRpdHkgPSAkdGhpcy0+Z2V0RW50aXR5KCRlbnRpdHlOYW1lKTsKICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFdGRXhjZXB0aW9uICRlKSB7CiAgICAgICAgICAgICAgICAgICAgcHJpbnQgIldBUk5JTkc6IEVudGl0eSB7JGVudGl0eU5hbWV9IG5vdCBsb2FkZWQuLi5cbiI7CiAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBmb3JlYWNoICgkZW50aXR5Q29uZmlnIGFzICRrZXkgPT4gJGNvbmZpZykgewogICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoJGtleSkgewogICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdyZWxhdGlvbnNoaXBzJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRjb25maWcgYXMgJHJlbGF0aW9uc2hpcE5hbWUgPT4gJHJlbGF0aW9uc2hpcENvbmZpZykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRyZWwgPSAkZW50aXR5LT5nZXRSZWxhdGlvbnNoaXAoJHJlbGF0aW9uc2hpcE5hbWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJHJlbCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ICJXQVJOSU5HOiBSZWxhdGlvbnNoaXA6IHskcmVsYXRpb25zaGlwTmFtZX0gb2YgRW50aXR5IHskZW50aXR5TmFtZX0gbm90IGxvYWRlZC4uLlxuIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRyZWxhdGlvbnNoaXBDb25maWcgYXMgJGtleSA9PiAkdmFsdWUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRrZXkgPT09ICdpbnZlcnNlUmVsYXRpb25zaGlwJykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCgkZW50aXR5TmFtZSwgJHJlbE5hbWUpID0gZXhwbG9kZSgnLicsICR2YWx1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISRlbnRpdHlOYW1lIG9yICEkcmVsTmFtZSkgdGhyb3coIG5ldyBXRkV4Y2VwdGlvbigiaW52ZXJzZVJlbGF0aW9uc2hpcCBmb3JtYXQgbXVzdCBiZSA8ZW50aXR5TmFtZT4uPHJlbGF0aW9uc2hpcE5hbWU+IikgKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJHRoaXMtPmdldEVudGl0eSgkZW50aXR5TmFtZSkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGludkVudGl0eSA9IG5ldyBXRk1vZGVsRW50aXR5OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRpbnZFbnRpdHktPnNldFZhbHVlRm9yS2V5KCRlbnRpdHlOYW1lLCAnbmFtZScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5idWlsZGVyLT5idWlsZEVudGl0eU1vZGVsKCRpbnZFbnRpdHkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5hZGRFbnRpdHkoJGludkVudGl0eSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcmVsLT5zZXRJbnZlcnNlUmVsYXRpb25zaGlwKCR0aGlzLT5nZXRFbnRpdHkoJGVudGl0eU5hbWUpLT5nZXRSZWxhdGlvbnNoaXAoJ3JlbE5hbWUnKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcmVsLT5zZXRWYWx1ZUZvcktleSgkdmFsdWUsICRrZXkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Byb3BlcnRpZXMnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCAoJGNvbmZpZyBhcyAkcHJvcGVydHlOYW1lID0+ICRwcm9wZXJ0eUNvbmZpZykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRwcm9wZXJ0eSA9ICRlbnRpdHktPmdldFByb3BlcnR5KCRwcm9wZXJ0eU5hbWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJHByb3BlcnR5KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnQgIldBUk5JTkc6IFByb3BlcnR5OiB7JHByb3BlcnR5TmFtZX0gb2YgRW50aXR5IHskZW50aXR5TmFtZX0gbm90IGxvYWRlZC4uLlxuIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRwcm9wZXJ0eUNvbmZpZyBhcyAka2V5ID0+ICR2YWx1ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCRrZXkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3R5cGUnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR2YWx1ZSA9IGV2YWwoInJldHVybiB7JHZhbHVlfTsiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcHJvcGVydHktPnNldFZhbHVlRm9yS2V5KCR2YWx1ZSwgJGtleSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZW50aXR5LT5zZXRWYWx1ZUZvcktleSgkY29uZmlnLCAka2V5KTsKICAgICAgICAgICAgICAgICAgICAgICA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AgICAvLyBmaWd1cmUgb3V0IG1vZHVsZVBhdGgKICAgICAgICAvLyB3YWxrIHVwIFBXRCB1bnRpbCB3ZSBoaXQgIm1vZHVsZXMiIGFuZCB1c2UgdGhhdC4KICAgICAgICAkZGlyID0gZ2V0Y3dkKCk7CiAgICAgICAgJHBhcnRzID0gZXhwbG9kZSgnLycsICRkaXIpOwogICAgICAgICR0aGlzLT5tb2R1bGVQYXRoID0gTlVMTDsKICAgICAgICBmb3JlYWNoICgkcGFydHMgYXMgJHBhcnQpIHsKICAgICAgICAgICAgaWYgKCR0aGlzLT5tb2R1bGVQYXRoID09PSBOVUxMKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBpZiAoJHBhcnQgPT0gJ21vZHVsZXMnKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICR0aGlzLT5tb2R1bGVQYXRoID0gV1dXX1JPT1Q7CiAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAkdGhpcy0+bW9kdWxlUGF0aCAuPSAnLycgLiAkcGFydDsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICAkdGhpcy0+bW9kdWxlUGF0aCAuPSAnLyc7CiAgICB9CgogICAgZnVuY3Rpb24gZ2VuZXJhdGVNb2R1bGVGb3JFbnRpdHkoJGVudGl0eSkKICAgIHsKICAgICAgICBwcmludCAiR2VuZXJhdGluZyBtb2R1bGUgZm9yIGVudGl0eSAnIiAuICRlbnRpdHktPnZhbHVlRm9yS2V5KCduYW1lJykgLiAiJ1xuIjsKICAgICAgICAkY3dkID0gZ2V0Y3dkKCk7CiAgICAgICAgJG1vZHVsZU5hbWUgPSBzdHJ0b2xvd2VyKCAkZW50aXR5LT52YWx1ZUZvcktleSgnbmFtZScpICk7CiAgICAgICAgJG1vZHVsZURpciA9ICRjd2QgLiAnLycgLiAkbW9kdWxlTmFtZTsKICAgICAgICBpZiAoZmlsZV9leGlzdHMoJG1vZHVsZURpcikpCiAgICAgICAgewogICAgICAgICAgICBwcmludCAiV0FSTklORzogTW9kdWxlICRtb2R1bGVOYW1lIGFscmVhZHkgZXhpc3RzLiBTa2lwcGluZ1xuIjsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KCiAgICAgICAgbWtkaXIoJG1vZHVsZURpcik7IC8vIG1vZHVsZSBkaXIKICAgICAgICAkdGhpcy0+bW9kdWxlUGF0aCAuPSAkbW9kdWxlTmFtZTsKCiAgICAgICAgLy8gc2V0dXAgc2hhcmVkIGluc3RhbmNlcwogICAgICAgICRzaGFyZWRZYW1sWyRlbnRpdHktPnZhbHVlRm9yS2V5KCduYW1lJyldID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkFycmF5Q29udHJvbGxlcicsCiAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAkZW50aXR5LT52YWx1ZUZvcktleSgnbmFtZScpLAogICAgICAgICAgICAgICAgICAgICdjbGFzc0lkZW50aWZpZXJzJyA9PiAkZW50aXR5LT52YWx1ZUZvcktleSgncHJpbWFyeUtleVByb3BlcnR5JyksCiAgICAgICAgICAgICAgICAgICAgJ3NlbGVjdE9uSW5zZXJ0JyA9PiB0cnVlLAogICAgICAgICAgICAgICAgICAgICdhdXRvbWF0aWNhbGx5UHJlcGFyZXNDb250ZW50JyA9PiBmYWxzZQogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICk7CiAgICAgICAgJHNoYXJlZFlhbWxbJ3BhZ2luYXRvciddID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRlBhZ2luYXRvcicsCiAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ21vZGVGb3J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YW1lJykgLiAnRm9ybSc7CiAgICAgICAgJGxpc3RZYW1sWyRsaXN0Rm9ybUlkXSA9IGFycmF5KAogICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAnV0ZGb3JtJywgJ2NoaWxkcmVuJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAnc2VhcmNoJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAnV0ZTdWJtaXQnLAogICAgICAgICAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbGFiZWwnID0+ICdTZWFyY2gnCiAgICAgICAgICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgICAgICdjbGVhcicgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGU3VibWl0JywKICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb3BlcnRpZXMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2xhYmVsJyA9PiAnQ2xlYXInCiAgICAgICAgICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgICAgICdwYWdpbmF0b3JTdGF0ZScgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGUGFnaW5hdG9yU3RhdGUnLAogICAgICAgICAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoJ3BhZ2luYXRvcicgPT4gJyNtb2R1bGUjcGFnaW5hdG9yJykKICAgICAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICAgICAncXVlcnknID0+IGFycmF5KCdjbGFzcycgPT4gJ1dGVGV4dEZpZWxkJyksCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKTsKICAgICAgICAkbGlzdFlhbWxbJ3BhZ2luYXRvck5hdmlnYXRpb24nXSA9IGFycmF5KAogICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAnV0ZQYWdpbmF0b3JOYXZpZ2F0aW9uJywKICAgICAgICAgICAgICAgICdwcm9wZXJ0aWVzJyA9PiBhcnJheSgncGFnaW5hdG9yJyA9PiAnI21vZHVsZSNwYWdpbmF0b3InKSwKICAgICAgICAgICAgICAgICk7CiAgICAgICAgJGxpc3RZYW1sWydwYWdpbmF0b3JQYWdlSW5mbyddID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRlBhZ2luYXRvclBhZ2VJbmZvJywKICAgICAgICAgICAgICAgICdwcm9wZXJ0aWVzJyA9PiBhcnJheSgncGFnaW5hdG9yJyA9PiAnI21vZHVsZSNwYWdpbmF0b3InKSwKICAgICAgICAgICAgICAgICk7CgogICAgICAgICRkZXNjcmlwdGl2ZUNvbHVtbk5hbWUgPSAkZW50aXR5LT52YWx1ZUZvcktleSgnZGVzY3JpcHRpdmVDb2x1bW5OYW1lJyk7CiAgICAgICAgJGxpc3RZYW1sWyRkZXNjcmlwdGl2ZUNvbHVtbk5hbWVdID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkR5bmFtaWMnLAogICAgICAgICAgICAgICAgJ3Byb3BlcnRpZXMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICdhcnJheUNvbnRyb2xsZXInID0+ICIjbW9kdWxlI3skc2hhcmVkRW50aXR5SWR9IiwKICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgJ2NoaWxkcmVuJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAieyRkZXNjcmlwdGl2ZUNvbHVtbk5hbWV9UHJvdG90eXBlIiA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAnV0ZMaW5rJywKICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbmRpbmdzJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICd2YWx1ZScgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RhbmNlSUQnID0+ICRzaGFyZWRFbnRpdHlJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29udHJvbGxlcktleScgPT4gJyNjdXJyZW50IycsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21vZGVsS2V5UGF0aCcgPT4gJGVudGl0eS0+dmFsdWVGb3JLZXkoJ3ByaW1hcnlLZXlQcm9wZXJ0eScpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25zJyA9PiBhcnJheSgnVmFsdWVQYXR0ZXJuJyA9PiAkdGhpcy0+bW9kdWxlUGF0aCAuICcvZGV0YWlsLyUxJScpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdsYWJlbCcgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RhbmNlSUQnID0+ICRzaGFyZWRFbnRpdHlJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29udHJvbGxlcktleScgPT4gJyNjdXJyZW50IycsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21vZGVsS2V5UGF0aCcgPT4gJGVudGl0eS0+dmFsdWVGb3JLZXkoJ2Rlc2NyaXB0aXZlQ29sdW1uTmFtZScpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgJGxpc3RZYW1sWydlZGl0TGluayddID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkR5bmFtaWMnLAogICAgICAgICAgICAgICAgJ3Byb3BlcnRpZXMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICdhcnJheUNvbnRyb2xsZXInID0+ICIjbW9kdWxlI3skc2hhcmVkRW50aXR5SWR9IiwKICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgJ2NoaWxkcmVuJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAiZWRpdExpbmtQcm90b3R5cGUiID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkxpbmsnLAogICAgICAgICAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoJ2xhYmVsJyA9PiAnRWRpdCcpLAogICAgICAgICAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3ZhbHVlJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnaW5zdGFuY2VJRCcgPT4gJHNoYXJlZEVudGl0eUlkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnI2N1cnJlbnQjJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbW9kZWxLZXlQYXRoJyA9PiAkZW50aXR5LT52YWx1ZUZvcktleSgncHJpbWFyeUtleVByb3BlcnR5JyksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbnMnID0+IGFycmF5KCdWYWx1ZVBhdHRlcm4nID0+ICR0aGlzLT5tb2R1bGVQYXRoIC4gJy9lZGl0LyUxJScpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApIAogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICk7CiAgICAgICAgJGxpc3RZYW1sWydkZWxldGVMaW5rJ10gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGRHluYW1pYycsCiAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ2FycmF5Q29udHJvbGxlcicgPT4gIiNtb2R1bGUjeyRzaGFyZWRFbnRpdHlJZH0iLAogICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAnY2hpbGRyZW4nID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICJkZWxldGVMaW5rUHJvdG90eXBlIiA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAnV0ZMaW5rJywKICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb3BlcnRpZXMnID0+IGFycmF5KCdsYWJlbCcgPT4gJ0RlbGV0ZScpLAogICAgICAgICAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3ZhbHVlJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnaW5zdGFuY2VJRCcgPT4gJHNoYXJlZEVudGl0eUlkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnI2N1cnJlbnQjJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbW9kZWxLZXlQYXRoJyA9PiAkZW50aXR5LT52YWx1ZUZvcktleSgncHJpbWFyeUtleVByb3BlcnR5JyksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbnMnID0+IGFycmF5KCdWYWx1ZVBhdHRlcm4nID0+ICR0aGlzLT5tb2R1bGVQYXRoIC4gJy9jb25maXJtRGVsZXRlLyUxJScpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApIAogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICk7CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvbGlzdC55YW1sJywgV0ZZYW1sOjpkdW1wKCRsaXN0WWFtbCkpOwoKICAgICAgICAvLyBidWlsZCBsaXN0LnRwbAogICAgICAgICR0aGlzLT5zbWFydHktPmFzc2lnbignbGlzdEZvcm1JZCcsICRsaXN0Rm9ybUlkKTsKICAgICAgICBmaWxlX3B1dF9jb250ZW50cygkbW9kdWxlRGlyIC4gJy9saXN0LnRwbCcsICR0aGlzLT5zbWFydHktPmZldGNoKEZSQU1FV09SS19ESVIgLiAnL2ZyYW1ld29yay9nZW5lcmF0b3IvbGlzdC50cGwnKSk7CgogICAgICAgIC8vIGJ1aWxkIGVkaXQgcGFnZQogICAgICAgIC8vIGJ1aWxkIGVkaXQueWFtbAogICAgICAgICRlZGl0WWFtbCA9IGFycmF5KCk7CiAgICAgICAgJGVkaXRGb3JtSWQgPSAnZWRpdCcgLiAkZW50aXR5LT52YWx1ZUZvcktleSgnbmFtZScpIC4gJ0Zvcm0nOwogICAgICAgICRlZGl0WWFtbFskZWRpdEZvcm1JZF0gPSBhcnJheSgnY2xhc3MnID0+ICdXRkZvcm0nLCAnY2hpbGRyZW4nID0+IGFycmF5KCkpOwoKICAgICAgICAkd2lkZ2V0cyA9IGFycmF5KCk7CiAgICAgICAgZm9yZWFjaCAoJGVudGl0eS0+Z2V0UHJvcGVydGllcygpIGFzICRwcm9wZXJ0eSkgewogICAgICAgICAgICAkd2lkZ2V0SUQgPSAkcHJvcGVydHktPnZhbHVlRm9yS2V5KCduYW1lJyk7CiAgICAgICAgICAgICR3aWRnZXRzWyR3aWRnZXRJRF0gPSAkcHJvcGVydHk7CgogICAgICAgICAgICBpZiAoJHByb3BlcnR5LT52YWx1ZUZvcktleSgnbmFtZScpID09PSAkZW50aXR5LT52YWx1ZUZvcktleSgncHJpbWFyeUtleVByb3BlcnR5JykpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICRjbGFzcyA9ICdXRkhpZGRlbic7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKCRwcm9wZXJ0eS0+dmFsdWVGb3JLZXkoJ3R5cGUnKSkgewogICAgICAgICAgICAgICAgICAgIGNhc2UgV0ZNb2RlbEVudGl0eVByb3BlcnR5OjpUWVBFX1RFWFQ7CiAgICAgICAgICAgICAgICAgICAgICAgICRjbGFzcyA9ICdXRlRleHRBcmVhJzsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgY2FzZSBXRk1vZGVsRW50aXR5UHJvcGVydHk6OlRZUEVfTlVNQkVSOwogICAgICAgICAgICAgICAgICAgIGNhc2UgV0ZNb2RlbEVudGl0eVByb3BlcnR5OjpUWVBFX1NUUklORzsKICAgICAgICAgICAgICAgICAgICBjYXNlIFdGTW9kZWxFbnRpdHlQcm9wZXJ0eTo6VFlQRV9EQVRFVElNRTsKICAgICAgICAgICAgICAgICAgICBjYXNlIFdGTW9kZWxFbnRpdHlQcm9wZXJ0eTo6VFlQRV9USU1FOwogICAgICAgICAgICAgICAgICAgIGNhc2UgV0ZNb2RlbEVudGl0eVByb3BlcnR5OjpUWVBFX0RBVEU7CiAgICAgICAgICAgICAgICAgICAgICAgICRjbGFzcyA9ICdXRlRleHRGaWVsZCc7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIGNhc2UgV0ZNb2RlbEVudGl0eVByb3BlcnR5OjpUWVBFX0JPT0xFQU47CiAgICAgICAgICAgICAgICAgICAgICAgICRjbGFzcyA9ICdXRkNoZWNrYm94JzsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAgICAgJGNsYXNzID0gJ1dGVGV4dEZpZWxkJzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICAkZWRpdFlhbWxbJGVkaXRGb3JtSWRdWydjaGlsZHJlbiddWyR3aWRnZXRJRF0gPSBhcnJheSgKICAgICAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICRjbGFzcywKICAgICAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAndmFsdWUnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RhbmNlSUQnID0+ICRzaGFyZWRFbnRpdHlJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnc2VsZWN0aW9uJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtb2RlbEtleVBhdGgnID0+ICR3aWRnZXRJRAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKTsKCiAgICAgICAgfQogICAgICAgIC8vIHN0YXR1cyBtZXNzYWdlCiAgICAgICAgJGVkaXRZYW1sWydzdGF0dXNNZXNzYWdlJ10gPSBhcnJheSgnY2xhc3MnID0+ICdXRk1lc3NhZ2VCb3gnKTsKICAgICAgICAkZWRpdFlhbWxbJGVkaXRGb3JtSWRdWydjaGlsZHJlbiddWydzYXZlTmV3J10gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGU3VibWl0JywKICAgICAgICAgICAgICAgICdwcm9wZXJ0aWVzJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAnbGFiZWwnID0+ICdDcmVhdGUgJyAuICRlbnRpdHktPnZhbHVlRm9yS2V5KCduYW1lJyksCiAgICAgICAgICAgICAgICAgICAgJ2FjdGlvbicgPT4gJ3NhdmUnCiAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICdiaW5kaW5ncycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ2hpZGRlbicgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0YW5jZUlEJyA9PiAkc2hhcmVkRW50aXR5SWQsCiAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnc2VsZWN0aW9uJywKICAgICAgICAgICAgICAgICAgICAgICAgJ21vZGVsS2V5UGF0aCcgPT4gJ2lzTmV3JywKICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbnMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3ZhbHVlVHJhbnNmb3JtZXInID0+ICdXRk5lZ2F0ZUJvb2xlYW4nLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKTsKICAgICAgICAkZWRpdFlhbWxbJGVkaXRGb3JtSWRdWydjaGlsZHJlbiddWydzYXZlJ10gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGU3VibWl0JywKICAgICAgICAgICAgICAgICdwcm9wZXJ0aWVzJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAnbGFiZWwnID0+ICdTYXZlJwogICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICdoaWRkZW4nID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAnaW5zdGFuY2VJRCcgPT4gJHNoYXJlZEVudGl0eUlkLAogICAgICAgICAgICAgICAgICAgICAgICAnY29udHJvbGxlcktleScgPT4gJ3NlbGVjdGlvbicsCiAgICAgICAgICAgICAgICAgICAgICAgICdtb2RlbEtleVBhdGgnID0+ICdpc05ldycsCiAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICApOwogICAgICAgICRlZGl0WWFtbFskZWRpdEZvcm1JZF1bJ2NoaWxkcmVuJ11bJ2RlbGV0ZU9iaiddID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRlN1Ym1pdCcsCiAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ2xhYmVsJyA9PiAnRGVsZXRlJwogICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICdoaWRkZW4nID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAnaW5zdGFuY2VJRCcgPT4gJHNoYXJlZEVudGl0eUlkLAogICAgICAgICAgICAgICAgICAgICAgICAnY29udHJvbGxlcktleScgPT4gJ3NlbGVjdGlvbicsCiAgICAgICAgICAgICAgICAgICAgICAgICdtb2RlbEtleVBhdGgnID0+ICdpc05ldycsCiAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICApOwogICAgICAgIGZpbGVfcHV0X2NvbnRlbnRzKCRtb2R1bGVEaXIgLiAnL2VkaXQueWFtbCcsIFdGWWFtbDo6ZHVtcCgkZWRpdFlhbWwpKTsKCiAgICAgICAgLy8gYnVpbGQgZWRpdC50cGwKICAgICAgICAkdGhpcy0+c21hcnR5LT5hc3NpZ24oJ2VkaXRGb3JtSWQnLCAkZWRpdEZvcm1JZCk7CiAgICAgICAgJHRoaXMtPnNtYXJ0eS0+YXNzaWduKCd3aWRnZXRzJywgJHdpZGdldHMpOwogICAgICAgIGZpbGVfcHV0X2NvbnRlbnRzKCRtb2R1bGVEaXIgLiAnL2VkaXQudHBsJywgJHRoaXMtPnNtYXJ0eS0+ZmV0Y2goRlJBTUVXT1JLX0RJUiAuICcvZnJhbWV3b3JrL2dlbmVyYXRvci9lZGl0LnRwbCcpKTsKCiAgICAgICAgLy8gYnVpbGQgY29uZmlybURlbGV0ZSBwYWdlCiAgICAgICAgJGNvbmZpcm1EZWxldGVZYW1sID0gYXJyYXkoKTsKICAgICAgICAkY29uZmlybURlbGV0ZUZvcm1JZCA9ICdjb25maXJtRGVsZXRlJyAuICRlbnRpdHktPnZhbHVlRm9yS2V5KCduYW1lJykgIC4gJ0Zvcm0nOwogICAgICAgICRwa0lkID0gJGVudGl0eS0+dmFsdWVGb3JLZXkoJ3ByaW1hcnlLZXlQcm9wZXJ0eScpOwogICAgICAgICRjb25maXJtRGVsZXRlWWFtbFskY29uZmlybURlbGV0ZUZvcm1JZF0gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGRm9ybScsCiAgICAgICAgICAgICAgICAnY2hpbGRyZW4nID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICRwa0lkID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkhpZGRlbicsCiAgICAgICAgICAgICAgICAgICAgICAgICdiaW5kaW5ncycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAndmFsdWUnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0YW5jZUlEJyA9PiAkc2hhcmVkRW50aXR5SWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRyb2xsZXJLZXknID0+ICdzZWxlY3Rpb24nLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtb2RlbEtleVBhdGgnID0+ICRlbnRpdHktPnZhbHVlRm9yS2V5KCdwcmltYXJ5S2V5UHJvcGVydHknKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGU3VibWl0JywKICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb3BlcnRpZXMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2xhYmVsJyA9PiAnQ2FuY2VsJwogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgICAgICdkZWxldGVPYmonID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRlN1Ym1pdCcsCiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9wZXJ0aWVzJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdsYWJlbCcgPT4gJ0RlbGV0ZScKICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAkY29uZmlybURlbGV0ZVlhbWxbJ2NvbmZpcm1NZXNzYWdlJ10gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGTWVzc2FnZUJveCcsCiAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICd2YWx1ZScgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0YW5jZUlEJyA9PiAkc2hhcmVkRW50aXR5SWQsCiAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnc2VsZWN0aW9uJywKICAgICAgICAgICAgICAgICAgICAgICAgJ21vZGVsS2V5UGF0aCcgPT4gJGRlc2NyaXB0aXZlQ29sdW1uTmFtZSwKICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbnMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1ZhbHVlUGF0dGVybicgPT4gJ0FyZSB5b3Ugc3VyZSB5b3Ugd2FudCB0byBkZWxldGUgJyAuICRlbnRpdHktPnZhbHVlRm9yS2V5KCduYW1lJykgLiAnICIlMSUiPycKICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICk7CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvY29uZmlybURlbGV0ZS55YW1sJywgV0ZZYW1sOjpkdW1wKCRjb25maXJtRGVsZXRlWWFtbCkpOwogICAgICAgIAogICAgICAgIC8vIGNvbmZpcm1EZWxldGUudHBsIGZpbGUKICAgICAgICAkdGhpcy0+c21hcnR5LT5hc3NpZ24oJ2NvbmZpcm1EZWxldGVGb3JtSWQnLCAkY29uZmlybURlbGV0ZUZvcm1JZCk7CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvY29uZmlybURlbGV0ZS50cGwnLCAkdGhpcy0+c21hcnR5LT5mZXRjaChGUkFNRVdPUktfRElSIC4gJy9mcmFtZXdvcmsvZ2VuZXJhdG9yL2NvbmZpcm1EZWxldGUudHBsJykpOwoKICAgICAgICAvLyBkZWxldGUgc3VjY2VzcwogICAgICAgICRkZWxldGVTdWNjZXNzWWFtbCA9IGFycmF5KCk7CiAgICAgICAgJGRlbGV0ZVN1Y2Nlc3NZYW1sWydzdGF0dXNNZXNzYWdlJ10gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGTWVzc2FnZUJveCcsCiAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ3ZhbHVlJyA9PiAkZW50aXR5LT52YWx1ZUZvcktleSgnbmFtZScpIC4gJyBzdWNjZXNzZnVsbHkgZGVsZXRlZC4nCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKTsKICAgICAgICBmaWxlX3B1dF9jb250ZW50cygkbW9kdWxlRGlyIC4gJy9kZWxldGVTdWNjZXNzLnlhbWwnLCBXRllhbWw6OmR1bXAoJGRlbGV0ZVN1Y2Nlc3NZYW1sKSk7CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvZGVsZXRlU3VjY2Vzcy50cGwnLCAkdGhpcy0+c21hcnR5LT5mZXRjaChGUkFNRVdPUktfRElSIC4gJy9mcmFtZXdvcmsvZ2VuZXJhdG9yL2RlbGV0ZVN1Y2Nlc3MudHBsJykpOwoKICAgICAgICAvLyBkZXRhaWwgcGFnZQogICAgICAgICRkZXRhaWxZYW1sID0gYXJyYXkoKTsKICAgICAgICAkd2lkZ2V0cyA9IGFycmF5KCk7CiAgICAgICAgZm9yZWFjaCAoJGVudGl0eS0+Z2V0UHJvcGVydGllcygpIGFzICRwcm9wZXJ0eSkgewogICAgICAgICAgICAkd2lkZ2V0SUQgPSAkcHJvcGVydHktPnZhbHVlRm9yS2V5KCduYW1lJyk7CiAgICAgICAgICAgICR3aWRnZXRzWyR3aWRnZXRJRF0gPSAkcHJvcGVydHk7CiAgICAgICAgICAgICRkZXRhaWxZYW1sWyR3aWRnZXRJRF0gPSBhcnJheSgKICAgICAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkxhYmVsJywKICAgICAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAndmFsdWUnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RhbmNlSUQnID0+ICRzaGFyZWRFbnRpdHlJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnc2VsZWN0aW9uJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtb2RlbEtleVBhdGgnID0+ICR3aWRnZXRJRAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvZGV0YWlsLnlhbWwnLCBXRllhbWw6OmR1bXAoJGRldGFpbFlhbWwpKTsKICAgICAgIAogICAgICAgIC8vIGJ1aWxkIGRldGFpbC50cGwKICAgICAgICAkdGhpcy0+c21hcnR5LT5hc3NpZ24oJ3dpZGdldHMnLCAkd2lkZ2V0cyk7CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvZGV0YWlsLnRwbCcsICR0aGlzLT5zbWFydHktPmZldGNoKEZSQU1FV09SS19ESVIgLiAnL2ZyYW1ld29yay9nZW5lcmF0b3IvZGV0YWlsLnRwbCcpKTsKICAgIH0KfQo=]]></response>

After this, there is only one more entry in the connection log, a SEND of:
context_names -d 0 -i 28

Then it's hung.

I have screenshots if you like; I didn't see a way to attach them to the ticket.

March 18, 2011 03:24 PM Alan Pinstein
The last successful RECV:

<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1"
xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="source"
transaction_id="27"
encoding="base64"><![CDATA[PD9waHAKCmludGVyZmFjZSBXRk1vZGVsQnVpbGRlcgp7CiAgICAvLyBnZXQgYSBXRk1vZGVsRW50aXR5IGZvciB0aGUgZ2l2ZW4gZW50aXR5IG5hbWUKICAgIGZ1bmN0aW9uIGJ1aWxkRW50aXR5TW9kZWwoJGVudGl0eSk7Cn0KCi8vIFBIT0NPQSBXRk1vZGVsIENsYXNzIFN0cnVjdHVyZSAtLSBpbnRlcm5hbCByZXByZXNlbnRhdGlvbiBvZiB0aGUgb2JqZWN0IG1vZGVsLiBEZWNvdXBsZWQgZnJvbSB0aGUgaW1wbGVtZW50YXRpb25zLgpjbGFzcyBXRk1vZGVsIGV4dGVuZHMgV0ZPYmplY3QK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gICAgICAgIC8vICAgICBCbG9nUHJlZmVyZW5jZXM6CiAgICAgICAgICAgIC8vICAgICAgIG1pbkNvdW50OiAwCiAgICAgICAgICAgIC8vICAgICAgIG1heENvdW50OiBOVUxMCiAgICAgICAgICAgIC8vICAgICAgIGlzRXh0ZW5zaW9uOiB0cnVlCgogICAgICAgICAgICAvLyBhcHBseSBjb25maWcKICAgICAgICAgICAgZm9yZWFjaCAoJGNvbmZpZyBhcyAkZW50aXR5TmFtZSA9PiAkZW50aXR5Q29uZmlnKSB7CiAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICRlbnRpdHkgPSAkdGhpcy0+Z2V0RW50aXR5KCRlbnRpdHlOYW1lKTsKICAgICAgICAgICAgICAgIH0gY2F0Y2ggKFdGRXhjZXB0aW9uICRlKSB7CiAgICAgICAgICAgICAgICAgICAgcHJpbnQgIldBUk5JTkc6IEVudGl0eSB7JGVudGl0eU5hbWV9IG5vdCBsb2FkZWQuLi5cbiI7CiAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBmb3JlYWNoICgkZW50aXR5Q29uZmlnIGFzICRrZXkgPT4gJGNvbmZpZykgewogICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoJGtleSkgewogICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdyZWxhdGlvbnNoaXBzJzoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRjb25maWcgYXMgJHJlbGF0aW9uc2hpcE5hbWUgPT4gJHJlbGF0aW9uc2hpcENvbmZpZykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRyZWwgPSAkZW50aXR5LT5nZXRSZWxhdGlvbnNoaXAoJHJlbGF0aW9uc2hpcE5hbWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJHJlbCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ICJXQVJOSU5HOiBSZWxhdGlvbnNoaXA6IHskcmVsYXRpb25zaGlwTmFtZX0gb2YgRW50aXR5IHskZW50aXR5TmFtZX0gbm90IGxvYWRlZC4uLlxuIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRyZWxhdGlvbnNoaXBDb25maWcgYXMgJGtleSA9PiAkdmFsdWUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRrZXkgPT09ICdpbnZlcnNlUmVsYXRpb25zaGlwJykKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCgkZW50aXR5TmFtZSwgJHJlbE5hbWUpID0gZXhwbG9kZSgnLicsICR2YWx1ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISRlbnRpdHlOYW1lIG9yICEkcmVsTmFtZSkgdGhyb3coIG5ldyBXRkV4Y2VwdGlvbigiaW52ZXJzZVJlbGF0aW9uc2hpcCBmb3JtYXQgbXVzdCBiZSA8ZW50aXR5TmFtZT4uPHJlbGF0aW9uc2hpcE5hbWU+IikgKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJHRoaXMtPmdldEVudGl0eSgkZW50aXR5TmFtZSkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGludkVudGl0eSA9IG5ldyBXRk1vZGVsRW50aXR5OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRpbnZFbnRpdHktPnNldFZhbHVlRm9yS2V5KCRlbnRpdHlOYW1lLCAnbmFtZScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5idWlsZGVyLT5idWlsZEVudGl0eU1vZGVsKCRpbnZFbnRpdHkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5hZGRFbnRpdHkoJGludkVudGl0eSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcmVsLT5zZXRJbnZlcnNlUmVsYXRpb25zaGlwKCR0aGlzLT5nZXRFbnRpdHkoJGVudGl0eU5hbWUpLT5nZXRSZWxhdGlvbnNoaXAoJ3JlbE5hbWUnKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcmVsLT5zZXRWYWx1ZUZvcktleSgkdmFsdWUsICRrZXkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Byb3BlcnRpZXMnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCAoJGNvbmZpZyBhcyAkcHJvcGVydHlOYW1lID0+ICRwcm9wZXJ0eUNvbmZpZykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRwcm9wZXJ0eSA9ICRlbnRpdHktPmdldFByb3BlcnR5KCRwcm9wZXJ0eU5hbWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJHByb3BlcnR5KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnQgIldBUk5JTkc6IFByb3BlcnR5OiB7JHByb3BlcnR5TmFtZX0gb2YgRW50aXR5IHskZW50aXR5TmFtZX0gbm90IGxvYWRlZC4uLlxuIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRwcm9wZXJ0eUNvbmZpZyBhcyAka2V5ID0+ICR2YWx1ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCRrZXkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3R5cGUnOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR2YWx1ZSA9IGV2YWwoInJldHVybiB7JHZhbHVlfTsiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcHJvcGVydHktPnNldFZhbHVlRm9yS2V5KCR2YWx1ZSwgJGtleSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZW50aXR5LT5zZXRWYWx1ZUZvcktleSgkY29uZmlnLCAka2V5KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICA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0IG1vZHVsZVBhdGgKICAgICAgICAvLyB3YWxrIHVwIFBXRCB1bnRpbCB3ZSBoaXQgIm1vZHVsZXMiIGFuZCB1c2UgdGhhdC4KICAgICAgICAkZGlyID0gZ2V0Y3dkKCk7CiAgICAgICAgJHBhcnRzID0gZXhwbG9kZSgnLycsICRkaXIpOwogICAgICAgICR0aGlzLT5tb2R1bGVQYXRoID0gTlVMTDsKICAgICAgICBmb3JlYWNoICgkcGFydHMgYXMgJHBhcnQpIHsKICAgICAgICAgICAgaWYgKCR0aGlzLT5tb2R1bGVQYXRoID09PSBOVUxMKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBpZiAoJHBhcnQgPT0gJ21vZHVsZXMnKQogICAgICAgICAgICAgICAgewogICAgICAgICAgICAgICAgICAgICR0aGlzLT5tb2R1bGVQYXRoID0gV1dXX1JPT1Q7CiAgICAgICAgICAgICAgICAgICAgY29udGludWU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAkdGhpcy0+bW9kdWxlUGF0aCAuPSAnLycgLiAkcGFydDsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICAkdGhpcy0+bW9kdWxlUGF0aCAuPSAnLyc7CiAgICB9CgogICAgZnVuY3Rpb24gZ2VuZXJhdGVNb2R1bGVGb3JFbnRpdHkoJGVudGl0eSkKICAgIHsKICAgICAgICBwcmludCAiR2VuZXJhdGluZyBtb2R1bGUgZm9yIGVudGl0eSAnIiAuICRlbnRpdHktPnZhbHVlRm9yS2V5KCduYW1lJykgLiAiJ1xuIjsKICAgICAgICAkY3dkID0gZ2V0Y3dkKCk7CiAgICAgICAgJG1vZHVsZU5hbWUgPSBzdHJ0b2xvd2VyKCAkZW50aXR5LT52YWx1ZUZvcktleSgnbmFtZScpICk7CiAgICAgICAgJG1vZHVsZURpciA9ICRjd2QgLiAnLycgLiAkbW9kdWxlTmFtZTsKICAgICAgICBpZiAoZmlsZV9leGlzdHMoJG1vZHVsZURpcikpCiAgICAgICAgewogICAgICAgICAgICBwcmludCAiV0FSTklORzogTW9kdWxlICRtb2R1bGVOYW1lIGFscmVhZHkgZXhpc3RzLiBTa2lwcGluZ1xuIjsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KCiAgICAgICAgbWtkaXIoJG1vZHVsZURpcik7IC8vIG1vZHVsZSBkaXIKICAgICAgICAkdGhpcy0+bW9kdWxlUGF0aCAuPSAkbW9kdWxlTmFtZTsKCiAgICAgICAgLy8gc2V0dXAgc2hhcmVkIGluc3RhbmNlcwogICAgICAgICRzaGFyZWRZYW1sWyRlbnRpdHktPnZhbHVlRm9yS2V5KCduYW1lJyldID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkFycmF5Q29udHJvbGxlcicsCiAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAkZW50aXR5LT52YWx1ZUZvcktleSgnbmFtZScpLAogICAgICAgICAgICAgICAgICAgICdjbGFzc0lkZW50aWZpZXJzJyA9PiAkZW50aXR5LT52YWx1ZUZvcktleSgncHJpbWFyeUtleVByb3BlcnR5JyksCiAgICAgICAgICAgICAgICAgICAgJ3NlbGVjdE9uSW5zZXJ0JyA9PiB0cnVlLAogICAgICAgICAgICAgICAgICAgICdhdXRvbWF0aWNhbGx5UHJlcGFyZXNDb250ZW50JyA9PiBmYWxzZQogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICk7CiAgICAgICAgJHNoYXJlZFlhbWxbJ3BhZ2luYXRvciddID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRlBhZ2luYXRvcicsCiAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ21vZGVGb3JtJyA9PiAnc2VhcmNoJywK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iAgICAgICAgJGxpc3RZYW1sWyRsaXN0Rm9ybUlkXSA9IGFycmF5KAogICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAnV0ZGb3JtJywgJ2NoaWxkcmVuJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAnc2VhcmNoJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAnV0ZTdWJtaXQnLAogICAgICAgICAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbGFiZWwnID0+ICdTZWFyY2gnCiAgICAgICAgICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgICAgICdjbGVhcicgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGU3VibWl0JywKICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb3BlcnRpZXMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2xhYmVsJyA9PiAnQ2xlYXInCiAgICAgICAgICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgICAgICdwYWdpbmF0b3JTdGF0ZScgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGUGFnaW5hdG9yU3RhdGUnLAogICAgICAgICAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoJ3BhZ2luYXRvcicgPT4gJyNtb2R1bGUjcGFnaW5hdG9yJykKICAgICAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICAgICAncXVlcnknID0+IGFycmF5KCdjbGFzcycgPT4gJ1dGVGV4dEZpZWxkJyksCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKTsKICAgICAgICAkbGlzdFlhbWxbJ3BhZ2luYXRvck5hdmlnYXRpb24nXSA9IGFycmF5KAogICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAnV0ZQYWdpbmF0b3JOYXZpZ2F0aW9uJywKICAgICAgICAgICAgICAgICdwcm9wZXJ0aWVzJyA9PiBhcnJheSgncGFnaW5hdG9yJyA9PiAnI21vZHVsZSNwYWdpbmF0b3InKSwKICAgICAgICAgICAgICAgICk7CiAgICAgICAgJGxpc3RZYW1sWydwYWdpbmF0b3JQYWdlSW5mbyddID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRlBhZ2luYXRvclBhZ2VJbmZvJywKICAgICAgICAgICAgICAgICdwcm9wZXJ0aWVzJyA9PiBhcnJheSgncGFnaW5hdG9yJyA9PiAnI21vZHVsZSNwYWdpbmF0b3InKSwKICAgICAgICAgICAgICAgICk7CgogICAgICAgICRkZXNjcmlwdGl2ZUNvbHVtbk5hbWUgPSAkZW50aXR5LT52YWx1ZUZvcktleSgnZGVzY3JpcHRpdmVDb2x1bW5OYW1lJyk7CiAgICAgICAgJGxpc3RZYW1sWyRkZXNjcmlwdGl2ZUNvbHVtbk5hbWVdID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkR5bmFtaWMnLAogICAgICAgICAgICAgICAgJ3Byb3BlcnRpZXMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICdhcnJheUNvbnRyb2xsZXInID0+ICIjbW9kdWxlI3skc2hhcmVkRW50aXR5SWR9IiwKICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgJ2NoaWxkcmVuJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAieyRkZXNjcmlwdGl2ZUNvbHVtbk5hbWV9UHJvdG90eXBlIiA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAnV0ZMaW5rJywKICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbmRpbmdzJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICd2YWx1ZScgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RhbmNlSUQnID0+ICRzaGFyZWRFbnRpdHlJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29udHJvbGxlcktleScgPT4gJyNjdXJyZW50IycsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21vZGVsS2V5UGF0aCcgPT4gJGVudGl0eS0+dmFsdWVGb3JLZXkoJ3ByaW1hcnlLZXlQcm9wZXJ0eScpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25zJyA9PiBhcnJheSgnVmFsdWVQYXR0ZXJuJyA9PiAkdGhpcy0+bW9kdWxlUGF0aCAuICcvZGV0YWlsLyUxJScpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdsYWJlbCcgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RhbmNlSUQnID0+ICRzaGFyZWRFbnRpdHlJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29udHJvbGxlcktleScgPT4gJyNjdXJyZW50IycsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21vZGVsS2V5UGF0aCcgPT4gJGVudGl0eS0+dmFsdWVGb3JLZXkoJ2Rlc2NyaXB0aXZlQ29sdW1uTmFtZScpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICk7CiAgICAgICAgJGxpc3RZYW1sWydlZGl0TGluayddID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkR5bmFtaWMnLAogICAgICAgICAgICAgICAgJ3Byb3BlcnRpZXMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICdhcnJheUNvbnRyb2xsZXInID0+ICIjbW9kdWxlI3skc2hhcmVkRW50aXR5SWR9IiwKICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgJ2NoaWxkcmVuJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAiZWRpdExpbmtQcm90b3R5cGUiID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkxpbmsnLAogICAgICAgICAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoJ2xhYmVsJyA9PiAnRWRpdCcpLAogICAgICAgICAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3ZhbHVlJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnaW5zdGFuY2VJRCcgPT4gJHNoYXJlZEVudGl0eUlkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnI2N1cnJlbnQjJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbW9kZWxLZXlQYXRoJyA9PiAkZW50aXR5LT52YWx1ZUZvcktleSgncHJpbWFyeUtleVByb3BlcnR5JyksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbnMnID0+IGFycmF5KCdWYWx1ZVBhdHRlcm4nID0+ICR0aGlzLT5tb2R1bGVQYXRoIC4gJy9lZGl0LyUxJScpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApIAogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICk7CiAgICAgICAgJGxpc3RZYW1sWydkZWxldGVMaW5rJ10gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGRHluYW1pYycsCiAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ2FycmF5Q29udHJvbGxlcicgPT4gIiNtb2R1bGUjeyRzaGFyZWRFbnRpdHlJZH0iLAogICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAnY2hpbGRyZW4nID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICJkZWxldGVMaW5rUHJvdG90eXBlIiA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgJ2NsYXNzJyA9PiAnV0ZMaW5rJywKICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb3BlcnRpZXMnID0+IGFycmF5KCdsYWJlbCcgPT4gJ0RlbGV0ZScpLAogICAgICAgICAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3ZhbHVlJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnaW5zdGFuY2VJRCcgPT4gJHNoYXJlZEVudGl0eUlkLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnI2N1cnJlbnQjJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbW9kZWxLZXlQYXRoJyA9PiAkZW50aXR5LT52YWx1ZUZvcktleSgncHJpbWFyeUtleVByb3BlcnR5JyksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbnMnID0+IGFycmF5KCdWYWx1ZVBhdHRlcm4nID0+ICR0aGlzLT5tb2R1bGVQYXRoIC4gJy9jb25maXJtRGVsZXRlLyUxJScpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApIAogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICk7CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvbGlzdC55YW1sJywgV0ZZYW1sOjpkdW1wKCRsaXN0WWFtbCkpOwoKICAgICAgICAvLyBidWlsZCBsaXN0LnRwbAogICAgICAgICR0aGlzLT5zbWFydHktPmFzc2lnbignbGlzdEZvcm1JZCcsICRsaXN0Rm9ybUlkKTsKICAgICAgICBmaWxlX3B1dF9jb250ZW50cygkbW9kdWxlRGlyIC4gJy9saXN0LnRwbCcsICR0aGlzLT5zbWFydHktPmZldGNoKEZSQU1FV09SS19ESVIgLiAnL2ZyYW1ld29yay9nZW5lcmF0b3IvbGlzdC50cGwnKSk7CgogICAgICAgIC8vIGJ1aWxkIGVkaXQgcGFnZQogICAgICAgIC8vIGJ1aWxkIGVkaXQueWFtbAogICAgICAgICRlZGl0WWFtbCA9IGFycmF5KCk7CiAgICAgICAgJGVkaXRGb3JtSWQgPSAnZWRpdCcgLiAkZW50aXR5LT52YWx1ZUZvcktleSgnbmFtZScpIC4gJ0Zvcm0nOwogICAgICAgICRlZGl0WWFtbFskZWRpdEZvcm1JZF0gPSBhcnJheSgnY2xhc3MnID0+ICdXRkZvcm0nLCAnY2hpbGRyZW4nID0+IGFycmF5KCkpOwoKICAgICAgICAkd2lkZ2V0cyA9IGFycmF5KCk7CiAgICAgICAgZm9yZWFjaCAoJGVudGl0eS0+Z2V0UHJvcGVydGllcygpIGFzICRwcm9wZXJ0eSkgewogICAgICAgICAgICAkd2lkZ2V0SUQgPSAkcHJvcGVydHktPnZhbHVlRm9yS2V5KCduYW1lJyk7CiAgICAgICAgICAgICR3aWRnZXRzWyR3aWRnZXRJRF0gPSAkcHJvcGVydHk7CgogICAgICAgICAgICBpZiAoJHByb3BlcnR5LT52YWx1ZUZvcktleSgnbmFtZScpID09PSAkZW50aXR5LT52YWx1ZUZvcktleSgncHJpbWFyeUtleVByb3BlcnR5JykpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICRjbGFzcyA9ICdXRkhpZGRlbic7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBzd2l0Y2ggKCRwcm9wZXJ0eS0+dmFsdWVGb3JLZXkoJ3R5cGUnKSkgewogICAgICAgICAgICAgICAgICAgIGNhc2UgV0ZNb2RlbEVudGl0eVByb3BlcnR5OjpUWVBFX1RFWFQ7CiAgICAgICAgICAgICAgICAgICAgICAgICRjbGFzcyA9ICdXRlRleHRBcmVhJzsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgY2FzZSBXRk1vZGVsRW50aXR5UHJvcGVydHk6OlRZUEVfTlVNQkVSOwogICAgICAgICAgICAgICAgICAgIGNhc2UgV0ZNb2RlbEVudGl0eVByb3BlcnR5OjpUWVBFX1NUUklORzsKICAgICAgICAgICAgICAgICAgICBjYXNlIFdGTW9kZWxFbnRpdHlQcm9wZXJ0eTo6VFlQRV9EQVRFVElNRTsKICAgICAgICAgICAgICAgICAgICBjYXNlIFdGTW9kZWxFbnRpdHlQcm9wZXJ0eTo6VFlQRV9USU1FOwogICAgICAgICAgICAgICAgICAgIGNhc2UgV0ZNb2RlbEVudGl0eVByb3BlcnR5OjpUWVBFX0RBVEU7CiAgICAgICAgICAgICAgICAgICAgICAgICRjbGFzcyA9ICdXRlRleHRGaWVsZCc7CiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgIGNhc2UgV0ZNb2RlbEVudGl0eVByb3BlcnR5OjpUWVBFX0JPT0xFQU47CiAgICAgICAgICAgICAgICAgICAgICAgICRjbGFzcyA9ICdXRkNoZWNrYm94JzsKICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAgICAgJGNsYXNzID0gJ1dGVGV4dEZpZWxkJzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICAkZWRpdFlhbWxbJGVkaXRGb3JtSWRdWydjaGlsZHJlbiddWyR3aWRnZXRJRF0gPSBhcnJheSgKICAgICAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICRjbGFzcywKICAgICAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAndmFsdWUnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RhbmNlSUQnID0+ICRzaGFyZWRFbnRpdHlJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnc2VsZWN0aW9uJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtb2RlbEtleVBhdGgnID0+ICR3aWRnZXRJRAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKTsKCiAgICAgICAgfQogICAgICAgIC8vIHN0YXR1cyBtZXNzYWdlCiAgICAgICAgJGVkaXRZYW1sWydzdGF0dXNNZXNzYWdlJ10gPSBhcnJheSgnY2xhc3MnID0+ICdXRk1lc3NhZ2VCb3gnKTsKICAgICAgICAkZWRpdFlhbWxbJGVkaXRGb3JtSWRdWydjaGlsZHJlbiddWydzYXZlTmV3J10gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGU3VibWl0JywKICAgICAgICAgICAgICAgICdwcm9wZXJ0aWVzJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAnbGFiZWwnID0+ICdDcmVhdGUgJyAuICRlbnRpdHktPnZhbHVlRm9yS2V5KCduYW1lJyksCiAgICAgICAgICAgICAgICAgICAgJ2FjdGlvbicgPT4gJ3NhdmUnCiAgICAgICAgICAgICAgICAgICAgKSwKICAgICAgICAgICAgICAgICdiaW5kaW5ncycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ2hpZGRlbicgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0YW5jZUlEJyA9PiAkc2hhcmVkRW50aXR5SWQsCiAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnc2VsZWN0aW9uJywKICAgICAgICAgICAgICAgICAgICAgICAgJ21vZGVsS2V5UGF0aCcgPT4gJ2lzTmV3JywKICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbnMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3ZhbHVlVHJhbnNmb3JtZXInID0+ICdXRk5lZ2F0ZUJvb2xlYW4nLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKTsKICAgICAgICAkZWRpdFlhbWxbJGVkaXRGb3JtSWRdWydjaGlsZHJlbiddWydzYXZlJ10gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGU3VibWl0JywKICAgICAgICAgICAgICAgICdwcm9wZXJ0aWVzJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAnbGFiZWwnID0+ICdTYXZlJwogICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICdoaWRkZW4nID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAnaW5zdGFuY2VJRCcgPT4gJHNoYXJlZEVudGl0eUlkLAogICAgICAgICAgICAgICAgICAgICAgICAnY29udHJvbGxlcktleScgPT4gJ3NlbGVjdGlvbicsCiAgICAgICAgICAgICAgICAgICAgICAgICdtb2RlbEtleVBhdGgnID0+ICdpc05ldycsCiAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICApOwogICAgICAgICRlZGl0WWFtbFskZWRpdEZvcm1JZF1bJ2NoaWxkcmVuJ11bJ2RlbGV0ZU9iaiddID0gYXJyYXkoCiAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRlN1Ym1pdCcsCiAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ2xhYmVsJyA9PiAnRGVsZXRlJwogICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICdoaWRkZW4nID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAnaW5zdGFuY2VJRCcgPT4gJHNoYXJlZEVudGl0eUlkLAogICAgICAgICAgICAgICAgICAgICAgICAnY29udHJvbGxlcktleScgPT4gJ3NlbGVjdGlvbicsCiAgICAgICAgICAgICAgICAgICAgICAgICdtb2RlbEtleVBhdGgnID0+ICdpc05ldycsCiAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICApOwogICAgICAgIGZpbGVfcHV0X2NvbnRlbnRzKCRtb2R1bGVEaXIgLiAnL2VkaXQueWFtbCcsIFdGWWFtbDo6ZHVtcCgkZWRpdFlhbWwpKTsKCiAgICAgICAgLy8gYnVpbGQgZWRpdC50cGwKICAgICAgICAkdGhpcy0+c21hcnR5LT5hc3NpZ24oJ2VkaXRGb3JtSWQnLCAkZWRpdEZvcm1JZCk7CiAgICAgICAgJHRoaXMtPnNtYXJ0eS0+YXNzaWduKCd3aWRnZXRzJywgJHdpZGdldHMpOwogICAgICAgIGZpbGVfcHV0X2NvbnRlbnRzKCRtb2R1bGVEaXIgLiAnL2VkaXQudHBsJywgJHRoaXMtPnNtYXJ0eS0+ZmV0Y2goRlJBTUVXT1JLX0RJUiAuICcvZnJhbWV3b3JrL2dlbmVyYXRvci9lZGl0LnRwbCcpKTsKCiAgICAgICAgLy8gYnVpbGQgY29uZmlybURlbGV0ZSBwYWdlCiAgICAgICAgJGNvbmZpcm1EZWxldGVZYW1sID0gYXJyYXkoKTsKICAgICAgICAkY29uZmlybURlbGV0ZUZvcm1JZCA9ICdjb25maXJtRGVsZXRlJyAuICRlbnRpdHktPnZhbHVlRm9yS2V5KCduYW1lJykgIC4gJ0Zvcm0nOwogICAgICAgICRwa0lkID0gJGVudGl0eS0+dmFsdWVGb3JLZXkoJ3ByaW1hcnlLZXlQcm9wZXJ0eScpOwogICAgICAgICRjb25maXJtRGVsZXRlWWFtbFskY29uZmlybURlbGV0ZUZvcm1JZF0gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGRm9ybScsCiAgICAgICAgICAgICAgICAnY2hpbGRyZW4nID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICRwa0lkID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkhpZGRlbicsCiAgICAgICAgICAgICAgICAgICAgICAgICdiaW5kaW5ncycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAndmFsdWUnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0YW5jZUlEJyA9PiAkc2hhcmVkRW50aXR5SWQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRyb2xsZXJLZXknID0+ICdzZWxlY3Rpb24nLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtb2RlbEtleVBhdGgnID0+ICRlbnRpdHktPnZhbHVlRm9yS2V5KCdwcmltYXJ5S2V5UHJvcGVydHknKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGU3VibWl0JywKICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb3BlcnRpZXMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2xhYmVsJyA9PiAnQ2FuY2VsJwogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApLAogICAgICAgICAgICAgICAgICAgICdkZWxldGVPYmonID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRlN1Ym1pdCcsCiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9wZXJ0aWVzJyA9PiBhcnJheSgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdsYWJlbCcgPT4gJ0RlbGV0ZScKICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICksCiAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICAkY29uZmlybURlbGV0ZVlhbWxbJ2NvbmZpcm1NZXNzYWdlJ10gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGTWVzc2FnZUJveCcsCiAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICd2YWx1ZScgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0YW5jZUlEJyA9PiAkc2hhcmVkRW50aXR5SWQsCiAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnc2VsZWN0aW9uJywKICAgICAgICAgICAgICAgICAgICAgICAgJ21vZGVsS2V5UGF0aCcgPT4gJGRlc2NyaXB0aXZlQ29sdW1uTmFtZSwKICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbnMnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ1ZhbHVlUGF0dGVybicgPT4gJ0FyZSB5b3Ugc3VyZSB5b3Ugd2FudCB0byBkZWxldGUgJyAuICRlbnRpdHktPnZhbHVlRm9yS2V5KCduYW1lJykgLiAnICIlMSUiPycKICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICkKICAgICAgICAgICAgICAgICk7CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvY29uZmlybURlbGV0ZS55YW1sJywgV0ZZYW1sOjpkdW1wKCRjb25maXJtRGVsZXRlWWFtbCkpOwogICAgICAgIAogICAgICAgIC8vIGNvbmZpcm1EZWxldGUudHBsIGZpbGUKICAgICAgICAkdGhpcy0+c21hcnR5LT5hc3NpZ24oJ2NvbmZpcm1EZWxldGVGb3JtSWQnLCAkY29uZmlybURlbGV0ZUZvcm1JZCk7CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvY29uZmlybURlbGV0ZS50cGwnLCAkdGhpcy0+c21hcnR5LT5mZXRjaChGUkFNRVdPUktfRElSIC4gJy9mcmFtZXdvcmsvZ2VuZXJhdG9yL2NvbmZpcm1EZWxldGUudHBsJykpOwoKICAgICAgICAvLyBkZWxldGUgc3VjY2VzcwogICAgICAgICRkZWxldGVTdWNjZXNzWWFtbCA9IGFycmF5KCk7CiAgICAgICAgJGRlbGV0ZVN1Y2Nlc3NZYW1sWydzdGF0dXNNZXNzYWdlJ10gPSBhcnJheSgKICAgICAgICAgICAgICAgICdjbGFzcycgPT4gJ1dGTWVzc2FnZUJveCcsCiAgICAgICAgICAgICAgICAncHJvcGVydGllcycgPT4gYXJyYXkoCiAgICAgICAgICAgICAgICAgICAgJ3ZhbHVlJyA9PiAkZW50aXR5LT52YWx1ZUZvcktleSgnbmFtZScpIC4gJyBzdWNjZXNzZnVsbHkgZGVsZXRlZC4nCiAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgKTsKICAgICAgICBmaWxlX3B1dF9jb250ZW50cygkbW9kdWxlRGlyIC4gJy9kZWxldGVTdWNjZXNzLnlhbWwnLCBXRllhbWw6OmR1bXAoJGRlbGV0ZVN1Y2Nlc3NZYW1sKSk7CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvZGVsZXRlU3VjY2Vzcy50cGwnLCAkdGhpcy0+c21hcnR5LT5mZXRjaChGUkFNRVdPUktfRElSIC4gJy9mcmFtZXdvcmsvZ2VuZXJhdG9yL2RlbGV0ZVN1Y2Nlc3MudHBsJykpOwoKICAgICAgICAvLyBkZXRhaWwgcGFnZQogICAgICAgICRkZXRhaWxZYW1sID0gYXJyYXkoKTsKICAgICAgICAkd2lkZ2V0cyA9IGFycmF5KCk7CiAgICAgICAgZm9yZWFjaCAoJGVudGl0eS0+Z2V0UHJvcGVydGllcygpIGFzICRwcm9wZXJ0eSkgewogICAgICAgICAgICAkd2lkZ2V0SUQgPSAkcHJvcGVydHktPnZhbHVlRm9yS2V5KCduYW1lJyk7CiAgICAgICAgICAgICR3aWRnZXRzWyR3aWRnZXRJRF0gPSAkcHJvcGVydHk7CiAgICAgICAgICAgICRkZXRhaWxZYW1sWyR3aWRnZXRJRF0gPSBhcnJheSgKICAgICAgICAgICAgICAgICAgICAnY2xhc3MnID0+ICdXRkxhYmVsJywKICAgICAgICAgICAgICAgICAgICAnYmluZGluZ3MnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAndmFsdWUnID0+IGFycmF5KAogICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RhbmNlSUQnID0+ICRzaGFyZWRFbnRpdHlJZCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250cm9sbGVyS2V5JyA9PiAnc2VsZWN0aW9uJywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtb2RlbEtleVBhdGgnID0+ICR3aWRnZXRJRAogICAgICAgICAgICAgICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvZGV0YWlsLnlhbWwnLCBXRllhbWw6OmR1bXAoJGRldGFpbFlhbWwpKTsKICAgICAgIAogICAgICAgIC8vIGJ1aWxkIGRldGFpbC50cGwKICAgICAgICAkdGhpcy0+c21hcnR5LT5hc3NpZ24oJ3dpZGdldHMnLCAkd2lkZ2V0cyk7CiAgICAgICAgZmlsZV9wdXRfY29udGVudHMoJG1vZHVsZURpciAuICcvZGV0YWlsLnRwbCcsICR0aGlzLT5zbWFydHktPmZldGNoKEZSQU1FV09SS19ESVIgLiAnL2ZyYW1ld29yay9nZW5lcmF0b3IvZGV0YWlsLnRwbCcpKTsKICAgIH0KfQo=]]></response>

March 18, 2011 03:24 PM Alan Pinstein
The last successful send.

Content:
context_names -d 0 -i 28

March 18, 2011 03:25 PM Robert
Two things:

1) When it's hung, can you go to /Applications/Utilities/Activity Monitor.app, find MacGDBp, and click Sample Process. Upload the sample here.

2) Check /Applications/Utilities/Console.app and see if there are any messages from MacGDBp when it gets hung.

March 18, 2011 03:31 PM Alan Pinstein
1) There are 2 entries in the console log:

3/18/11 11:27:39 AM MacGDBp[29028] tx = 0 vs 27
3/18/11 11:27:39 AM MacGDBp[29028] out of date transaction 273

2) The "Sample Process" output:

NOTE: I am not sure this is the right "place" as we might've hit a UI button after the hang. It's hard to tell exactly when it hangs.

Sampling process 29028 for 3 seconds with 1 millisecond of run time
between samples
Sampling completed, processing symbols...
Analysis of sampling MacGDBp (pid 29028) every 1 millisecond
Process: MacGDBp [29028]
Path: /Users/ardell/Downloads/MacGDBp 1.4.app/Contents/MacOS/MacGDBp
Load Address: 0x1000
Identifier: org.bluestatic.macgdbp
Version: 1.4 (85)
Code Type: X86 (Native)
Parent Process: launchd [348]

Date/Time: 2011-03-18 11:30:05.903 -0400
OS Version: Mac OS X 10.6.6 (10J567)
Report Version: 6

Call graph:
2411 Thread_1676663 DispatchQueue_1: com.apple.main-thread (serial)
2411 start
2411 NSApplicationMain
2411 -[NSApplication run]
2411 -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
2411 _DPSNextEvent
2411 BlockUntilNextEventMatchingListInMode
2411 ReceiveNextEventCommon
2411 RunCurrentEventLoopInMode
2411 CFRunLoopRunInMode
2411 CFRunLoopRunSpecific
2411 __CFRunLoopRun
2411 mach_msg
2411 mach_msg_trap
2411 Thread_1676666 DispatchQueue_2:
com.apple.libdispatch-manager (serial)
2411 start_wqthread
2411 _pthread_wqthread
2411 _dispatch_worker_thread2
2411 _dispatch_queue_invoke
2411 _dispatch_mgr_invoke
2411 kevent
2411 Thread_1676670
2411 thread_start
2411 _pthread_start
2411 __NSThread__main__
2411 -[NSThread main]
2411 -[NetworkConnection runNetworkThread]
2411 CFRunLoopRun
2411 CFRunLoopRunSpecific
2411 __CFRunLoopRun
2411 mach_msg
2411 mach_msg_trap
2411 Thread_1676671: com.apple.CFSocket.private
2411 thread_start
2411 _pthread_start
2411 __CFSocketManager
2411 select$DARWIN_EXTSN
2411 Thread_1677665
2411 start_wqthread
2411 _pthread_wqthread
2411 __workq_kernreturn

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
mach_msg_trap 4822
__workq_kernreturn 2411
kevent 2411
select$DARWIN_EXTSN 2411

Binary Images:
0x1000 - 0x10ffb +org.bluestatic.macgdbp 1.4 (85)
<4381E03F-895D-DA10-7748-88174BDD8EB2> /Users/ardell/Downloads/MacGDBp
1.4.app/Contents/MacOS/MacGDBp
0x1b000 - 0x2efff +org.andymatuschak.Sparkle 1.5 Beta 6 (313)
<5DF2B8A3-560D-4500-6B85-4215644DE532> /Users/ardell/Downloads/MacGDBp
1.4.app/Contents/Frameworks/Sparkle.framework/Versions/A/Sparkle
0x3c000 - 0xf1fe7 libcrypto.0.9.7.dylib 0.9.7 (compatibility
0.9.7) <AACC86C0-86B4-B1A7-003F-2A0AF68973A2>
/usr/lib/libcrypto.0.9.7.dylib
0x8fe00000 - 0x8fe4162b dyld 132.1 (???)
<749D24EE-54BD-D74B-D305-C13F5E6C95D8> /usr/lib/dyld
0x9008b000 - 0x901b9fe7 com.apple.CoreData 102.1 (251)
<87FE6861-F2D6-773D-ED45-345272E56463>
/System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
0x901ba000 - 0x901baff7 com.apple.Accelerate.vecLib 3.6 (vecLib 3.6)
<ABF97DA4-3BDF-6FFD-6239-B023CA1F7974>
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
0x901bb000 - 0x901c1fff com.apple.CommonPanels 1.2.4 (91)
<2438AF5D-067B-B9FD-1248-2C9987F360BA>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
0x901c2000 - 0x901e2fe7 libresolv.9.dylib 41.0.0 (compatibility
1.0.0) <BF7FF2F6-5FD3-D78F-77BC-9E2CB2A5E309>
/usr/lib/libresolv.9.dylib
0x90266000 - 0x90276ff7 libsasl2.2.dylib 3.15.0 (compatibility 3.0.0)
<C8744EA3-0AB7-CD03-E639-C4F2B910BE5D> /usr/lib/libsasl2.2.dylib
0x90301000 - 0x90305ff7 libGIF.dylib ??? (???)
<FA466D54-68CF-D1AB-47A0-4134C8B1B6FD>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
0x90314000 - 0x90347ff7 com.apple.AE 496.4 (496.4)
<C73D124C-C722-41D8-3465-4CE0D0BA9307>
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x9037b000 - 0x903beff7 libGLU.dylib ??? (???)
<BB66EDB2-D5FE-61C9-21BE-747F9862819C>
/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
0x903bf000 - 0x90489fef com.apple.CoreServices.OSServices 357 (357)
<F66F783A-9B51-953F-CAC9-509E1F550B4B>
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x9048a000 - 0x904a5ff7 libPng.dylib ??? (???)
<DF9BC42C-13E0-3080-A106-75121FD577CF>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
0x904a6000 - 0x90515ff7 libvMisc.dylib 268.0.1 (compatibility 1.0.0)
<595A5539-9F54-63E6-7AAC-C04E1574B050>
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
0x90516000 - 0x90518ff7 com.apple.securityhi 4.0 (36638)
<C7DA80C1-DCFD-C321-08DA-5E6946CA66E0>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
0x90721000 - 0x90765fe7 com.apple.Metadata 10.6.3 (507.15)
<A23633F1-E913-66C2-A073-E2B174C09B18>
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x907d5000 - 0x90af9fef com.apple.HIToolbox 1.6.4 (???)
<4699C8BB-DE74-C530-564B-D131F74C9B54>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x90c8d000 - 0x90e46feb com.apple.ImageIO.framework 3.0.4 (3.0.4)
<6D8C6C54-9F39-0D0F-564D-2ABA12E97BBC>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
0x90e47000 - 0x90eabffb com.apple.htmlrendering 72 (1.1.4)
<4D451A35-FAB6-1288-71F6-F24A4B6E2371>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HTMLRendering.framework/Versions/A/HTMLRendering
0x90f03000 - 0x90f9eff7 com.apple.ApplicationServices.ATS 4.4 (???)
<ECB16606-4DF8-4AFB-C91D-F7947C26040F>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x91102000 - 0x9115fff7 com.apple.framework.IOKit 2.0 (???)
<A769737F-E0D6-FB06-29B4-915CF4F43420>
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x9127a000 - 0x91660ffb com.apple.RawCamera.bundle 3.4.1 (546)
<D966727B-B687-3029-067F-87FC6CCEBB55>
/System/Library/CoreServices/RawCamera.bundle/Contents/MacOS/RawCamera
0x91661000 - 0x917e3fe7 libicucore.A.dylib 40.0.0 (compatibility
1.0.0) <35DB7644-0780-D2AB-F6A9-45F28D2D434A>
/usr/lib/libicucore.A.dylib
0x91899000 - 0x918bfffb com.apple.DictionaryServices 1.1.2 (1.1.2)
<43E1D565-6E01-3681-F2E5-72AE4C3A097A>
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
0x918f0000 - 0x91951fe7 com.apple.CoreText 3.5.0 (???)
<BB50C045-25F5-65B8-B1DB-8CDAEF45EB46>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText
0x9195a000 - 0x9199eff3 com.apple.coreui 2 (114)
<2234855E-3BED-717F-0BFA-D1A289ECDBDA>
/System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
0x9199f000 - 0x91cbfff3 com.apple.CoreServices.CarbonCore 861.23
(861.23) <96534EF7-C22E-0C01-C56F-FF7047E41224>
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x91cc0000 - 0x91d6afe7 com.apple.CFNetwork 454.11.5 (454.11.5)
<DD575760-7A29-111D-5A69-EAFD3410F74D>
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x91d6b000 - 0x91e48ff7 com.apple.vImage 4.0 (4.0)
<64597E4B-F144-DBB3-F428-0EC3D9A1219E>
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
0x91e71000 - 0x91ea2ff7 libGLImage.dylib ??? (???)
<E3EC8E92-4DDD-E7B8-3D38-C5A5160A4930>
/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
0x91ea3000 - 0x91eb4ff7 com.apple.LangAnalysis 1.6.6 (1.6.6)
<3036AD83-4F1D-1028-54EE-54165E562650>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x91ee1000 - 0x91ee4ff7 libCoreVMClient.dylib ??? (???)
<973B9E1F-70B3-2E76-B14B-E57F306AD2DF>
/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib
0x91ee5000 - 0x91f27ff7 libvDSP.dylib 268.0.1 (compatibility 1.0.0)
<8A4721DE-25C4-C8AA-EA90-9DA7812E3EBA>
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
0x92105000 - 0x92111ff7 libkxld.dylib ??? (???)
<9D8378E0-1C58-EED8-EA00-F4515B8BE7A3> /usr/lib/system/libkxld.dylib
0x92112000 - 0x92134fef com.apple.DirectoryService.Framework 3.6
(621.9) <3171B16F-E4E1-89AA-B846-D698E3D6D457>
/System/Library/Frameworks/DirectoryService.framework/Versions/A/DirectoryService
0x92135000 - 0x92156fe7 com.apple.opencl 12.3 (12.3)
<DEA600BF-4F54-66B5-DB2F-DC57FD518543>
/System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL
0x92157000 - 0x921a7ff7 com.apple.framework.familycontrols 2.0.2
(2020) <AF7F86F1-F7BF-CBA8-7A4A-D8F7A19F9601>
/System/Library/PrivateFrameworks/FamilyControls.framework/Versions/A/FamilyControls
0x921a8000 - 0x9234fff7 libSystem.B.dylib 125.2.1 (compatibility
1.0.0) <4FFBF71A-D603-3C64-2BC6-BFBFFFD562F0>
/usr/lib/libSystem.B.dylib
0x92350000 - 0x923d2ffb SecurityFoundation ??? (???)
<2E1F1AF0-A258-D215-2600-5DF03896D1F1>
/System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
0x923d3000 - 0x9246bfe7 edu.mit.Kerberos 6.5.10 (6.5.10)
<DC19F49B-184E-FD0F-13F8-3A31924A3B66>
/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
0x925ad000 - 0x929e2ff7 libLAPACK.dylib 219.0.0 (compatibility 1.0.0)
<5E2D2283-57DE-9A49-1DB0-CD027FEFA6C2>
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
0x929e3000 - 0x929e7ff7 libGFXShared.dylib ??? (???)
<9E14BE2F-C863-40E9-41A6-1BE9045663A0>
/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib
0x92a17000 - 0x92a1bff7 IOSurface ??? (???)
<235E7E3D-B6E5-0AAA-C41A-7AC1F54A7EBF>
/System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
0x92a1c000 - 0x92a52fff libtidy.A.dylib ??? (???)
<0FD72C68-4803-4C5B-3A63-05D7394BFD71> /usr/lib/libtidy.A.dylib
0x92cb0000 - 0x92d4dfe3 com.apple.LaunchServices 362.2 (362.2)
<F3952CAB-322F-A12F-57AF-8B91B1D76DDE>
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x92e1d000 - 0x92e1eff7 com.apple.TrustEvaluationAgent 1.1 (1)
<2D970A9B-77E8-EDC0-BEC6-7580D78B2843>
/System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent
0x92e1f000 - 0x92e3eff7 com.apple.CoreVideo 1.6.2 (45.6)
<EB53CAA4-5EE2-C356-A954-5775F7DDD493>
/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
0x92eae000 - 0x92ed6ff7 libxslt.1.dylib 3.24.0 (compatibility 3.0.0)
<769EF4B2-C1AD-73D5-AAAD-1564DAEA77AF> /usr/lib/libxslt.1.dylib
0x92f59000 - 0x9305dfe7 libcrypto.0.9.8.dylib 0.9.8 (compatibility
0.9.8) <BDEFA030-5E75-7C47-2904-85AB16937F45>
/usr/lib/libcrypto.0.9.8.dylib
0x9305e000 - 0x930a1ff7 com.apple.NavigationServices 3.5.4 (182)
<8DC6FD4A-6C74-9C23-A4C3-715B44A8D28C>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/NavigationServices.framework/Versions/A/NavigationServices
0x930a2000 - 0x93299feb com.apple.JavaScriptCore 6533.18 (6533.18.1)
<F740BA2B-EFCF-98E2-FFC2-361BD7D41330>
/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore
0x9329a000 - 0x932e7feb
com.apple.DirectoryService.PasswordServerFramework 6.0 (6.0)
<BF66BA5D-BBC8-78A5-DBE2-F9DE3DD1D775>
/System/Library/PrivateFrameworks/PasswordServer.framework/Versions/A/PasswordServer
0x9333f000 - 0x93363ff7 libJPEG.dylib ??? (???)
<E064CF03-8CC2-C83E-C951-D46610834D1C>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
0x93369000 - 0x93422fe7 libsqlite3.dylib 9.6.0 (compatibility 9.0.0)
<52438E77-55D1-C231-1936-76F1369518E4> /usr/lib/libsqlite3.dylib
0x93423000 - 0x93c12557 com.apple.CoreGraphics 1.545.0 (???)
<1AB39678-00D5-FB88-3B41-93D78348E0DE>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
0x93c31000 - 0x93cc3fe7 com.apple.print.framework.PrintCore 6.3
(312.7) <7410D1B2-655D-68DA-D4B9-2C65747B6817>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0x93cc4000 - 0x93cdcff7 com.apple.CFOpenDirectory 10.6 (10.6)
<F9AFC571-3539-6B46-ABF9-46DA2B608819>
/System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
0x93cdd000 - 0x93cddff7 com.apple.ApplicationServices 38 (38)
<8012B504-3D83-BFBB-DA65-065E061CFE03>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
0x93cdf000 - 0x93e0efe3 com.apple.audio.toolbox.AudioToolbox 1.6.5
(1.6.5) <0A0F68E5-4806-DB51-764B-D97554B801AD>
/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
0x94109000 - 0x94109ff7 com.apple.Carbon 150 (152)
<734BDB59-8B13-54FA-0653-AA8623DF9846>
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
0x941c5000 - 0x9423ffff com.apple.audio.CoreAudio 3.2.6 (3.2.6)
<A02CEAE9-943A-CBE2-2350-4631C1E7B0A7>
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x9475f000 - 0x9486bff7 libGLProgrammability.dylib ??? (???)
<A077BFEA-19C6-9F48-2F36-8E4E55376F49>
/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib
0x9486c000 - 0x94876fe7 com.apple.audio.SoundManager 3.9.3 (3.9.3)
<5F494955-7290-2D91-DA94-44B590191771>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CarbonSound.framework/Versions/A/CarbonSound
0x9487f000 - 0x948a9ff7 com.apple.shortcut 1.1 (1.1)
<B0514FA9-7CAE-AD94-93CA-7B2A2C5F7B8A>
/System/Library/PrivateFrameworks/Shortcut.framework/Versions/A/Shortcut
0x948aa000 - 0x948dcfe3 libTrueTypeScaler.dylib ??? (???)
<6E9D1A50-330E-F1F4-F93D-9ECC8A61B21A>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libTrueTypeScaler.dylib
0x948dd000 - 0x9495dfeb com.apple.SearchKit 1.3.0 (1.3.0)
<9E18AEA5-F4B4-8BE5-EEA9-818FC4F46FD9>
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x9495e000 - 0x94968ffb com.apple.speech.recognition.framework 3.11.1
(3.11.1) <7486003F-8FDB-BD6C-CB34-DE45315BD82C>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
0x94969000 - 0x94970ff3 com.apple.print.framework.Print 6.1 (237.1)
<F5AAE53D-5530-9004-A9E3-2C1690C5328E>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
0x94971000 - 0x9497cff7 libCSync.A.dylib 545.0.0 (compatibility
64.0.0) <CB2510BD-A5B3-9D90-5917-C73F6ECAC913>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCSync.A.dylib
0x94c0d000 - 0x94c48feb libFontRegistry.dylib ??? (???)
<4FB144ED-8AF9-27CF-B315-DCE5575D5231>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib
0x94c49000 - 0x94c82ff7 libcups.2.dylib 2.8.0 (compatibility 2.0.0)
<E0D512DD-365D-46A0-F50C-435BC250424F> /usr/lib/libcups.2.dylib
0x94d62000 - 0x950cdff7 com.apple.QuartzCore 1.6.3 (227.34)
<0B59EAF1-4892-C5CE-4A67-66EBD383359E>
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
0x9511c000 - 0x9511cff7 com.apple.Cocoa 6.6 (???)
<EA27B428-5904-B00B-397A-185588698BCC>
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
0x95176000 - 0x95184ff7 com.apple.opengl 1.6.12 (1.6.12)
<9F13B279-F289-18AC-5D86-DCD52BAF087D>
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
0x9527c000 - 0x9527cff7 com.apple.Accelerate 1.6 (Accelerate 1.6)
<3891A689-4F38-FACD-38B2-4BF937DE30CF>
/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
0x9527d000 - 0x9532dff3 com.apple.ColorSync 4.6.3 (4.6.3)
<0354B408-665F-8B3F-87FF-64E6322276F0>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync
0x9532e000 - 0x9532eff7 com.apple.CoreServices 44 (44)
<51CFA89A-33DB-90ED-26A8-67D461718A4A>
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x9532f000 - 0x95378fe7 libTIFF.dylib ??? (???)
<72AC8D6B-F187-1462-901F-999E68C24848>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
0x9584f000 - 0x9629aff7 com.apple.WebCore 6533.18 (6533.18.1)
<55C5330D-DB7D-56B3-E31A-5FF98BD9A3A8>
/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore
0x9629b000 - 0x96416fe7 com.apple.CoreFoundation 6.6.4 (550.42)
<C78D5079-663E-9734-7AFA-6CE79A0539F1>
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x96460000 - 0x96466fe7 com.apple.CommerceCore 1.0 (6)
<41C2A87D-93D8-56C1-9292-0400699F23C1>
/System/Library/PrivateFrameworks/CommerceKit.framework/Versions/A/Frameworks/CommerceCore.framework/Versions/A/CommerceCore
0x964ac000 - 0x96d8cff7 com.apple.AppKit 6.6.7 (1038.35)
<ABC7783C-E4D5-B848-BED6-99451D94D120>
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x96d8d000 - 0x96d8dff7 liblangid.dylib ??? (???)
<B99607FC-5646-32C8-2C16-AFB5EA9097C2> /usr/lib/liblangid.dylib
0x96e38000 - 0x96f13feb com.apple.DesktopServices 1.5.9 (1.5.9)
<CED00AC1-924B-0E45-7D5E-1CEA8929F5BE>
/System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
0x96f14000 - 0x9732aff7 libBLAS.dylib 219.0.0 (compatibility 1.0.0)
<C4FB303A-DB4D-F9E8-181C-129585E59603>
/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
0x9736c000 - 0x9736eff7 libRadiance.dylib ??? (???)
<68BF4654-B74A-C843-759F-7FC62385F251>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
0x9736f000 - 0x97375ff7 libCGXCoreImage.A.dylib 545.0.0
(compatibility 64.0.0) <DACD11D8-4B64-CD3B-C988-B1041E07D13A>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCGXCoreImage.A.dylib
0x97378000 - 0x97378ff7 com.apple.vecLib 3.6 (vecLib 3.6)
<FF4DC8B6-0AB0-DEE8-ADA8-7B57645A1F36>
/System/Library/Frameworks/vecLib.framework/Versions/A/vecLib
0x97615000 - 0x976c2fe7 libobjc.A.dylib 227.0.0 (compatibility 1.0.0)
<C8925910-B927-968B-4B71-D83A4CEF8646> /usr/lib/libobjc.A.dylib
0x976d4000 - 0x976dfff7 libGL.dylib ??? (???)
<48405993-0AE9-292B-6705-C3525528682A>
/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x97708000 - 0x97724fe3 com.apple.openscripting 1.3.1 (???)
<2A748037-D1C0-6D47-2C4A-0562AF799AC9>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
0x97725000 - 0x97728ff7 libCGXType.A.dylib 545.0.0 (compatibility
64.0.0) <B624AACE-991B-0FFA-2482-E69970576CE1>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libCGXType.A.dylib
0x97729000 - 0x9776aff7 libRIP.A.dylib 545.0.0 (compatibility 64.0.0)
<16DAE1A5-937A-1CA2-D98F-2AF958B62993>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/libRIP.A.dylib
0x9776b000 - 0x97813ffb com.apple.QD 3.36 (???)
<FA2785A4-BB69-DCB4-3BA3-7C89A82CAB41>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
0x97814000 - 0x97817ffb com.apple.help 1.3.1 (41)
<67F1F424-3983-7A2A-EC21-867BE838E90B>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
0x97b36000 - 0x97becff7 libFontParser.dylib ??? (???)
<33F62EE1-E457-C6FD-369E-E86745B94A4B>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib
0x97c39000 - 0x97c4efff com.apple.ImageCapture 6.0.1 (6.0.1)
<E7ED2AC1-834C-A44E-531E-EC05F0496DBF>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
0x97c4f000 - 0x97c52fe7 libmathCommon.A.dylib 315.0.0 (compatibility
1.0.0) <1622A54F-1A98-2CBE-B6A4-2122981A500E>
/usr/lib/system/libmathCommon.A.dylib
0x97d01000 - 0x97d0eff7 com.apple.NetFS 3.2.1 (3.2.1)
<94A52A6D-F071-09D7-E80F-F633F17233FE>
/System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
0x97d8c000 - 0x97feffff com.apple.security 6.1.1 (37594)
<B6F2A8BF-C1B7-A0E2-83FB-4FF265E9BDDC>
/System/Library/Frameworks/Security.framework/Versions/A/Security
0x980c2000 - 0x98113ff7 com.apple.HIServices 1.8.2 (???)
<F6EAC2D1-902A-9374-FC4B-43B50E054416>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
0x98140000 - 0x98141ff7 com.apple.audio.units.AudioUnit 1.6.5 (1.6.5)
<BE4C2495-B758-AD22-DCC0-56A6791E948E>
/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
0x98142000 - 0x9814bff7 com.apple.DiskArbitration 2.3 (2.3)
<E9C40767-DA6A-6CCB-8B00-2D5706753000>
/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x98181000 - 0x98282fe7 libxml2.2.dylib 10.3.0 (compatibility 10.0.0)
<ED8E45C6-B078-15E8-938D-99D8FD1EAE64> /usr/lib/libxml2.2.dylib
0x982cb000 - 0x98379ff3 com.apple.ink.framework 1.3.3 (107)
<233A981E-A2F9-56FB-8BDE-C2DEC3F20784>
/System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
0x9837a000 - 0x9837fff7 com.apple.OpenDirectory 10.6 (10.6)
<C1B46982-7D3B-3CC4-3BC2-3E4B595F0231>
/System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
0x98380000 - 0x983c6ff7 libauto.dylib ??? (???)
<29422A70-87CF-10E2-CE59-FEE1234CFAAE> /usr/lib/libauto.dylib
0x99350000 - 0x995c3fe7 com.apple.Foundation 6.6.4 (751.42)
<65F16BF4-D106-F2F5-53F3-5BFBC2FCE608>
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x99604000 - 0x99618fe7 libbsm.0.dylib ??? (???)
<14CB053A-7C47-96DA-E415-0906BA1B78C9> /usr/lib/libbsm.0.dylib
0x99629000 - 0x99738fe7 com.apple.WebKit 6533.18 (6533.18.1)
<C7FF7199-91FF-7F6F-C5D9-487A86D65E07>
/System/Library/Frameworks/WebKit.framework/Versions/A/WebKit
0x99739000 - 0x99776ff7 com.apple.SystemConfiguration 1.10.5 (1.10.2)
<362DF639-6E5F-9371-9B99-81C581A8EE41>
/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x9987a000 - 0x998e4fe7 libstdc++.6.dylib 7.9.0 (compatibility 7.0.0)
<411D87F4-B7E1-44EB-F201-F8B4F9227213> /usr/lib/libstdc++.6.dylib
0x9991d000 - 0x9992bfe7 libz.1.dylib 1.2.3 (compatibility 1.0.0)
<33C1B260-ED05-945D-FC33-EF56EC791E2E> /usr/lib/libz.1.dylib
0x9992c000 - 0x9993eff7 com.apple.MultitouchSupport.framework 207.10
(207.10) <32CE2895-DAF0-2137-F9BE-8150359F43A1>
/System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport
0x9993f000 - 0x99949ff7 com.apple.HelpData 2.0.4 (34)
<001A7163-C977-C30F-1B4B-4F5647F72E96>
/System/Library/PrivateFrameworks/HelpData.framework/Versions/A/HelpData
0x9994a000 - 0x9995effb com.apple.speech.synthesis.framework 3.10.35
(3.10.35) <57DD5458-4F24-DA7D-0927-C3321A65D743>
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0xffff0000 - 0xffff1fff libSystem.B.dylib ??? (???)
<4FFBF71A-D603-3C64-2BC6-BFBFFFD562F0> /usr/lib/libSystem.B.dylib
Sample analysis of process 29028 written to file /dev/stdout

March 18, 2011 03:33 PM Alan Pinstein
Your bugtracker flatten the stack trace formatting.... this should help.

On March 18, 2011 03:34 PM, Alan Pinstein changed:
April 5, 2011 08:12 AM Thibaut Allender
Same bug here, MacOS 10.5.8

January 15, 2015 03:39 AM outis
Still present in 1.5. It also happens when pausing on a breakpoint, not just during stepping. The "Continue" and "Evaluate" commands also stop working (I'm guessing any command that causes MacGDBp to send a message to XDebug stops working). "Stop" works, but a "Could not open socket" message appears in MacGDBp's status bar and further sessions won't start in MacGDBp (until it's quit & reopened), and hang on the XDebug side of things.

My stack traces are basically the same as Alan's (though with a few more threads).

Wireshark reveals the packet that XDebug sends in response to `context_names`. Here it is (MacGDBp's commands prefixed with "?", responses with "!")

? source -f file:///... -i 94
! 43302\0<?xml ...
? context_names -d 0 -i 95
! 273\0<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="95"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context></response>\0

At this point, MacGDBp logs the following:

Transaction #0 is out of date (lastRead = 94). Dropping packet: 273

That seems to show what's happening, though not why.

January 15, 2015 03:40 AM outis
Still present in 1.5. It also happens when pausing on a breakpoint, not just during stepping. The "Continue" and "Evaluate" commands also stop working (I'm guessing any command that causes MacGDBp to send a message to XDebug stops working). "Stop" works, but a "Could not open socket" message appears in MacGDBp's status bar and further sessions won't start in MacGDBp (until it's quit & reopened), and hang on the XDebug side of things.

My stack traces are basically the same as Alan's (though with a few more threads).

Wireshark reveals the packet that XDebug sends in response to `context_names`. Here it is (MacGDBp's commands prefixed with "?", responses with "!")

? source -f file:///... -i 94
! 43302\0<?xml ...
? context_names -d 0 -i 95
! 273\0<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="95"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context></response>\0

At this point, MacGDBp logs the following:

Transaction #0 is out of date (lastRead = 94). Dropping packet: 273

That seems to show what's happening, though not why.

January 15, 2015 03:40 AM outis
Still present in 1.5. It also happens when pausing on a breakpoint, not just during stepping. The "Continue" and "Evaluate" commands also stop working (I'm guessing any command that causes MacGDBp to send a message to XDebug stops working). "Stop" works, but a "Could not open socket" message appears in MacGDBp's status bar and further sessions won't start in MacGDBp (until it's quit & reopened), and hang on the XDebug side of things.

My stack traces are basically the same as Alan's (though with a few more threads).

Wireshark reveals the packet that XDebug sends in response to `context_names`. Here it is (MacGDBp's commands prefixed with "?", responses with "!")

? source -f file:///... -i 94
! 43302\0<?xml version="1.0" encoding="iso-8859-1"?>...
? context_names -d 0 -i 95
! 273\0<?xml version="1.0" encoding="iso-8859-1"?>
<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="95"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context></response>\0

At this point, MacGDBp logs the following:

Transaction #0 is out of date (lastRead = 94). Dropping packet: 273

That seems to show what's happening, though not why.

January 15, 2015 03:42 AM outis
Ack! The bug tracker has a bug! Posting a reply returns numerous PHP warnings & errors, with no notice that the post was successful (hence my duplicate posts).

December 14, 2018 11:20 PM outis
Note the packet content in the logged message is the packet length, rather than the XML. It seems that an earlier read from the network returns an empty string when there isn't a current packet. When this happens, `readStreamHasData:` still reads the packet size from the empty string and create a new packet. It advances `bufferOffset`, which then exceeds `bytesRead`, and `readStreamHasData:` exits without handling the (empty) packet. The next time data comes in, there's a current packet so the chunk (which is actually the length of the next packet) gets appended.

Simply skipping chunks of length 1 should resolve (though they may signal some other issue, and addressing them directly may be the better course).

December 14, 2018 11:28 PM outis
Skips empty chunks when reading from network stream.