question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`walk` introduced in 1.5.2 leads to memory leak + crash

See original GitHub issue

Versions + Platform

  • [ >= 1.5.2] SDK version - @sentry/electron@v?.?.?
  • [ witnessed on 9 and 10 ] Electron version - electron@v?.?.?
  • [ mac ] Platform - Windows/macOS/Linux

Description

Unfortunately I don’t have a reproducible demo to show for this, but it appears the introduction of the walk function in 1.5.2 causes my application to endlessly spin when that function is hit for a very certain input (I can’t pinpoint it, but it is fully replicable). When this occurs, my entire application would freeze and be unclickable, and eventually it would leak enough memory to crash. walk was seemingly introduced to break circular references, but I think in my case it has caused one that does not occur in 1.5.1.

While I don’t have a demo, I can get a maintainer or anyone interested in fixing this set up with my app so they can encounter the issue directly.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:27 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
alderzhangcommented, Dec 9, 2021

Thanks for the reports.

Add a logpoint at walk function head

Logging inside walk will cause breadcrumbs and scope updates to be generated which will in turn call walk.

The only time I’ve been able to trigger this was when we accidentally logged a huge object tree to the console

@timfish Thanks! You are right, make beforeBreadcrumb always return null solved my problem.

Sentry.init({
  dsn: 'xxx',
  beforeBreadcrumb = (breadcrumb, hint) => null,
});

It seems that the problem is caused by the following log printing (just some exception stack, It doesn’t seems to have any huge objects). localhost-1639020358884.log

1reaction
alderzhangcommented, Dec 8, 2021

Still exists in 2.5.4, unfortunately I don’t have a reproducible demo to show for this, but i can show you the stack.

image image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Weird memory leak-like issue : r/feedthebeast - Reddit
Nothing abnormal appears in any of the console logs at any point in time, and no crash report is generated if I just...
Read more >
Fixed - This is getting beyond annoying! Fix your PC Client devs ...
Whatever the cause, it appears to be a memory leak. I avoid House of Legends, and the crashes are less frequent. I am...
Read more >
Understanding Memory Leaks in Java - Baeldung
In layman's terms, we can think of a memory leak as a disease that degrades our application's performance by blocking vital memory resources....
Read more >
How to troubleshoot memory problems in Python
Memory leaks occur when a program asks the kernel to set aside a chunk of memory to use, but then due to a...
Read more >
How to spot and fix memory leak, retain cycle and ... - YouTube
In this video, we learn about the common areas where leaks happen- closures- delegates- notification centers- disposeBag/anyCancellables in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found