Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help: No stack traces recorded! #34

Open
hcg2008 opened this issue Sep 9, 2018 · 2 comments
Open

Help: No stack traces recorded! #34

hcg2008 opened this issue Sep 9, 2018 · 2 comments
Labels

Comments

@hcg2008
Copy link

hcg2008 commented Sep 9, 2018

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]
@jvilk jvilk added the bug label Sep 9, 2018
@jvilk
Copy link
Member

jvilk commented Sep 9, 2018

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.

@hcg2008
Copy link
Author

hcg2008 commented Sep 10, 2018

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants