Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-2405

SASL<->Ruby binding can cause seg_faults



    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 0.5
    • None
    • Ruby Client
    • Ubuntu, ruby 1.8.7, qpid 0.5


      There is an issue with the sasl bindings where it returns a raw ruby VALUE type for the sasl context. This works UNTIL the ruby runtime tries to access that variable which then causes a segfault.

      This is easy to see if you try to inspect the variable at all (like print it or ask for its class or methods). In my application, for reasons I haven't determined yet, just having this variable on the heap meant that when an exception occurred trying to print the exceptions message caused a seg fault.

      In any case, passing back raw VALUEs to ruby code is a Bad Idea and goes against the spec. There is a simple macro and fix for this which wraps the returned value in a ruby object. This fixes the issue I was having and means the deleting of the object is done automatically (instead of having a manual free function).

      I have a patch with the simple, low impact fix, really it would be better to the extension so the sasl client is repersented as a real ruby object but that would require atleast some client code changes.


        1. sasl.patch
          2 kB
          Sam Hendley



            tross Ted Ross
            sam.hendley Sam Hendley
            2 Vote for this issue
            1 Start watching this issue