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.

DetailedList - no smooth scroll and crash after 30s - macOS

See original GitHub issue

Expected Behavior

Fluent scrolling, no jitter, no crash

Current Behavior

  1. jitter when scrolling up and down.
  2. app crashes after 30-60s of scrolling with this error:
/Users/Jonas/.local/share/virtualenvs/toga-Z1tvi9lv/bin/python -m detailedlist
Fatal Python error: deallocating None

Current thread 0x00007fffb2b9b380 (most recent call first):
  File "/Users/Jonas/Documents/Programming/PyBee/toga/src/cocoa/toga_cocoa/widgets/internal/refresh.py", line 172 in scrollWheel_
  File "/Users/Jonas/Documents/Programming/PyBee/rubicon-objc/rubicon/objc/runtime.py", line 1032 in _objc_method
  File "/Users/Jonas/Documents/Programming/PyBee/rubicon-objc/rubicon/objc/runtime.py", line 829 in __call__
  File "/Users/Jonas/Documents/Programming/PyBee/rubicon-objc/rubicon/objc/runtime.py", line 907 in __call__
  File "/Users/Jonas/Documents/Programming/PyBee/rubicon-objc/rubicon/objc/eventloop.py", line 621 in start
  File "/Users/Jonas/Documents/Programming/PyBee/rubicon-objc/rubicon/objc/eventloop.py", line 381 in run
  File "/Users/Jonas/Documents/Programming/PyBee/rubicon-objc/rubicon/objc/eventloop.py", line 425 in run_forever
  File "/Users/Jonas/Documents/Programming/PyBee/toga/src/cocoa/toga_cocoa/app.py", line 171 in main_loop
  File "/Users/Jonas/Documents/Programming/PyBee/toga/src/core/toga/app.py", line 169 in main_loop
  File "/Users/Jonas/Documents/Programming/PyBee/toga/examples/detailedlist/detailedlist/__main__.py", line 4 in <module>
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85 in _run_code
  File "/usr/local/Cellar/python3/3.6.3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193 in _run_module_as_main

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

Steps to reproduce

  1. run the detailedlist.py example
  2. scroll up and down for 30-60s.

Your Environment

  • Python Version (3.6.5)

  • Operating System and Version (select from the following and list the specific version number; if your OS is not listed, list that as well)

    • macOS - version: 10.13.5 (High Sierra)
    • Linux - distro: - version:
    • Windows - version:
    • Other - name: - version:
  • Toga Target (the type of app you are trying to generate)

    • android
    • cocoa
    • django
    • gtk
    • iOS
    • tvOS
    • watchOS
    • winforms
    • win32
    • Other (please specify)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
dgelessuscommented, May 10, 2019

Turns out that the root cause of the crash is a bug in ctypes itself, which I’ve reported now (bpo-36880). Whenever a ctypes callback with restype py_object returns None, the refcount of None is decremented once too much.

In this example, the bug is triggered a few times for each scroll operation. If this happens often enough, None’s refcount decreases to zero - this is never supposed to happen, so Python crashes.

The code that triggers the bug is in rubicon-objc here. In this case we can probably work around the bug by returning an object other than None from the callback - I’ll try to work on a patch for Rubicon soon, so that we don’t have to wait for the bug to be fixed in CPython.

0reactions
freakboy3742commented, May 25, 2019

Thanks to the awesome debugging work by @lschumm and @dgelessus, this bug has now been squashed; Rubicon 0.3.1 includes the code necessary to work around this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ScrollViewProxy scrollTo will cras… | Apple Developer Forums
ScrollViewProxy scrollTo will crash when scrolling outside of bounds of previous (not current) List data source/array in iPad and iOS 16 beta.
Read more >
6 Simple Steps to Fix Mac Apps That Crash or Freeze
We'll show you how to fix common app problems on macOS. 1. Quit or Force-Quit the App. An app might hang in the...
Read more >
Games Crashes to Desktop after a couple of minutes
Game launches fine, lets me play for around 2 minutes or so and then crashes to desktop with no warning or error log...
Read more >
How to Fix Any Macbook Pro Random System Crash - YouTube
2019 UPDATE: Tools and Parts Store now up and running at https://store.appledollars.com*2019 UPDATE: Help Support this channel buy buying ...
Read more >
V2201 keeps on crashing on MacBook - Receiver for Macintosh
Trying to run Citrix Workspace latest client v2201 on MacBook Pro M1 Max Monterey 12.1 The app loads initially and when I'm connecting...
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