facebookincubator / cinder

Cinder is Meta's internal performance-oriented production version of CPython.
https://trycinder.com
Other
3.42k stars 122 forks source link

could not find symtab #131

Closed web3creator closed 5 months ago

web3creator commented 6 months ago

JIT: /cinder/src/CinderX/Jit/symbolizer.cpp:55 -- could not find symtab

:241: RuntimeWarning: weakref.ref size changed, may indicate binary incompatibility. Expected 56 from C header, got 64 from PyObject :241: RuntimeWarning: weakref.ref size changed, may indicate binary incompatibility. Expected 56 from C header, got 64 from PyObject Traceback (most recent call last): File "/cinder/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/cinder/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/cinder/lib/python3.10/compiler/__main__.py", line 117, in exec(codeobj, d, d) File "runweb.py", line 18, in __main__ from app.server import flask_app File "", line 1038, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "/cinder/lib/python3.10/compiler/strict/loader.py", line 393, in exec_module exec(code, module.__dict__) File "/opt/querybook/server/app/server.py", line 2, in from flask import send_file, abort File "", line 1038, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "/cinder/lib/python3.10/compiler/strict/loader.py", line 393, in exec_module exec(code, module.__dict__) File "/cinder/lib/python3.10/site-packages/flask/__init__.py", line 6, in from .app import Flask as Flask File "", line 1038, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "/cinder/lib/python3.10/compiler/strict/loader.py", line 393, in exec_module exec(code, module.__dict__) File "/cinder/lib/python3.10/site-packages/flask/app.py", line 43, in from .sansio.app import App File "", line 1038, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "/cinder/lib/python3.10/compiler/strict/loader.py", line 393, in exec_module exec(code, module.__dict__) File "/cinder/lib/python3.10/site-packages/flask/sansio/app.py", line 28, in from ..logging import create_logger File "", line 1038, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "/cinder/lib/python3.10/compiler/strict/loader.py", line 393, in exec_module exec(code, module.__dict__) File "/cinder/lib/python3.10/site-packages/flask/logging.py", line 49, in default_handler = logging.StreamHandler(wsgi_errors_stream) # type: ignore File "/cinder/lib/python3.10/logging/__init__.py", line 1072, in __init__ Handler.__init__(self) File "/cinder/lib/python3.10/logging/__init__.py", line 883, in __init__ _addHandlerRef(self) File "/cinder/lib/python3.10/logging/__init__.py", line 861, in _addHandlerRef _releaseLock() File "/cinder/lib/python3.10/logging/__init__.py", line 233, in _releaseLock _lock.release() File "/cinder/lib/python3.10/threading.py", line 197, in release self._block.release() TypeError: release() takes no arguments (1152921504606846976 given) Exception ignored in: Traceback (most recent call last): File "/cinder/lib/python3.10/site-packages/gevent/monkey.py", line 846, in _shutdown main_thread._tstate_lock.release() TypeError: release() takes no arguments (1152921504606846976 given) Exception ignored in atexit callback: Traceback (most recent call last): File "/cinder/lib/python3.10/logging/__init__.py", line 2191, in shutdown h.release() File "/cinder/lib/python3.10/logging/__init__.py", line 923, in release if self.lock: AttributeError: 'StreamHandler' object has no attribute 'lock' Exception ignored in: Traceback (most recent call last): File "/cinder/lib/python3.10/logging/__init__.py", line 846, in _removeHandlerRef acquire() File "/cinder/lib/python3.10/logging/__init__.py", line 226, in _acquireLock _lock.acquire() File "/cinder/lib/python3.10/threading.py", line 168, in acquire rc = self._block.acquire(blocking, timeout) File "/cinder/lib/python3.10/site-packages/gevent/thread.py", line 112, in acquire acquired = BoundedSemaphore.acquire(self, blocking, timeout) File "src/gevent/_semaphore.py", line 180, in gevent._gevent_c_semaphore.Semaphore.acquire File "src/gevent/_semaphore.py", line 249, in gevent._gevent_c_semaphore.Semaphore.acquire File "src/gevent/_abstract_linkable.py", line 521, in gevent._gevent_c_abstract_linkable.AbstractLinkable._wait File "src/gevent/_abstract_linkable.py", line 487, in gevent._gevent_c_abstract_linkable.AbstractLinkable._wait_core File "src/gevent/_abstract_linkable.py", line 490, in gevent._gevent_c_abstract_linkable.AbstractLinkable._wait_core File "src/gevent/_abstract_linkable.py", line 442, in gevent._gevent_c_abstract_linkable.AbstractLinkable._AbstractLinkable__wait_to_be_notified File "src/gevent/_abstract_linkable.py", line 451, in gevent._gevent_c_abstract_linkable.AbstractLinkable._switch_to_hub File "src/gevent/_greenlet_primitives.py", line 61, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch File "src/gevent/_greenlet_primitives.py", line 65, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch File "src/gevent/_gevent_c_greenlet_primitives.pxd", line 35, in gevent._gevent_c_greenlet_primitives._greenlet_switch File "/cinder/lib/python3.10/site-packages/gevent/hub.py", line 647, in run loop.run() File "src/gevent/libev/corecext.pyx", line 619, in gevent.libev.corecext.loop.run TypeError: run() takes at most 2 positional arguments (1152921504606846976 given) [root@4b735394a3f0 server]#
tekknolagi commented 6 months ago

could not find symtab is harmless logging from the symbolizer. The real error message is something Cython related at the bottom where there's some place Cinder doesn't mask out the nargsf well (there's a high bit set somewhere)

web3creator commented 6 months ago

@tekknolagi Thank you very much for your answer. I just executed /cinder/bin/python3 -m compiler app.py How should I solve this problem?

DinoV commented 6 months ago

I don't think it's Cinder's responsibility to mask out the nargsf flag, but it is going to be a source of binary incompatibility as we've added extra bits that need to be masked out. But consumers of vectorcall should mask using PyVectorcall_NARGS to get the number of arguments.

One possibility is that they're doing n & ~PY_VECTORCALL_ARGUMENTS_OFFSET but I'd be surprised if that's happening. We certainly use Cython internally and it works with this.

Could the Cython code have been built against stock CPython and is being re-used on Cinder? The runtime warnings of size mismatches are certainly an indication that it could have been built against a different version. If so then the Cython code just needs to be re-built against Cinder headers in order to work properly.

DinoV commented 5 months ago

Closing for now, please re-open if it seems like this wasn't originally built against normal CPython.