From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 0920D1960048 for ; Thu, 25 Jun 2015 18:50:32 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 23085B5D8D9 for ; Thu, 25 Jun 2015 19:14:46 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 5DBF297A826 for ; Thu, 25 Jun 2015 19:14:48 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Authentication-Results: funfun.nagaokaut.ac.jp (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=sendgrid.me Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZTPemAdTSi_s for ; Thu, 25 Jun 2015 19:14:47 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id D73FD97A836 for ; Thu, 25 Jun 2015 19:14:47 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 7753F952439 for ; Thu, 25 Jun 2015 19:14:45 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 3A469120457; Thu, 25 Jun 2015 19:14:44 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id 5FBE812041F for ; Thu, 25 Jun 2015 19:14:40 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=RJ3WcOOMNrI8cN6nHc43/pcE0MU=; b=ATtMU2e8ZSfOq4CpV+ bhYE88OnVylrEpJ3doz7/rwcFtun6n2U6TSvtXgnnlYvZVSZKBTNN+UCjBMjTADo FedtPdsR1gZCGlVZqdmnP09+D5CQ8XydwSX6uWURc4VXaPoRG09QVeclw1qWberA 16f1BbZJIruRAd37m3C1ELX54= Received: by filter0494p1mdw1.sendgrid.net with SMTP id filter0494p1mdw1.21325.558BD48C16 2015-06-25 10:14:36.591183307 +0000 UTC Received: from herokuapp.com (ec2-54-160-226-213.compute-1.amazonaws.com [54.160.226.213]) by ismtpd-019 (SG) with ESMTP id 14e2a3644e6.5ca6.2944d7 for ; Thu, 25 Jun 2015 10:14:36 +0000 (UTC) Date: Thu, 25 Jun 2015 10:14:36 +0000 From: nobu@ruby-lang.org To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 44313 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11306 X-Redmine-Issue-Author: dsaronin X-Redmine-Sender: nobu X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5qJ64lUdsP5xOXGi3Czamb+FDRBTcAlSmnUu KnSmWo4F5FrjOAAgBGwEDBnn6lU9G85stG17U9PeIfKI3KqMkr5629ZjBsfD8NQKFec9fpJP8L4uhp LzdXUmUSYBXwDlAwdfsRAY3aDfs/KDNXhwXv X-ML-Name: ruby-core X-Mail-Count: 69738 Subject: [ruby-core:69738] [Ruby trunk - Bug #11306] [Third Party's Issue] Segmentation fault X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #11306 has been updated by Nobuyoshi Nakada. Description updated Status changed from Open to Third Party's Issue A bug of that gem. ---------------------------------------- Bug #11306: Segmentation fault https://bugs.ruby-lang.org/issues/11306#change-53119 * Author: David Anderson * Status: Third Party's Issue * Priority: Normal * Assignee: * ruby -v: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- bug is detected during CUPS call in cups gem (https://github.com/m0wfo/cups) v0.1.10. The complete core dump is attached as file 'dump.txt'. the following works okay: ~~~ 2.2.1 :001 > list = Cups.show_destinations => ["laserjet_1102w", "lp_null"] 2.2.1 :002 > Cups.device_uri_for( list.first ) => "hp:/net/HP_LaserJet_Professional_P_1102w?ip=192.168.0.65" 2.2.1 :003 > Cups.device_uri_for( list.last ) => "file:///dev/null" ~~~ the following fails (the order is not important; the second call always fails with abort): ~~~ 2.2.1 :001 > list = Cups.show_destinations => ["laserjet_1102w", "lp_null"] 2.2.1 :002 > CupsDevice.testit( list.first ) => "hp:/net/HP_LaserJet_Professional_P_1102w?ip=192.168.0.65" 2.2.1 :003 > CupsDevice.testit( list.last ) /home/daudi/projectspace/swalapala/app/models/cups_device.rb:101: [BUG] Segmentation fault at 0x0000000a491862 ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux] ~~~ where: ~~~ruby class CupsDevice < ActiveRecord::Base def self.testit( cups_name ) Cups.device_uri_for( cups_name ) end end # class CupsDevice ~~~ and in the cups gem: ~~~c rb_define_singleton_method(rubyCups, "device_uri_for", cups_get_device_uri, 1); static VALUE cups_get_device_uri(VALUE self, VALUE printer) { if (!printer_exists(printer)) { rb_raise(rb_eRuntimeError, "The printer or destination doesn't exist!"); } VALUE options_list; http_t *http; ipp_t *request; ipp_t *response; ipp_attribute_t *attr; char uri[1024]; char *location; char *name = RSTRING_PTR(printer); request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES); httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), "ipp", NULL, "localhost", 0, "/printers/%s", name); ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, uri); if ((response = cupsDoRequest(http, request, "/")) != NULL) { if((attr = ippFindAttribute(response, "device-uri", IPP_TAG_URI)) != NULL) { return rb_str_new2(attr->values[0].string.text); } ippDelete(response); } return Qtrue; } ~~~ ---Files-------------------------------- dump.txt (206 KB) cups_device.rb (3.43 KB) cups.c (14.2 KB) -- https://bugs.ruby-lang.org/