Return-Path: Delivered-To: apmail-qpid-dev-archive@www.apache.org Received: (qmail 79059 invoked from network); 13 Sep 2010 08:16:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Sep 2010 08:16:17 -0000 Received: (qmail 89345 invoked by uid 500); 13 Sep 2010 08:16:17 -0000 Delivered-To: apmail-qpid-dev-archive@qpid.apache.org Received: (qmail 89142 invoked by uid 500); 13 Sep 2010 08:16:14 -0000 Mailing-List: contact dev-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list dev@qpid.apache.org Received: (qmail 89128 invoked by uid 500); 13 Sep 2010 08:16:13 -0000 Delivered-To: apmail-incubator-qpid-dev@incubator.apache.org Received: (qmail 89124 invoked by uid 99); 13 Sep 2010 08:16:12 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 08:16:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Sep 2010 08:15:54 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8D8FWI8024724 for ; Mon, 13 Sep 2010 08:15:32 GMT Message-ID: <19710607.149691284365732386.JavaMail.jira@thor> Date: Mon, 13 Sep 2010 04:15:32 -0400 (EDT) From: =?utf-8?Q?Pawe=C5=82_Krze=C5=9Bniak_=28JIRA=29?= To: qpid-dev@incubator.apache.org Subject: [jira] Commented: (QPID-2405) SASL<->Ruby binding can cause seg_faults In-Reply-To: <1552820841.240861266011548369.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/QPID-2405?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D12908= 664#action_12908664 ]=20 Pawe=C5=82 Krze=C5=9Bniak commented on QPID-2405: --------------------------------------- I can confirm that bug exists. Invoiking inspect method on Connection or Br= oker ends up with segfault: --- $ ruby -e 'require "qpid"; s=3DQpid::Qmf::Session.new(); b=3Ds.add_broker; = puts b.inspect' -e:1: [BUG] Segmentation fault ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux], MBARI 0x8770, Ruby Ent= erprise Edition 2010.01 Aborted --- And I can confirm that Sam's patch fixes the problem. > SASL<->Ruby binding can cause seg_faults > ---------------------------------------- > > Key: QPID-2405 > URL: https://issues.apache.org/jira/browse/QPID-2405 > Project: Qpid > Issue Type: Bug > Components: Ruby Client > Affects Versions: 0.5 > Environment: Ubuntu, ruby 1.8.7, qpid 0.5 > Reporter: Sam Hendley > Assignee: Ted Ross > Fix For: 0.5 > > Attachments: sasl.patch > > > There is an issue with the sasl bindings where it returns a raw ruby VALU= E type for the sasl context. This works _UNTIL_ the ruby runtime tries to a= ccess that variable which then causes a segfault.=20 > 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 have= n't determined yet, just having this variable on the heap meant that when a= n exception occurred trying to print the exceptions message caused a seg fa= ult.=20 > 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 mean= s the deleting of the object is done automatically (instead of having a man= ual 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 b= ut that would require atleast some client code changes. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:dev-subscribe@qpid.apache.org