Skip to content
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

Unable to receive ServiceBus queue message created in Java SDK #15568

Closed
pfijalki opened this issue Nov 28, 2020 · 5 comments
Closed

Unable to receive ServiceBus queue message created in Java SDK #15568

pfijalki opened this issue Nov 28, 2020 · 5 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus

Comments

@pfijalki
Copy link

  • azure-servicebus:
  • 7.0.0:
  • Ubuntu, 4.15.0-123-generi:
  • 3.7.3:

Describe the bug
Cannot receive message sent from Java (OpenJDK 1.8) Azure servicebus SDK

To Reproduce
Steps to reproduce the behavior:

  1. Send message through java using https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-java-how-to-use-queues
  2. Try to receive message using https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-python-how-to-use-queues

Expected behavior
Possibility to process the message

Attempt on receiving message results in SIGSEGV and python crash

*** SIGSEGV (@0x0) received by PID 20726 (TID 0x7fceb26c7080) from PID 0; stack trace: ***
    @     0x7fceb22be8a0 (unknown)
    @     0x7fceb18a4811 (unknown)
    @     0x5615294d604c PyBytes_FromString
    @     0x7fceaa2ce6ac __pyx_pf_5uamqp_7c_uamqp_11cProperties_7user_id___get__
    @     0x7fceaa2ce5ee __pyx_pw_5uamqp_7c_uamqp_11cProperties_7user_id_1__get__
    @     0x7fceaa306c8f __pyx_getprop_5uamqp_7c_uamqp_11cProperties_user_id
    @     0x561529526fb7 PyObject_GenericGetAttr
    @     0x5615294c311c _PyEval_EvalFrameDefault
    @     0x561529598d20 _PyEval_EvalCodeWithName
    @     0x5615294dc08a _PyFunction_FastCallDict
    @     0x5615294df231 _PyObject_Call_Prepend
    @     0x5615295463b1 slot_tp_init
    @     0x56152953fb37 type_call
    @     0x5615294dc82f _PyObject_FastCallKeywords
    @     0x5615294c36f6 _PyEval_EvalFrameDefault
    @     0x5615294bf827 function_code_fastcall
    @     0x5615294c729d _PyEval_EvalFrameDefault
    @     0x5615294bf827 function_code_fastcall
    @     0x5615294dc1f7 _PyFunction_FastCallDict
    @     0x5615296756d5 property_descr_get
    @     0x561529526fb7 PyObject_GenericGetAttr
    @     0x5615294c311c _PyEval_EvalFrameDefault
    @     0x561529598d20 _PyEval_EvalCodeWithName
    @     0x5615294dc29f _PyFunction_FastCallKeywords
    @     0x5615294c7da1 _PyEval_EvalFrameDefault
    @     0x561529598d20 _PyEval_EvalCodeWithName
    @     0x5615294dc08a _PyFunction_FastCallDict
    @     0x5615294df231 _PyObject_Call_Prepend
    @     0x5615295463b1 slot_tp_init
    @     0x56152953fb37 type_call
    @     0x5615294dc82f _PyObject_FastCallKeywords
    @     0x5615294c36f6 _PyEval_EvalFrameDefault

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 28, 2020
@yunhaoling yunhaoling added Client This issue points to a problem in the data-plane of the library. Service Bus labels Nov 30, 2020
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Nov 30, 2020
@yunhaoling yunhaoling self-assigned this Nov 30, 2020
@yunhaoling
Copy link
Contributor

hey @pfijalki, thanks for reaching out.

I followed your steps and was able to reproduce the issue. This should be a bug triggered by the underlying uamqp library reading "inaccessible memory" on property of a message, I have created issue in the uamqp repo: Azure/azure-uamqp-python#186.

I'll investigate on how to fix it and then include the fix in uamqp bug fix release.

@pfijalki
Copy link
Author

pfijalki commented Dec 2, 2020

hey @yunhaoling, thank you for the update and fast response Time. Do you mind sharing in brief description steps to debug/reproduce such issue ? I tried to do this by myself but couldn't asses which line was causing the error

@yunhaoling
Copy link
Contributor

yunhaoling commented Dec 2, 2020

hello @pfijalki ,

This one is a bit hard to reproduce as it turns out to be a bug in the cython layer.
if you're interested in the detail, I already got a PR out to fix the issue: Azure/azure-uamqp-python#187

the main issue here is trying to access the user_id of an AMQP message in the "src/properties.pyx":

    def user_id(self):
        cdef c_amqpvalue.amqp_binary _binary
        if c_amqp_definitions.properties_get_user_id(self._c_value, &_binary) == 0:
            return <char*>_binary.bytes

return <char*>_binary.bytes where _binary.bytes could be a NULL C pointer, and in this case it shouldn't be returned directly which is the receiving messages sent by Java SDK case.

To fix it, we need to convert the C char* data to a python variable first by

bytes_value = <char*>_binary.bytes

then we could safely return bytes_value

@yunhaoling
Copy link
Contributor

hey @pfijalki , FYI: my fix PR gets merged, we'll do a uamqp release after we address some other uamqp issues.

@yunhaoling
Copy link
Contributor

yunhaoling commented Jan 6, 2021

hello @pfijalki , hope you're keeping well.

We have released uamqp v1.2.13 today which includes the fix.
Please upgrade to the latest uamqp version via pip install uamqp --upgrade to see if it solves the problem.

I'm closing this issue now, but feel free to reopen if you still get trouble with the latest version.

openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this issue Aug 10, 2021
track2 modify Event Grid readme.go.md (Azure#15568)
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus
Projects
None yet
Development

No branches or pull requests

2 participants