plasma-umass / BLeak

BLeak: Automatically Debugging Memory Leaks in Web Applications
MIT License
408 stars 41 forks source link

Unable to get interceptor to detect the initial GET of the application's start page #39

Closed buddyp450 closed 5 years ago

buddyp450 commented 5 years ago

I ran bleak with proxy-session in an attempt to debug why my check was timing out and I discovered that if I attempted to get my element in the proxy-session it throws this error.

For:

document.getElementById('map-1');

I get:

Error: Object reference chain is too long
    at protocolError (C:\Users\cpatton\AppData\Roaming\npm\node_modules\bleak-detector\node_modules\chrome-debugging-client\dist\lib\create-debugging-protocol-client.js:122:17)
    at DebuggingProtocol.<anonymous> (C:\Users\cpatton\AppData\Roaming\npm\node_modules\bleak-detector\node_modules\chrome-debugging-client\dist\lib\create-debugging-protocol-client.js:89:23)
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\cpatton\AppData\Roaming\npm\node_modules\bleak-detector\node_modules\chrome-debugging-client\dist\lib\create-debugging-protocol-client.js:4:58)
    at <anonymous>

What was interesting to me about this is I have no problem executing the getElementById in the chrome devtools console in the window that bleak opens up.

I know this isn't necessarily an issue with the BLeak module but any thoughts?

buddyp450 commented 5 years ago

So to update my original issue, I'm not sure that this is actually the cause of me not being able to run BLeak... (will update title when appropriate)

I added an extra line to the async _run in the CheckOperation to where my loop now looks like this:

while (!this._cancelled) {
  const success = await opSt.chromeDriver.runCode(`typeof(BLeakConfig) !== "undefined" && BLeakConfig.${this._stepType}[${this._id}].check()`);

  // extra debug line to determine if BLeakConfig is ever injected <?>
  const extraDebug = await opSt.chromeDriver.runCode(`typeof(BLeakConfig) !== "undefined"`);

    if (success) {
      // the success condition is never reached because BLeakConfig never exists on the page
      console.log('successfully ran code');
        return;
    }

    console.log('was not successful, waitin 100ms..');
    console.log('extra debug was:', JSON.stringify(extraDebug)); // always false

    await util_1.wait(100);
}

So my new understanding is that BLeakConfig is actually never globally being injected into the page? Is that correct? Curious as to why this would happen. I'll be digging more into the BLeak source today and hopefully will come up with an answer but if anyone has any ideas as to why this would be happening they would be much appreciated!

jvilk commented 5 years ago

The proxy should be injecting BleakConfig in a Githubissues.

  • Githubissues is a development platform for aggregating issues.