-
-
Notifications
You must be signed in to change notification settings - Fork 29.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.7] Seg fault on archlinux 32 when run tests with xvfb-run #78276
Comments
building python 2.7.15 on archlinux32 from source succeeds, but running the testsuite segfaults with: test_writelines (idlelib.idle_test.test_io.PseudeOutputFilesTest) ... /usr/bin/xvfb-run: line 181: 3617 Segmentation fault (core dumped) DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1 the executed commands are: cd Python-${pkgver} # Temporary workaround for FS#22322 # Enable built-in SQLite module to load extensions (fix FS#22122) # FS#23997 sed -i "s/python2.3/python2/g" Lib/distutils/tests/test_build_scripts.py \ # Ensure that we are using the system copy of various libraries (expat, zlib and libffi), # clean up #!s # Workaround asdl_c.py/makeopcodetargets.py errors after we touched the shebangs # FS#48761 export OPT="${CFLAGS}" make LD_LIBRARY_PATH="${srcdir}/Python-${pkgver}":${LD_LIBRARY_PATH} \ |
I don't see how test_idle runs the /usr/bin/xvfb-run command. First, it would be interesting to see what is the argument of the xvfb-run command and check if it does crash alone. Can you please try to trace system calls using the following command and then attached the created trace file to this issue? strace -f -o trace ./python -m test test_idle
What are values of DISPLAY, SERVERNUM and AUTHFILE environment variables? |
Note the last line, which shows that the testsuite itself is executed using xvfb-run. The archlinux32 build script is based off the original PKGBUILD for archlinux: https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/python2 xvfb-run is only involved, because the testsuite depends on being run in a GUI environment in order to test GUI components... |
Ah, I see. Can you try to get the Python traceback and/or C traceback using gdb? |
I think we should first determine whether xvfb is required to get the segfault, and second, where it fails. Does xvfb-run <python2> -m ...? In either case, inserting prints in 'test_writelines', which has multiple asserts, should determine where it fails. Test.test_idle checks that tkinter can imported, which in turn imports _tkinter, which tries to connect to a windowing system. Running with xvfb satisfies this. Test_idle finds and run the test modules in idlelib.idle_test. Individual modules and classes somewhat redundantly import test.support and check "requires('gui')". So IDLE gui tests, and, I am fairly sure, the tkinter gui tests, also require -ugui or -uall to run. Test_io is not a gui test, so does not need or run "requires('gui')", and hence does not need -ugui. On the other hand, it imports PyShell, which imports tkinter and _tkinter, and hence would need xvfb-run on a headless server, as opposed to a workstation with screen. Erich, I assume you are running on the latter. |
I'm running this on a headless box (packaging for archlinux32). Setting up a desktop on the test box would be some effort, but should be possible in principle. In the original PKGBUILD which Eli posted, there is a comment about when the tests started failing - which suggests, the problem is connected to xvfb-run. |
ok, some update: 1st: running the complete test suite with xvfb fails (as already reported):
running w/o xvfb-run succeeds:
---------------------------------------------------------------------- OK Total duration: 150 ms running only these tests with xvfb-run _succeeds_:
---------------------------------------------------------------------- OK Total duration: 144 ms |
I got a similar error and managed to fix it by installing the noto-fonts package [1]. ttf-dejavu [2] works, too. I guess at least one font should be installed to allow those tests to run. [1] https://www.archlinux.org/packages/extra/any/noto-fonts/ |
Here is partial backtrace from commit 1d26c72: #0 0x00007ffff6763197 in GetTkFontAttributes (faPtr=faPtr@entry=0x555555cd91e8, ftFont=<optimized out>) Looks more like a Tk issue than a CPython one. For Arch Linux packagers: adding checkdepends=('ttf-font') to PKGBUILD can fix testing errors. Here's an example: archlinuxcn/repo@e4de459 |
Additional notes: I am puzzled that test_idle output starts with test_io, as that is alphabetically in the middle of the files in idle_test/. There are 2 independent 'test_io' modules: test/test_io, which tests the io module, and idlelib/test_idle/test_io, which tests idlelib.PyShell.PseudoFile and subclasses (which are all derived from io.TextIOBase). Only the latter is an issue here. The former is an irrelevant distraction and should not have been included with test_idle in msg321737. Since log.all ends with "test_writelines (idlelib.idle_test.test_io.PseudeOutputFilesTest) ... /usr/bin/xvfb-run: line 181: ...", I initially thought that test_writelines, in particular, stimulated the failure. But in the msg321737 output, test_writelines ran 'OK'. The fact that xvfv ... test_idle runs by itself but not when alphabetically preceding tests are run says that some preceding test alters something. The failure of test_audioop seems an unlikely cause. I suspect test__all__, by importing _tkinter either directly or via Tkinter or some IDLE module. This could be tested with xvfb ... test___all__ test_idle. Since the tests are mostly run alphabetically and the tkinter tests, test_tcl, test_tk, test_ttk_guionly, and test_ttk_textonly alphabetically follow test_idle, they should not be the cause of the crash during test_idle. On the other hand, if the test above crashes, and so does |
Sorry, after reading the original issue carefully, I realize that my issue is slightly different. In my case running test_idle only crashes, and it crashes before the first test in test_idle, not in test_writelines. I copied the Arch Linux packaging script mentioned by Eli [2], modified it so that test_idle, test_tk and test_ttk_guionly are not skipped, and added a dependency ttf-font. With the modified PKGBUILD, the only failing test is test_ssl. I guess the issue has been fixed. Erich Eckner, could you still reproduce the original crash? [1] https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/python2 |
Yes, I get much further in the test suite, currently (40k lines logged vs. 23k). Now, it succeeds until: 0:08:26 load avg: 0.72 [358/403/3] test_tuple |
The new crashing test seems the same as https://bugs.python.org/issue33153. I can't reproduce it on 64-bit Arch Linux, so that might be a 32-bit only issue. |
It is not clear what you did differently to get a different result. I changed the title since it seems that idlelib code is not the direct problem. |
yes, I'm also not sure what's different now - I executed the very same commands on the very same source tree :-/ |
2.7 is dead. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: