azure-sdk-for-python: Opening a service bus connection fails on macOS Big Sur with Python 3.8

  • Package Name: azure-servicebus
  • Package Version: 0.50.3 (same on 7.0.0)
  • Operating System: macOS 11.0.1
  • Python Version: 3.8.6

Describe the bug Opening a connection crashes the process with the following error:

2020-11-24 11:04:26.340 Python[68811:4815140] -[__NSCFConstantString objectForKey:]: unrecognized selector sent to instance 0x7fff80217af0
2020-11-24 11:04:26.342 Python[68811:4815140] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString objectForKey:]: unrecognized selector sent to instance 0x7fff80217af0'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff204b76af __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x00007fff201ef3c9 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff20539c85 -[NSObject(NSObject) __retain_OA] + 0
	3   CoreFoundation                      0x00007fff2041f06d ___forwarding___ + 1467
	4   CoreFoundation                      0x00007fff2041ea28 _CF_forwarding_prep_0 + 120
	5   CFNetwork                           0x00007fff247101ff CFURLRequestSetAllowsCellularAccess + 502
	6   CFNetwork                           0x00007fff24702195 _CFURLResponseGetSSLCertificateContext + 7757
	7   CoreFoundation                      0x00007fff20454ef0 CFReadStreamSetProperty + 87
	8   c_uamqp.cpython-38-darwin.so        0x0000000106fcda11 tlsio_appleios_dowork + 337
	9   c_uamqp.cpython-38-darwin.so        0x0000000106f01f9e __pyx_f_5uamqp_7c_uamqp_10Connection_do_work + 974
	10  c_uamqp.cpython-38-darwin.so        0x0000000106f52469 __pyx_pf_5uamqp_7c_uamqp_10Connection_16do_work + 73
	11  c_uamqp.cpython-38-darwin.so        0x0000000106f52404 __pyx_pw_5uamqp_7c_uamqp_10Connection_17do_work + 36
	12  Python                              0x00000001068dc9c8 method_vectorcall_NOARGS + 242
	13  Python                              0x0000000106975b6d call_function + 346
	14  Python                              0x000000010697272b _PyEval_EvalFrameDefault + 29833
	15  Python                              0x00000001068d57b2 function_code_fastcall + 106
	16  Python                              0x0000000106975b6d call_function + 346
	17  Python                              0x000000010697272b _PyEval_EvalFrameDefault + 29833
	18  Python                              0x00000001068d57b2 function_code_fastcall + 106
	19  Python                              0x0000000106975b6d call_function + 346
	20  Python                              0x000000010697272b _PyEval_EvalFrameDefault + 29833
	21  Python                              0x00000001068d57b2 function_code_fastcall + 106
	22  Python                              0x0000000106975b6d call_function + 346
	23  Python                              0x000000010697272b _PyEval_EvalFrameDefault + 29833
	24  Python                              0x00000001068d57b2 function_code_fastcall + 106
	25  Python                              0x00000001068d78e0 method_vectorcall + 256
	26  Python                              0x00000001068d51f9 PyVectorcall_Call + 108
	27  Python                              0x0000000106972ac4 _PyEval_EvalFrameDefault + 30754
	28  Python                              0x0000000106976687 _PyEval_EvalCodeWithName + 1947
	29  Python                              0x00000001068d5917 _PyFunction_Vectorcall + 227
	30  Python                              0x0000000106975b6d call_function + 346
	31  Python                              0x000000010697272b _PyEval_EvalFrameDefault + 29833
	32  Python                              0x00000001068d57b2 function_code_fastcall + 106
	33  Python                              0x0000000106975b6d call_function + 346
	34  Python                              0x000000010697272b _PyEval_EvalFrameDefault + 29833
	35  Python                              0x00000001068d57b2 function_code_fastcall + 106
	36  Python                              0x00000001068d78e0 method_vectorcall + 256
	37  Python                              0x00000001069721b0 _PyEval_EvalFrameDefault + 28430
	38  Python                              0x00000001068d57b2 function_code_fastcall + 106
	39  Python                              0x0000000106975b6d call_function + 346
	40  Python                              0x000000010697272b _PyEval_EvalFrameDefault + 29833
	41  Python                              0x0000000106976687 _PyEval_EvalCodeWithName + 1947
	42  Python                              0x00000001068d5917 _PyFunction_Vectorcall + 227
	43  Python                              0x0000000106975b6d call_function + 346
	44  Python                              0x0000000106972804 _PyEval_EvalFrameDefault + 30050
	45  Python                              0x00000001068d57b2 function_code_fastcall + 106
	46  Python                              0x0000000106975b6d call_function + 346
	47  Python                              0x0000000106972804 _PyEval_EvalFrameDefault + 30050
	48  Python                              0x0000000106976687 _PyEval_EvalCodeWithName + 1947
	49  Python                              0x000000010696b1ff PyEval_EvalCode + 51
	50  Python                              0x00000001069a448d run_eval_code_obj + 102
	51  Python                              0x00000001069a38dc run_mod + 82
	52  Python                              0x00000001069a27a8 PyRun_FileExFlags + 160
	53  Python                              0x00000001069a1e95 PyRun_SimpleFileExFlags + 271
	54  Python                              0x00000001069b9828 Py_RunMain + 1870
	55  Python                              0x00000001069b9b6f pymain_main + 306
	56  Python                              0x00000001069b9bbd Py_BytesMain + 42
	57  libdyld.dylib                       0x00007fff20360631 start + 1
	58  ???                                 0x0000000000000002 0x0 + 2
)
libc++abi.dylib: terminating with uncaught exception of type NSException

To Reproduce Steps to reproduce the behavior:

  1. Create a new virtual environment with Python 3
  2. Install azure-servicebus (0.50.3 or 7.0.0) as a dependency (which uses uamqp)
  3. The following script won’t work:
from azure.servicebus import ServiceBusClient

connection_string = '<connection-string>'
queue = '<queue-name>'

client: ServiceBusClient = ServiceBusClient.from_connection_string(connection_string)
client.get_queue_receiver(queue_name=queue).peek_messages(max_message_count=10)

Expected behavior The process should live.

NOTE: This is a duplicate of https://github.com/Azure/azure-uamqp-python/issues/185, though it might be related to both projects.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 15 (6 by maintainers)

Most upvoted comments

sorry for keeping you waiting for a long time.

We have released uamqp v1.2.13 today which includes the fix for this issue. Please upgrade the uamqp in your env to the latest version (e.g. via pip install uamqp --upgrade).

Let me know if you’re still getting trouble with the latest version.

patiently waiting on this one…

confirming the issue by building python from source code on BigSur with clang 12.0.0, that’s interesting. I’ll dig deeper to see how it is broken.

meanwhile, the official distribution for macos seems to work fine https://www.python.org/downloads/release/python-390/ – could you also verify it works on your machine?

--------- latest update ---------

found a relevant issue and the fix, will try it out

https://github.com/Azure/azure-iot-sdk-c/issues/1624 https://github.com/ayershinn/azure-c-shared-utility/pull/1/files

@kriwal-arkivverket according to this PR the fix in the underlying lib (uamqp) should be released at some point today. Afterwards we should theoretically be able to manually upgrade it with pip (because azure-servicebus specifies uamqp>=1.2.12, which should be compatible with the to-be-released 1.2.13).

Any news on when the release will be out? Thanks!

hey @cedrickring , FYI: my fix PR gets merged into the underlying C repo, we’ll do a uamqp release after we address some other uamqp issues.

@yunhaoling I can confirm, azure-servicebus seems to work when installing Python from this url https://www.python.org/downloads/release/python-390/. Though I prefer installing Python via homebrew which seems to be compiled with Clang 12.0.0…

I can verify that this is happening on my machine as well. Here are my system settings

pip 20.2.4 from /usr/local/lib/python3.9/site-packages/pip (python 3.9) Python 3.9.0

Error:

2020-12-01 22:43:19.936 Python[14029:1638834] -[__NSCFConstantString objectForKey:]: unrecognized selector sent to instance 0x7fff8021aaf0
2020-12-01 22:43:19.940 Python[14029:1638834] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString objectForKey:]: unrecognized selector sent to instance 0x7fff8021aaf0'
*** First throw call stack:
(
        0   CoreFoundation                      0x00007fff204ba6af __exceptionPreprocess + 242
        1   libobjc.A.dylib                     0x00007fff201f23c9 objc_exception_throw + 48
        2   CoreFoundation                      0x00007fff2053cc85 -[NSObject(NSObject) __retain_OA] + 0
        3   CoreFoundation                      0x00007fff2042206d ___forwarding___ + 1467
        4   CoreFoundation                      0x00007fff20421a28 _CF_forwarding_prep_0 + 120
        5   CFNetwork                           0x00007fff247131ff CFURLRequestSetAllowsCellularAccess + 502
        6   CFNetwork                           0x00007fff24705195 _CFURLResponseGetSSLCertificateContext + 7757
        7   CoreFoundation                      0x00007fff20457ef0 CFReadStreamSetProperty + 87
        8   c_uamqp.cpython-39-darwin.so        0x000000010dc4a1f9 tlsio_appleios_dowork + 313
        9   c_uamqp.cpython-39-darwin.so        0x000000010db83153 __pyx_f_5uamqp_7c_uamqp_10Connection_do_work + 963
        10  c_uamqp.cpython-39-darwin.so        0x000000010dbd0f29 __pyx_pf_5uamqp_7c_uamqp_10Connection_16do_work + 73
        11  c_uamqp.cpython-39-darwin.so        0x000000010dbd0ec4 __pyx_pw_5uamqp_7c_uamqp_10Connection_17do_work + 36
        12  Python                              0x000000010c4e042e cfunction_vectorcall_NOARGS + 277
        13  Python                              0x000000010c5582c0 call_function + 960
        14  Python                              0x000000010c555208 _PyEval_EvalFrameDefault + 27424
        15  Python                              0x000000010c4b06dc function_code_fastcall + 97
        16  Python                              0x000000010c558093 call_function + 403
        17  Python                              0x000000010c555208 _PyEval_EvalFrameDefault + 27424
        18  Python                              0x000000010c4b06dc function_code_fastcall + 97
        19  Python                              0x000000010c558093 call_function + 403
        20  Python                              0x000000010c555208 _PyEval_EvalFrameDefault + 27424
        21  Python                              0x000000010c4b06dc function_code_fastcall + 97
        22  Python                              0x000000010c558093 call_function + 403
        23  Python                              0x000000010c555208 _PyEval_EvalFrameDefault + 27424
        24  Python                              0x000000010c4b06dc function_code_fastcall + 97
        25  Python                              0x000000010c558093 call_function + 403
        26  Python                              0x000000010c555208 _PyEval_EvalFrameDefault + 27424
        27  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        28  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        29  Python                              0x000000010c4b233f method_vectorcall + 164
        30  Python                              0x000000010c4b03b3 PyVectorcall_Call + 146
        31  Python                              0x000000010c555554 _PyEval_EvalFrameDefault + 28268
        32  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        33  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        34  Python                              0x000000010c4b233f method_vectorcall + 164
        35  Python                              0x000000010c558093 call_function + 403
        36  Python                              0x000000010c55538e _PyEval_EvalFrameDefault + 27814
        37  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        38  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        39  Python                              0x000000010c4b233f method_vectorcall + 164
        40  Python                              0x000000010c558093 call_function + 403
        41  Python                              0x000000010c55538e _PyEval_EvalFrameDefault + 27814
        42  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        43  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        44  Python                              0x000000010c558093 call_function + 403
        45  Python                              0x000000010c555208 _PyEval_EvalFrameDefault + 27424
        46  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        47  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        48  Python                              0x000000010c4b233f method_vectorcall + 164
        49  Python                              0x000000010c558093 call_function + 403
        50  Python                              0x000000010c55538e _PyEval_EvalFrameDefault + 27814
        51  Python                              0x000000010c4b06dc function_code_fastcall + 97
        52  Python                              0x000000010c555554 _PyEval_EvalFrameDefault + 28268
        53  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        54  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        55  Python                              0x000000010c555554 _PyEval_EvalFrameDefault + 28268
        56  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        57  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        58  Python                              0x000000010c4b2442 method_vectorcall + 423
        59  Python                              0x000000010c555554 _PyEval_EvalFrameDefault + 28268
        60  Python                              0x000000010c4b06dc function_code_fastcall + 97
        61  Python                              0x000000010c558093 call_function + 403
        62  Python                              0x000000010c555208 _PyEval_EvalFrameDefault + 27424
        63  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        64  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        65  Python                              0x000000010c558093 call_function + 403
        66  Python                              0x000000010c555208 _PyEval_EvalFrameDefault + 27424
        67  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        68  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        69  Python                              0x000000010c558093 call_function + 403
        70  Python                              0x000000010c555208 _PyEval_EvalFrameDefault + 27424
        71  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        72  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        73  Python                              0x000000010c4b233f method_vectorcall + 164
        74  Python                              0x000000010c4b03b3 PyVectorcall_Call + 146
        75  Python                              0x000000010c555554 _PyEval_EvalFrameDefault + 28268
        76  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        77  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        78  Python                              0x000000010c4afebc _PyObject_FastCallDictTstate + 149
        79  Python                              0x000000010c4b0925 _PyObject_Call_Prepend + 139
        80  Python                              0x000000010c4f8373 slot_tp_call + 87
        81  Python                              0x000000010c4b0037 _PyObject_MakeTpCall + 266
        82  Python                              0x000000010c5580c7 call_function + 455
        83  Python                              0x000000010c55538e _PyEval_EvalFrameDefault + 27814
        84  Python                              0x000000010c4b06dc function_code_fastcall + 97
        85  Python                              0x000000010c558093 call_function + 403
        86  Python                              0x000000010c5552d0 _PyEval_EvalFrameDefault + 27624
        87  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        88  Python                              0x000000010c54e60d PyEval_EvalCode + 79
        89  Python                              0x000000010c54b947 builtin_exec + 581
        90  Python                              0x000000010c4e0233 cfunction_vectorcall_FASTCALL + 203
        91  Python                              0x000000010c558093 call_function + 403
        92  Python                              0x000000010c5552d0 _PyEval_EvalFrameDefault + 27624
        93  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        94  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        95  Python                              0x000000010c558093 call_function + 403
        96  Python                              0x000000010c5552d0 _PyEval_EvalFrameDefault + 27624
        97  Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        98  Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        99  Python                              0x000000010c558093 call_function + 403
        100 Python                              0x000000010c55538e _PyEval_EvalFrameDefault + 27814
        101 Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        102 Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        103 Python                              0x000000010c558093 call_function + 403
        104 Python                              0x000000010c55538e _PyEval_EvalFrameDefault + 27814
        105 Python                              0x000000010c4b06dc function_code_fastcall + 97
        106 Python                              0x000000010c558093 call_function + 403
        107 Python                              0x000000010c5552d0 _PyEval_EvalFrameDefault + 27624
        108 Python                              0x000000010c4b06dc function_code_fastcall + 97
        109 Python                              0x000000010c558093 call_function + 403
        110 Python                              0x000000010c555224 _PyEval_EvalFrameDefault + 27452
        111 Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        112 Python                              0x000000010c54e60d PyEval_EvalCode + 79
        113 Python                              0x000000010c54b947 builtin_exec + 581
        114 Python                              0x000000010c4e0233 cfunction_vectorcall_FASTCALL + 203
        115 Python                              0x000000010c558093 call_function + 403
        116 Python                              0x000000010c5552d0 _PyEval_EvalFrameDefault + 27624
        117 Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        118 Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        119 Python                              0x000000010c558093 call_function + 403
        120 Python                              0x000000010c5552d0 _PyEval_EvalFrameDefault + 27624
        121 Python                              0x000000010c558bdb _PyEval_EvalCode + 1998
        122 Python                              0x000000010c4b066c _PyFunction_Vectorcall + 248
        123 Python                              0x000000010c59f398 pymain_run_module + 353
        124 Python                              0x000000010c59ebbd Py_RunMain + 1199
        125 Python                              0x000000010c59f176 pymain_main + 306
        126 Python                              0x000000010c59f1c4 Py_BytesMain + 42
        127 libdyld.dylib                       0x00007fff20363631 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException