PythonMonkey icon indicating copy to clipboard operation
PythonMonkey copied to clipboard

free(): invalid pointer after using dcp-client

Open YarnSaw opened this issue 10 months ago • 4 comments

Issue type

Bug

How did you install PythonMonkey?

Source

OS platform and distribution

Linux Ubuntu 20.04

Python version (python --version)

3.11.8

PythonMonkey version (pip show pythonmonkey)

0.3.1.dev394+ce80823

Bug Description

No response

Standalone code to reproduce the issue

No response

Relevant log output or backtrace

$ python job-launch.py
ready state change: exec
ready state change: init
ready state change: preauth
ready state change: deploying
ready state change: listeners
ready state change: compute-groups
ready state change: uploading
ready state change: deployed
job accepted, id 0xf6f1acE2A176A3c7c8a3753aD0AC53a2E0f3B0ef
got result for slice number 1.0
got result for slice number 2.0
got result for slice number 3.0
job 0xf6f1acE2A176A3c7c8a3753aD0AC53a2E0f3B0ef finished
results: [9.0, 12.0, 15.0]
[ 9, 12, 15 ]
^CTask was destroyed but it is pending!
task: <Task pending name='Task-450' coro=<request() running at /home/yarn/git/PythonMonkey/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py:76> cb=[tuple.futureOnDoneCallback()]>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/yarn/git/python-launch-job/node_modules/dcp-client/index.py", line 109, in load_dcp_client
    await pm.wait()
  File "/usr/lib/python3.11/asyncio/locks.py", line 213, in wait
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/yarn/git/python-launch-job/job-launch.py", line 28, in <module>
    dcp_client['init'](run_job)
  File "/home/yarn/git/python-launch-job/node_modules/dcp-client/index.py", line 113, in init
    asyncio.run(load_dcp_client(*args, **kwargs))
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 123, in run
    raise KeyboardInterrupt()
KeyboardInterrupt
Exception ignored in: <coroutine object request at 0x7fde0e4bb2a0>
Traceback (most recent call last):
  File "/home/yarn/git/PythonMonkey/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py", line 76, in request
    async with aiohttp.request(method=method,
RuntimeError: coroutine ignored GeneratorExit
Task was destroyed but it is pending!
task: <Task pending name='Task-447' coro=<request() done, defined at /home/yarn/git/PythonMonkey/python/pythonmonkey/builtin_modules/XMLHttpRequest-internal.py:27> wait_for=<Future pending cb=[BaseSelectorEventLoop._sock_write_done(6, handle=<Handle BaseS....5.147', 80))>)(), Task.task_wakeup()]> cb=[tuple.futureOnDoneCallback()]>
free(): invalid pointer
Aborted (core dumped)

Additional info if applicable

Occurs sporadically when running the job-launch script. I don't have a consistent way to reproduce the error.

What branch of PythonMonkey were you developing on? (If applicable)

No response

YarnSaw avatar Apr 11 '24 17:04 YarnSaw

@YarnSaw Can you repro to see if it has been fixed by https://github.com/Distributive-Network/PythonMonkey/pull/323?

Xmader avatar May 08 '24 18:05 Xmader

@Xmader I'm not sure he could repro even before your fix :-)

philippedistributive avatar May 08 '24 18:05 philippedistributive

Yeah, I never had a consistent repro for this. It happened probably 1 in 15 runs of deploying a job.

YarnSaw avatar May 08 '24 19:05 YarnSaw

and that was a month ago or so, no repro in 100s of runs since then

philippedistributive avatar May 08 '24 19:05 philippedistributive

I think we are good to close this issue.

Xmader avatar May 16 '24 02:05 Xmader