Skip to content

gh-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code paths - #99461

Merged
gvanrossum merged 1 commit into
python:mainfrom
hoodmane:ceval-emscripten-trampolines
Nov 15, 2022
Merged

gvanrossum merged 1 commit into
python:mainfrom
hoodmane:ceval-emscripten-trampolines

Conversation

@hoodmane

@hoodmane hoodmane commented Nov 14, 2022 •

Copy link
Copy Markdown
Contributor

@tiran

Would appreciate a backport to 3.11.X. This code has been moved from ceval.c to bytecodes.c since the 3.11.X branch so it doesn't backport cleanly, but I have another patch available for 3.11. If someone tells me how I can make a separate backport PR.

@sobolevn

sobolevn commented Nov 14, 2022 •

Copy link
Copy Markdown
Member

@hoodmane you can always do manual backports using https://pypi.org/project/cherry_picker/ :)

P.S. looks like you need to run make regen-cases to fix the CI.

@gvanrossum

Copy link
Copy Markdown
Member

The backport can be done manually, just start the PR subject with [3.11] (the rest should be the same).

And yes, please re-run regen-cases and commit Python/generated_cases.c.h.

@hoodmane
hoodmane force-pushed the ceval-emscripten-trampolines branch from 2d1cf73 to 844b63e Compare November 14, 2022 21:30
@hoodmane

Copy link
Copy Markdown
Contributor Author

Okay updated generated_cases as requested. Thanks.

@hoodmane hoodmane mentioned this pull request Nov 15, 2022
13 of 15 tasks
@bedevere-bot

Copy link
Copy Markdown

GH-99514 is a backport of this pull request to the 3.11 branch.

@hoodmane

Copy link
Copy Markdown
Contributor Author

Thanks!

@hoodmane
hoodmane deleted the ceval-emscripten-trampolines branch November 15, 2022 18:18
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot wasm32-emscripten node (pthreads) 3.x has failed when building commit 86a49e0.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/1050/builds/845) and take a look at the build logs.
  4. Check if the failure is related to this commit (86a49e0) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/1050/builds/845

Failed tests:

  • test___all__

Failed subtests:

  • test_all - test.test___all__.AllTest.test_all

Summary of the results of the build (if available):

== Tests result: FAILURE ==

338 tests OK.

10 slowest tests:

  • test_tokenize: 1 min 3 sec
  • test_unparse: 51.4 sec
  • test_io: 46.1 sec
  • test_lib2to3: 43.2 sec
  • test_capi: 37.0 sec
  • test_unicodedata: 26.9 sec
  • test_zipfile: 24.0 sec
  • test_decimal: 19.4 sec
  • test_pathlib: 17.1 sec
  • test_statistics: 16.5 sec

1 test failed:
test___all__

94 tests skipped:
test__xxsubinterpreters test_asyncgen test_asyncio
test_check_c_globals test_clinic test_cmd_line
test_concurrent_futures test_contextlib_async test_ctypes
test_curses test_dbm_gnu test_dbm_ndbm test_devpoll test_doctest
test_docxmlrpc test_dtrace test_embed test_epoll test_faulthandler
test_fcntl test_file_eintr test_fork1 test_ftplib test_gdb
test_grp test_httplib test_httpservers test_idle test_imaplib
test_interpreters test_ioctl test_kqueue test_launcher test_lzma
test_mmap test_msilib test_multiprocessing_fork
test_multiprocessing_forkserver test_multiprocessing_main_handling
test_multiprocessing_spawn test_nis test_openpty test_ossaudiodev
test_pdb test_peg_generator test_perf_profiler test_poll
test_poplib test_pty test_pwd test_readline test_regrtest
test_repl test_resource test_select test_selectors test_smtplib
test_smtpnet test_socket test_socketserver test_spwd test_ssl
test_stable_abi_ctypes test_startfile test_subprocess
test_sys_settrace test_syslog test_tcl test_telnetlib test_tix
test_tkinter test_tools test_ttk test_ttk_textonly test_turtle
test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet
test_venv test_wait3 test_wait4 test_webbrowser test_winconsoleio
test_winreg test_winsound test_wmi test_wsgiref test_xmlrpc
test_xmlrpc_net test_xxlimited test_zipfile64
test_zipimport_support test_zoneinfo
0:21:14 load avg: 8.20
0:21:14 load avg: 8.20 Re-running failed tests is not supported with --python host runner option.

Total duration: 21 min 14 sec

Click to see traceback logs
Traceback (most recent call last):
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/test/test___all__.py", line 129, in test_all
    self.check_all(modname)
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/test/test___all__.py", line 43, in check_all
    with warnings_helper.check_warnings(
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/test/support/warnings_helper.py", line 185, in _filterwarnings
    raise AssertionError("unhandled warning %s" % reraise[0])
AssertionError: unhandled warning {message : SyntaxWarning("invalid escape sequence '\\('"), category : 'SyntaxWarning', filename : '/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-pthreads/build/Lib/test/test_enum.py', lineno : 1481, line : None}
@gvanrossum

Copy link
Copy Markdown
Member

@hoodmane Do you understand the buildbot failure? It seems related to this PR.

@hoodmane

Copy link
Copy Markdown
Contributor Author

It looks unrelated to me? It's hard for me to tell but it doesn't look like the -DPY_CALL_TRAMPOLINE compile flag was passed so the trampolines shouldn't be active and hence this change should look like a no-op to that build:

checking LDSHARED... $(CC) -shared
checking BLDSHARED flags... $(CC) -shared
checking CCSHARED... -fPIC
checking LINKFORSHARED... -Xlinker -export-dynamic
checking CFLAGSFORSHARED... 

I think if the trampolines were enabled we would see -DPY_CALL_TRAMPOLINE in one of these places. Is there a place I can see exactly the build bot did?

@sobolevn

Copy link
Copy Markdown
Member

I've created #99519 to fix it.

@hoodmane

Copy link
Copy Markdown
Contributor Author

Thanks @sobolevn! (I'm glad I didn't have to figure out what was going on...)

CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request Nov 16, 2022
* main: (8272 commits)
  Update Windows readme.txt to clarify Visual Studio required versions (pythonGH-99522)
  pythongh-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code paths (python#99461)
  pythongh-92647: [Enum] use final status to determine lookup or create (pythonGH-99500)
  pythongh-81057: Move Globals in Core Code to _PyRuntimeState (pythongh-99496)
  Post 3.12.0a2
  pythongh-99300: Use Py_NewRef() in Python/Python-ast.c (python#99499)
  pythongh-93649: Split pytime and datetime tests from _testcapimodule.c (python#99494)
  pythongh-99370: fix test_zippath_from_non_installed_posix (pythonGH-99483)
  pythonGH-99205: remove `_static` field from `PyThreadState` and `PyInterpreterState` (pythonGH-99385)
  pythongh-81057: Move the Remaining Import State Globals to _PyRuntimeState (pythongh-99488)
  pythongh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (pythonGH-99373)
  pythongh-93649: Split getargs tests from _testcapimodule.c (python#99346)
  pythongh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (pythongh-99487)
  pythonGH-98219: reduce sleep time in `asyncio` subprocess test (python#99464)
  pythonGH-99388: add `loop_factory` parameter to `asyncio.run` (python#99462)
  pythongh-99300: Use Py_NewRef() in PC/ directory (python#99479)
  pythongh-99300: Use Py_NewRef() in Doc/ directory  (python#99480)
  pythongh-99300: Use Py_NewRef() in Modules/ directory (python#99473)
  pythongh-99300: Use Py_NewRef() in Modules/ directory (python#99469)
  pythongh-99370: Calculate zip path from prefix when in a venv (pythonGH-99371)
  ...
@bedevere-bot

Copy link
Copy Markdown

GH-99514 is a backport of this pull request to the 3.11 branch.

gvanrossum pushed a commit that referenced this pull request Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants