Skip to content

Crash #10

@paulrobello

Description

@paulrobello

MacOs latest Macbook Pro m4 max with 128GB memory
Python 3.12
running cloctui -f . in a large project
Crashes with stack trace


╭───────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────────────────╮
│ /Users/probello/.local/share/uv/tools/cloctui/lib/python3.12/site-packages/textual/worker.py:370 in _run                                                                            │
│                                                                                                                                                                                     │
│   367 │   │   │   self.state = WorkerState.RUNNING                                                                                                                                  │
│   368 │   │   │   app.log.worker(self)                                                                                                                                              │
│   369 │   │   │   try:                                                                                                                                                              │
│ ❱ 370 │   │   │   │   self._result = await self.run()                                                                                                                               │
│   371 │   │   │   except asyncio.CancelledError as error:                                                                                                                           │
│   372 │   │   │   │   self.state = WorkerState.CANCELLED                                                                                                                            │
│   373 │   │   │   │   self._error = error                                                                                                                                           │
│                                                                                                                                                                                     │
│ ╭────────────────────────────────────────────────────────── locals ───────────────────────────────────────────────────────────╮                                                     │
│ │           app = ClocTUI(title='ClocTUI', classes={'-dark-mode'}, pseudo_classes={'blur', 'dark'})                           │                                                     │
│ │         error = JSONDecodeError('Extra data: line 153365 column 1 (char 4848417)')                                          │                                                     │
│ │          self = <Worker ERROR name='execute_cloc' description='Executing CLOC command'>                                     │                                                     │
│ │ worker_failed = WorkerFailed("Worker raised exception: JSONDecodeError('Extra data: line 153365 column 1 (char 4848417)')") │                                                     │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                     │
│                                                                                                                                                                                     │
│ /Users/probello/.local/share/uv/tools/cloctui/lib/python3.12/site-packages/textual/worker.py:354 in run                                                                             │
│                                                                                                                                                                                     │
│   351 │   │   Returns:                                                                         ╭──────────────────────────────────── locals ────────────────────────────────────╮   │
│   352 │   │   │   Return value of the work.                                                    │ self = <Worker ERROR name='execute_cloc' description='Executing CLOC command'> │   │
│   353 │   │   """                                                                              ╰────────────────────────────────────────────────────────────────────────────────╯   │
│ ❱ 354 │   │   return await (                                                                                                                                                        │
│   355 │   │   │   self._run_threaded() if self._thread_worker else self._run_async()                                                                                                │
│   356 │   │   )                                                                                                                                                                     │
│   357                                                                                                                                                                               │
│                                                                                                                                                                                     │
│ /Users/probello/.local/share/uv/tools/cloctui/lib/python3.12/site-packages/textual/worker.py:326 in _run_threaded                                                                   │
│                                                                                                                                                                                     │
│   323 │   │                                                                                    ╭──────────────────────────────────── locals ────────────────────────────────────╮   │
│   324 │   │   loop = asyncio.get_running_loop()                                                │ loop = <_UnixSelectorEventLoop running=True closed=False debug=False>          │   │
│   325 │   │   assert loop is not None                                                          │ self = <Worker ERROR name='execute_cloc' description='Executing CLOC command'> │   │
│ ❱ 326 │   │   return await loop.run_in_executor(None, runner, self._work)                      ╰────────────────────────────────────────────────────────────────────────────────╯   │
│   327 │                                                                                                                                                                             │
│   328 │   async def _run_async(self) -> ResultType:                                                                                                                                 │
│   329 │   │   """Run an async worker.                                                                                                                                               │
│                                                                                                                                                                                     │
│ /opt/homebrew/Cellar/[email protected]/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/concurrent/futures/thread.py:59 in run                                            │
│                                                                                                                                                                                     │
│    56 │   │   │   return                                                                       ╭── locals ───╮                                                                      │
│    57 │   │                                                                                    │ self = None │                                                                      │
│    58 │   │   try:                                                                             ╰─────────────╯                                                                      │
│ ❱  59 │   │   │   result = self.fn(*self.args, **self.kwargs)                                                                                                                       │
│    60 │   │   except BaseException as exc:                                                                                                                                          │
│    61 │   │   │   self.future.set_exception(exc)                                                                                                                                    │
│    62 │   │   │   # Break a reference cycle with the exception 'exc'                                                                                                                │
│                                                                                                                                                                                     │
│ /Users/probello/.local/share/uv/tools/cloctui/lib/python3.12/site-packages/textual/worker.py:309 in run_callable                                                                    │
│                                                                                                                                                                                     │
│   306 │   │   def run_callable(work: Callable[[], ResultType]) -> ResultType:                                                                                                       │
│   307 │   │   │   """Set the active worker, and call the callable."""                                                                                                               │
│   308 │   │   │   active_worker.set(self)                                                                                                                                           │
│ ❱ 309 │   │   │   return work()                                                                                                                                                     │
│   310 │   │                                                                                                                                                                         │
│   311 │   │   if (                                                                                                                                                                  │
│   312 │   │   │   inspect.iscoroutinefunction(self._work)                                                                                                                           │
│                                                                                                                                                                                     │
│ ╭────────────────────────────────────────────────────────────────────────── locals ───────────────────────────────────────────────────────────────────────────╮                     │
│ │ self = <Worker ERROR name='execute_cloc' description='Executing CLOC command'>                                                                              │                     │
│ │ work = functools.partial(<function ClocTUI.execute_cloc at 0x113ac7420>, ClocTUI(title='ClocTUI', classes={'-dark-mode'}, pseudo_classes={'blur', 'dark'})) │                     │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                     │
│                                                                                                                                                                                     │
│ /Users/probello/.local/share/uv/tools/cloctui/lib/python3.12/site-packages/cloctui/main.py:680 in execute_cloc                                                                      │
│                                                                                                                                                                                     │
│   677 │   │   except CLOCException as e:                                                                                                                                            │
│   678 │   │   │   raise e                                                                                                                                                           │
│   679 │   │                                                                                                                                                                         │
│ ❱ 680 │   │   result: ClocJsonResult = json.loads(output)                                                                                                                           │
│   681 │   │                                                                                                                                                                         │
│   682 │   │   # The header and summary data will come out ready to use and don't                                                                                                    │
│   683 │   │   # require further processing.                                                                                                                                         │
│                                                                                                                                                                                     │
│ ╭─────────────────────────────────────────────── locals ────────────────────────────────────────────────╮                                                                           │
│ │   cloc = <cloctui.main.CLOC object at 0x107fc08f0>                                                    │                                                                           │
│ │ output = '{"header" : {\n  "cloc_url"           : "github.com/AlDanial/cloc",\n  "cloc_versi'+4848555 │                                                                           │
│ │   self = ClocTUI(title='ClocTUI', classes={'-dark-mode'}, pseudo_classes={'blur', 'dark'})            │                                                                           │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                           │
│                                                                                                                                                                                     │
│ /opt/homebrew/Cellar/[email protected]/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/__init__.py:346 in loads                                                     │
│                                                                                                                                                                                     │
│   343 │   if (cls is None and object_hook is None and                                                                                                                               │
│   344 │   │   │   parse_int is None and parse_float is None and                                                                                                                     │
│   345 │   │   │   parse_constant is None and object_pairs_hook is None and not kw):                                                                                                 │
│ ❱ 346 │   │   return _default_decoder.decode(s)                                                                                                                                     │
│   347 │   if cls is None:                                                                                                                                                           │
│   348 │   │   cls = JSONDecoder                                                                                                                                                     │
│   349 │   if object_hook is not None:                                                                                                                                               │
│                                                                                                                                                                                     │
│ ╭───────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────╮                                                                │
│ │               cls = None                                                                                         │                                                                │
│ │                kw = {}                                                                                           │                                                                │
│ │       object_hook = None                                                                                         │                                                                │
│ │ object_pairs_hook = None                                                                                         │                                                                │
│ │    parse_constant = None                                                                                         │                                                                │
│ │       parse_float = None                                                                                         │                                                                │
│ │         parse_int = None                                                                                         │                                                                │
│ │                 s = '{"header" : {\n  "cloc_url"           : "github.com/AlDanial/cloc",\n  "cloc_versi'+4848555 │                                                                │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                │
│                                                                                                                                                                                     │
│ /opt/homebrew/Cellar/[email protected]/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/json/decoder.py:341 in decode                                                     │
│                                                                                                                                                                                     │
│   338 │   │   obj, end = self.raw_decode(s, idx=_w(s, 0).end())                                                                                                                     │
│   339 │   │   end = _w(s, end).end()                                                                                                                                                │
│   340 │   │   if end != len(s):                                                                                                                                                     │
│ ❱ 341 │   │   │   raise JSONDecodeError("Extra data", s, end)                                                                                                                       │
│   342 │   │   return obj                                                                                                                                                            │
│   343 │                                                                                                                                                                             │
│   344 │   def raw_decode(self, s, idx=0):                                                                                                                                           │
│                                                                                                                                                                                     │
│ ╭───────────────────────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────────────────────╮                │
│ │   _w = <built-in method match of re.Pattern object at 0x1050235e0>                                                                                               │                │
│ │  end = 4848417                                                                                                                                                   │                │
│ │  obj = {                                                                                                                                                         │                │
│ │        │   'header': {                                                                                                                                           │                │
│ │        │   │   'cloc_url': 'github.com/AlDanial/cloc',                                                                                                           │                │
│ │        │   │   'cloc_version': '2.06',                                                                                                                           │                │
│ │        │   │   'elapsed_seconds': 49.1201660633087,                                                                                                              │                │
│ │        │   │   'n_files': 30670,                                                                                                                                 │                │
│ │        │   │   'n_lines': 3358453,                                                                                                                               │                │
│ │        │   │   'files_per_second': 624.387139906466,                                                                                                             │                │
│ │        │   │   'lines_per_second': 68372.183344646                                                                                                               │                │
│ │        │   },                                                                                                                                                    │                │
│ │        │   './.venv/lib/python3.12/site-packages/faker/decode/codes.py': {'blank': 0, 'comment': 0, 'code': 65538, 'language': 'Python'},                        │                │
│ │        │   './.venv/lib/python3.12/site-packages/litellm/llms/huggingface/huggingface_llms_m'+37: {                                                              │                │
│ │        │   │   'blank': 0,                                                                                                                                       │                │
│ │        │   │   'comment': 0,                                                                                                                                     │                │
│ │        │   │   'code': 37632,                                                                                                                                    │                │
│ │        │   │   'language': 'Text'                                                                                                                                │                │
│ │        │   },                                                                                                                                                    │                │
│ │        │   './.venv/lib/python3.12/site-packages/pymdownx/twemoji_db.py': {'blank': 1, 'comment': 3, 'code': 21593, 'language': 'Python'},                       │                │
│ │        │   './.venv/lib/python3.12/site-packages/litellm/model_prices_and_context_window_bac'+8: {'blank': 1, 'comment': 0, 'code': 18356, 'language': 'JSON'},  │                │
│ │        │   './.venv/lib/python3.12/site-packages/faker/providers/address/it_IT/__init__.py': {'blank': 14, 'comment': 19, 'code': 17626, 'language': 'Python'},  │                │
│ │        │   './.venv/lib/python3.12/site-packages/pymdownx/emoji1_db.py': {'blank': 3, 'comment': 5, 'code': 9930, 'language': 'Python'},                         │                │
│ │        │   './.venv/lib/python3.12/site-packages/pymdownx/gemoji_db.py': {'blank': 5, 'comment': 22, 'code': 9838, 'language': 'Python'},                        │                │
│ │        │   './coverage.xml': {'blank': 0, 'comment': 2, 'code': 9420, 'language': 'XML'},                                                                        │                │
│ │        │   './.venv/lib/python3.12/site-packages/idna/uts46data.py': {'blank': 170, 'comment': 3, 'code': 8508, 'language': 'Python'},                           │                │
│ │        │   ... +30662                                                                                                                                            │                │
│ │        }                                                                                                                                                         │                │
│ │    s = '{"header" : {\n  "cloc_url"           : "github.com/AlDanial/cloc",\n  "cloc_versi'+4848555                                                              │                │
│ │ self = <json.decoder.JSONDecoder object at 0x10508bf20>                                                                                                          │                │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
JSONDecodeError: Extra data: line 153365 column 1 (char 4848417)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions