Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2781

pyside6-deploy segfault libshiboken6.abi3.so.6.7

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.8.0, 6.7.3
    • 6.7.1
    • Tooling
    • None
    • Ubuntu 24.04 LTS with kernel 6.8.0-35-generic, running Python 3.12.3 in a virtual environment (using direnv).
    • Linux/X11
    • 038203c99 (dev), bbb203f66 (6.7)

    Description

      I'm getting a segfault when running a deployed PySide binary.

      [328313.686644] delme.bin[953656]: segfault at 5c33bcba2bb6 ip 000077d3c88d080c sp 00007ffc4e6c8260 error 4 in libshiboken6.abi3.so.6.7[77d3c88ad000+2f000] likely on CPU 6 (core 12, socket 0)
      [328313.686651] Code: 24 48 e8 b7 da fd ff 48 8b 7c 24 40 48 8d 74 24 58 4c 89 ea 48 89 c3 48 c7 44 24 58 00 00 00 00 e8 89 e1 fd ff 48 8b 44 24 58 <80> 7c 18 fe 64 75 6b 80 3c 18 6c 75 65 48 8b 35 10 e1 02 00 48 8b
      

      This seems related to PYSIDE-2747, but unlike that issue, this only occurs in the deployed binary, not when running the python code directly. It also appears to be due to a race condition as it doesn't always occur.

       

      The test python script (delme.py) and pysidedeploy.spec are in the attached test.zip file. PySide and Shiboken are installed in a virtual environment from the 10-Jun-2024 snapshot from https://download.qt.io/snapshots/ci/pyside/6.7.1/latest/pyside6/ and the pysidedeploy.spec is adjusted to use Nuitka 2.3 instead of 2.1.

      brett@brett-home:/tmp/delme$ which python
      /tmp/delme/.direnv/python-3.12.3/bin/python
      
      brett@brett-home:/tmp/delme$ pip freeze
      Nuitka==2.3
      ordered-set==4.1.0
      patchelf==0.17.2.1
      PySide6 @ file:///home/brett/Downloads/PySide6-6.7.1-cp39-abi3-manylinux_2_28_x86_64.whl#sha256=6eb5ea0523db92f37a6511e7ff695d44e6f34294c3562d68386f3444414ff97f
      PySide6_Addons @ file:///home/brett/Downloads/PySide6_Addons-6.7.1-cp39-abi3-manylinux_2_28_x86_64.whl#sha256=7d18123df0e034bc721a6c7a67dd292a3a67198e9f6e7f96833848a935108c04
      PySide6_Essentials @ file:///home/brett/Downloads/PySide6_Essentials-6.7.1-cp39-abi3-manylinux_2_28_x86_64.whl#sha256=01cfd57c99f0c521d1398316a11cb3a09730102e8cd97d7a2d336d00c58029b3
      shiboken6 @ file:///home/brett/Downloads/shiboken6-6.7.1-cp39-abi3-manylinux_2_28_x86_64.whl#sha256=697fddaae1a70dca0c9985ba76253350747a0b9255e05cad609ac64a923d117d
      shiboken6_generator @ file:///home/brett/Downloads/shiboken6_generator-6.7.1-cp39-abi3-manylinux_2_28_x86_64.whl#sha256=3b94901c82baa7029e7f66ce7f2452b5a2653da57c8d88bf7c20556382e0b7c2
      zstandard==0.22.0
      

      Deployment seems successful, but running the deployed binary sometimes gives the segfault and sometimes doesn't:

      brett@brett-home:/tmp/delme$ pyside6-deploy test/delme.py 
      [DEPLOY] Executed file created in /tmp/delme/test/delme.bin                                                                                    
      brett@brett-home:/tmp/delme$ ./test/delme.bin 
      brett@brett-home:/tmp/delme$ ./test/delme.bin 
      brett@brett-home:/tmp/delme$ ./test/delme.bin 
      brett@brett-home:/tmp/delme$ ./test/delme.bin 
      Run 'gdb --ex=r /tmp/onefile_953677_1718025271_170861/delme.bin' while this is waiting for input.
      

      Each of the runs without output triggers a segfault identical to the one at the top of this issue visible in dmesg. See stacktrace.txt for the output from running the gdb command in a separate shell.

      Attachments

        1. gdb.txt
          3 kB
        2. stacktrace-1.txt
          10 kB
        3. test.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            shpremna Shyamnath Premnadh
            b.n.ryland Brett Ryland
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes