BLeak icon indicating copy to clipboard operation
BLeak copied to clipboard

Help: No stack traces recorded!

Open hcg2008 opened this issue 7 years ago • 2 comments

bleak viewer

found leak!

LeakShare 8000280 x within closure of window.VUE_HOT_MAP["data-v-ed7ab756"].options.data

No stack traces recorded! This could indicate a bug in BLeak. If your application is publicly available, please file a bug report on GitHub with your configuration file so we can look into the problem.

============================ bleak run

bleak run --config bleak_config-1.js --out ./output/ --snapshot

DevTools listening on ws://127.0.0.1:51565/devtools/browser/afe893c6-bf9f-4f77-9ebb-9c9b16c15112 2018-09-09 22:03:55.098 Google Chrome[7342:184561] *** Owner supplied to -[NSTrackingArea initWithRect:options:owner:userInfo:] referenced a deallocating object. Tracking area behavior is undefined. Break on NSTrackingAreaDeallocatingOwnerError to debug. [ ] 1% [1/116] 0.0s (ETA 0.1s) Navigating to http://127.0.0.1:3000/(node:7334) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. at showFlaggedDeprecation (buffer.js:160:11) at new Buffer (buffer.js:175:3) at embedSourceMap (/Volumes/Customer/MyProject/NodeJS/BLeak/dist/node/lib/closure_state_transform.js:1955:74) at tryJSTransform (/Volumes/Customer/MyProject/NodeJS/BLeak/dist/node/lib/closure_state_transform.js:1989:16) at Object.ensureES5 (/Volumes/Customer/MyProject/NodeJS/BLeak/dist/node/lib/closure_state_transform.js:2039:12) at log.timeEvent (/Volumes/Customer/MyProject/NodeJS/BLeak/dist/node/lib/mitmproxy_interceptor.js:138:77) at ProgressProgressBar.timeEvent (/Volumes/Customer/MyProject/NodeJS/BLeak/dist/node/lib/progress_progress_bar.js:81:20) at interceptor (/Volumes/Customer/MyProject/NodeJS/BLeak/dist/node/lib/mitmproxy_interceptor.js:137:29) at log.timeEvent (/Volumes/Customer/MyProject/NodeJS/BLeak/dist/node/lib/mitmproxy_interceptor.js:147:13) at ProgressProgressBar.timeEvent (/Volumes/Customer/MyProject/NodeJS/BLeak/dist/node/lib/progress_progress_bar.js:81:20) [====================] 100% [116/116] 41.1s (ETA 0.0s) Retrieving stack traces Results can be found in ./output/

============================= bleak find-growing-paths

bleak find-growing-paths output/snapshots/leak_detection/snapshot_0.heapsnapshot.gz output/snapshots/leak_detection/snapshot_1.heapsnapshot.gz output/snapshots/leak_detection/snapshot_2.heapsnapshot.gz output/snapshots/leak_detection/snapshot_3.heapsnapshot.gz Processing output/snapshots/leak_detection/snapshot_0.heapsnapshot.gz... Processing output/snapshots/leak_detection/snapshot_1.heapsnapshot.gz... Processing output/snapshots/leak_detection/snapshot_2.heapsnapshot.gz... Processing output/snapshots/leak_detection/snapshot_3.heapsnapshot.gz... Time to run Get Growing Objects: 0.109 seconds. Found 2 growing paths.

Report

  • LeakShare: 8000280, Retained Size: 8000280, Transitive Closure Size: 8017912
    • x within closure of window.VUE_HOT_MAP["data-v-ed7ab756"].options.data
  • LeakShare: 1328, Retained Size: 1328, Transitive Closure Size: 18960
    • positionStore within closure of window.$nuxt._router.proto.constructor Exploring the heap! Current Node: [Synthetic] [..] Previous node, [h] unhide system properties, [f (string)] Filter, [q] Quit [0] 1 =[Element]=> (GC roots) [Synthetic] [Count: 22] [Non-leak-reachable? false, Leak visits: 0, NI: 1] [1] 2 =[Shortcut]=> Window / http://127.0.0.1 [Native] [Count: 1543] [Non-leak-reachable? true, Leak visits: 0, NI: 1704] [2] 3 =[Shortcut]=> Object / [Object] [Count: 124] [Non-leak-reachable? true, Leak visits: 0, NI: 1766] [3] 4 =[Element]=> Pending activities [Native] [Count: 2] [Non-leak-reachable? true, Leak visits: 0, NI: 126944]

hcg2008 avatar Sep 09 '18 14:09 hcg2008

Thanks for filing the bug. Is the application that you have run BLeak on open source or could you make it available to me somehow? I'm guessing there is a bug in BLeak's JavaScript rewriting process that misses this variable somehow.

jvilk avatar Sep 09 '18 22:09 jvilk

Thanks!

I run a example from https://github.com/sdras/sample-vue-shop.git.

===================== In the example, I created a leak by adding following code to pages/women.vue.

var x = [];

function grow() { x.push(new Array(2000000).join('x')); } and adding grow(); in computed: { wProducts() { grow(); return ..... It will leak 2M memory each loop.

  1. the config script: ============================= exports.url = "http://127.0.0.1:3000/";

exports.loop = [ // First state { check: function() { return !!document.getElementsByTagName('img'); }, // check: function() { return document.getElementsByTagName('img')[4].src == "http://127.0.0.1:3000/hat1.png"; }, next: function() { document.getElementsByTagName('li')[0].click(); } }, { check: function() { return !!document.getElementsByTagName('img'); }, // check: function() { return document.getElementsByTagName('img')[4].src == "http://127.0.0.1:3000/jacket3.png"; }, next: function() { document.getElementsByTagName('li')[1].click(); } }, { check: function() { return !!document.getElementsByTagName('img'); }, // check: function() { return document.getElementsByTagName('img')[4].src == "http://127.0.0.1:3000/sweater2.png"; }, next: function() { document.getElementsByTagName('a')[0].click(); } }, ];

// (Optional) Number of loop iterations to perform during leak detection (default: 8) exports.iterations = 4;

============== I changed the file bleak_agents.ts by replacing all xxxxx.hasOwnProperty() with Object.prototype.hasOwnProperty.call() because I got "Uncaught TypeError"

hcg2008 avatar Sep 10 '18 01:09 hcg2008