TritonDataCenter / mdb_v8

postmortem debugging for Node.js and other V8-based programs
Mozilla Public License 2.0
240 stars 18 forks source link

jsclosure failed with closure variable referencing very large string #86

Open davepacheco opened 7 years ago

davepacheco commented 7 years ago

I haven't confirmed why this failed, but in debugging MANTA-3192, I found a closure referencing an enormous string (690 million characters), but jsclosure wouldn't even try to print it out:

> 98487c6d::jsclosure
    "cb": 98487c0d: function <anonymous> (as <anon>)
mdb: 98487c6d: failed to iterate closure variables

But I was able to get at the string by hand:

> 98487c6d::v8function
98487c6d: JSFunction: <anonymous> (as <anon>)
defined at /opt/smartdc/mola/lib/common.js position 1380
context: 98487c41
shared scope_info: 984571cd
code: 92c16681
instructions: [92c166c0, 92c166e5)

> 98487c41::v8context
closure function: 8185e405 (JSFunction)
previous context: 81858ab9 (FixedArray)
extension: 0 (SMI: value = 0)
global object: a1234659 (JSGlobalObject)
    slot 0: 98487c0d (JSFunction)
    slot 1: 813e39d1 (ConsString)

> 813e39d1::v8print
813e39d1 ConsString {
    813e39d1 String {
        813e39d1 HeapObject < Object  {
            813e39d0 map = a9b08351 (Map)
        }
        813e39d4 length = 526b5602 (SMI: value = 691383041)
    }

It would be nice if it printed a truncated version of the string in this case.

davepacheco commented 7 years ago

There's an example dump in our internal thoth -- dump a12471315816e749.