{"html_url": "https://github.com/simonw/datasette/issues/1219#issuecomment-775442039", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1219", "id": 775442039, "node_id": "MDEyOklzc3VlQ29tbWVudDc3NTQ0MjAzOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-08T20:39:52Z", "updated_at": "2021-02-08T22:13:00Z", "author_association": "OWNER", "body": "This comment helped me find a pattern for running Scalene against the Datasette test suite: https://github.com/emeryberger/scalene/issues/70#issuecomment-755245858\r\n\r\n```\r\npip install scalene\r\n```\r\nThen I created a file called `run_tests.py` with the following contents:\r\n```python\r\nif __name__ == \"__main__\":\r\n import sys, pytest\r\n pytest.main(sys.argv)\r\n```\r\nThen I ran this:\r\n```\r\nscalene --profile-all run_tests.py -sv -x .\r\n```\r\nBut... it quit with a segmentation fault!\r\n```\r\n(datasette) datasette % scalene --profile-all run_tests.py -sv -x .\r\n======================================================================== test session starts ========================================================================\r\nplatform darwin -- Python 3.8.6, pytest-6.0.1, py-1.9.0, pluggy-0.13.1 -- python\r\ncachedir: .pytest_cache\r\nrootdir: /Users/simon/Dropbox/Development/datasette, configfile: pytest.ini\r\nplugins: asyncio-0.14.0, timeout-1.4.2\r\ncollecting ... Fatal Python error: Segmentation fault\r\n\r\nCurrent thread 0x0000000110c1edc0 (most recent call first):\r\n File \"/Users/simon/Dropbox/Development/datasette/datasette/utils/__init__.py\", line 553 in detect_json1\r\n File \"/Users/simon/Dropbox/Development/datasette/datasette/filters.py\", line 168 in Filters\r\n File \"/Users/simon/Dropbox/Development/datasette/datasette/filters.py\", line 94 in \r\n File \"\", line 219 in _call_with_frames_removed\r\n File \"\", line 783 in exec_module\r\n File \"\", line 671 in _load_unlocked\r\n File \"\", line 975 in _find_and_load_unlocked\r\n File \"\", line 991 in _find_and_load\r\n File \"/Users/simon/Dropbox/Development/datasette/datasette/views/table.py\", line 27 in \r\n File \"\", line 219 in _call_with_frames_removed\r\n File \"\", line 783 in exec_module\r\n File \"\", line 671 in _load_unlocked\r\n File \"\", line 975 in _find_and_load_unlocked\r\n File \"\", line 991 in _find_and_load\r\n File \"/Users/simon/Dropbox/Development/datasette/datasette/app.py\", line 42 in \r\n File \"\", line 219 in _call_with_frames_removed\r\n File \"\", line 783 in exec_module\r\n File \"\", line 671 in _load_unlocked\r\n File \"\", line 975 in _find_and_load_unlocked\r\n File \"\", line 991 in _find_and_load\r\n File \"/Users/simon/Dropbox/Development/datasette/tests/test_api.py\", line 1 in \r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/assertion/rewrite.py\", line 170 in exec_module\r\n File \"\", line 671 in _load_unlocked\r\n File \"\", line 975 in _find_and_load_unlocked\r\n File \"\", line 991 in _find_and_load\r\n File \"\", line 1014 in _gcd_import\r\n File \"/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py\", line 127 in import_module\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/pathlib.py\", line 520 in import_path\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/python.py\", line 552 in _importtestmodule\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/python.py\", line 484 in _getobj\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/python.py\", line 288 in obj\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/python.py\", line 500 in _inject_setup_module_fixture\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/python.py\", line 487 in collect\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/runner.py\", line 324 in \r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/runner.py\", line 294 in from_call\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/runner.py\", line 324 in pytest_make_collect_report\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/callers.py\", line 187 in _multicall\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/manager.py\", line 84 in \r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/manager.py\", line 93 in _hookexec\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/hooks.py\", line 286 in __call__\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/runner.py\", line 441 in collect_one_node\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/main.py\", line 768 in genitems\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/main.py\", line 771 in genitems\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/main.py\", line 568 in _perform_collect\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/main.py\", line 516 in perform_collect\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/main.py\", line 306 in pytest_collection\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/callers.py\", line 187 in _multicall\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/manager.py\", line 84 in \r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/manager.py\", line 93 in _hookexec\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/hooks.py\", line 286 in __call__\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/main.py\", line 295 in _main\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/main.py\", line 240 in wrap_session\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/main.py\", line 289 in pytest_cmdline_main\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/callers.py\", line 187 in _multicall\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/manager.py\", line 84 in \r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/manager.py\", line 93 in _hookexec\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/pluggy/hooks.py\", line 286 in __call__\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/_pytest/config/__init__.py\", line 157 in main\r\n File \"run_tests.py\", line 3 in \r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/scalene/scalene_profiler.py\", line 1525 in main\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/scalene/__main__.py\", line 7 in main\r\n File \"/Users/simon/.local/share/virtualenvs/datasette-AWNrQs95/lib/python3.8/site-packages/scalene/__main__.py\", line 14 in \r\n File \"/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py\", line 87 in _run_code\r\n File \"/usr/local/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/lib/python3.8/runpy.py\", line 194 in _run_module_as_main\r\nScalene error: received signal SIGSEGV\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 803929694, "label": "Try profiling Datasette using scalene"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1219#issuecomment-775497449", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1219", "id": 775497449, "node_id": "MDEyOklzc3VlQ29tbWVudDc3NTQ5NzQ0OQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-02-08T22:11:34Z", "updated_at": "2021-02-08T22:11:34Z", "author_association": "OWNER", "body": "https://github.com/emeryberger/scalene/issues/110 reports a \"received signal SIGSEGV\" error that was fixed by upgrading to the latest Scalene version, but I'm running that already.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 803929694, "label": "Try profiling Datasette using scalene"}, "performed_via_github_app": null}