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

Crash when using QList<QSharedPointer<X> > > with wrong type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.15.2
    • 5.14.0
    • Shiboken
    • None
    • Linux/X11

    Description

      Starting the attached script test.py leads to this message followed by a hard crash of the python interpreter. I get the errors stating "UNRECOGNIZED: QSharedPointer" all over the place when working with classes using QSharedPointers. I think there are two parts of this issues:

      1. The templated QSharedPointer[ptest.A] leads to a strange error message and traceback making it hard to follow the actual problem.
      2. The crash itself.

       

      /tmp/shiboken2-tests/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/signature/parser.py:191: RuntimeWarning: pyside_type_init:
      UNRECOGNIZED: 'ptest.QSharedPointer'
       OFFENDING LINE: 'ptest.D.set(l:QList[ptest.QSharedPointer[ptest.A]])'
      """.format(thing, line), RuntimeWarning)
       Traceback (most recent call last):
       File "/tmp/shiboken2-tests/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/signature/loader.py", line 93, in pyside_type_init
       return parser.pyside_type_init(type_key, sig_strings)
       File "/tmp/shiboken2-tests/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/signature/parser.py", line 435, in pyside_type_init
       props = calculate_props(line)
       File "/tmp/shiboken2-tests/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/signature/parser.py", line 324, in calculate_props
       annotations[name] = _resolve_type(ann, line, 0, handle_argvar)
       File "/tmp/shiboken2-tests/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/signature/parser.py", line 260, in _resolve_type
       part = var_handler(_resolve_type(part, line, level+1, var_handler))
       File "/tmp/shiboken2-tests/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/signature/parser.py", line 267, in _resolve_type
       return eval(result, namespace)
       File "<string>", line 1, in <module>
       AttributeError: module 'ptest' has no attribute 'QSharedPointer'
      The above exception was the direct cause of the following exception:
      Traceback (most recent call last):
       File "/tmp/shiboken2-tests/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/signature/loader.py", line 101, in seterror_argument
       return errorhandler.seterror_argument(args, func_name)
       File "/tmp/shiboken2-tests/lib/python3.7/site-packages/shiboken2/files.dir/shibokensupport/signature/errorhandler.py", line 99, in seterror_argument
       sigs = get_signature(func, "typeerror")
       SystemError: <built-in function get_signature> returned a result with an error set
       Fatal Python error: seterror_argument did not receive a result
      Current thread 0x00007fa03c1c7740 (most recent call first):
       File "test.py", line 5 in main
       File "test.py", line 7 in <module>
       Aborted
       
      

       

      Attachments

        1. parser.py
          16 kB
        2. pyside1212_6.zip
          4 kB
        3. pyside1212_repro.diff
          3 kB
        4. pyside1212_stack.txt
          21 kB
        5. pyside1212.zip
          4 kB
        6. shiboken2-bugreport.tar.gz
          2 kB

        Issue Links

          For Gerrit Dashboard: PYSIDE-1212
          # Subject Branch Project Status CR V

          Activity

            People

              kleint Friedemann Kleint
              bdev a dev
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes