From owner-freebsd-bugs@FreeBSD.ORG Mon Jun 22 01:05:07 2015 Return-Path: Delivered-To: freebsd-bugs@nevdull.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 706E7989 for ; Mon, 22 Jun 2015 01:05:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48B9C8A9 for ; Mon, 22 Jun 2015 01:05:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t5LMV1RR027982 for ; Sun, 21 Jun 2015 22:31:01 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 201026] rtld-elf reaches divide-by-zero in symlook_obj on 11.0-CURRENT Date: Sun, 21 Jun 2015 22:31:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: gmbroome@vcu.edu X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jun 2015 01:05:07 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201026 Bug ID: 201026 Summary: rtld-elf reaches divide-by-zero in symlook_obj on 11.0-CURRENT Product: Base System Version: 11.0-CURRENT Hardware: sparc64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: gmbroome@vcu.edu Created attachment 157958 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=157958&action=edit Arguments passed to symlook_obj Offending line in libexec/rtld-elf/rtld.c: 4143 bucket = obj->buckets_gnu[req->hash_gnu % obj->nbuckets_gnu]; As we're doing a modulo, there seems to be an assumption that obj->nbuckets_gnu is non-zero by the time that we get here. I've run into at least one case where it is zero, triggering a SIGFPE. Running on world and kernel from SVN (r284174) on 11.0-CURRENT sparc64. Model is a Blade 2000 using 2 x USIIICu 1.2GHz. Kernel, world, and indeed entire stack of ports in this case were built with completely empty make.conf; no -O flags or such. The div-by-zero on the above mentioned line is triggered (at least) any time that Xorg attempts to load /usr/local/lib/libfontenc.so.1 from x11-fonts/libfontenc. Expected results: Xorg displays the launched application Actual results: Xorg exits with a SIGFPE N.B. Utilizing libfontenc.so.1 in my own 'dummy' test application results in the same signal, suggesting that this is a linker issue (or possibly a fontenc issue) rather than an Xorg one; Xorg was just first the manifestation here. Backtrace: #0 0x00000000403cc9d8 in symlook_obj (req=0x7fdffffe920, obj=0x403f1c00) at rtld.c:4143 #1 0x00000000403ccb28 in symlook_list (req=0x7fdffffea20, objlist=, dlp=0x7fdffffec70) at rtld.c:3860 #2 0x00000000403ccd80 in symlook_global (req=0x7fdffffed40, donelist=0x7fdffffec70) at rtld.c:3758 #3 0x00000000403cd204 in symlook_default (req=0x7fdffffed40, refobj=0x403e7000) at rtld.c:3811 #4 0x00000000403cd4a8 in find_symdef (symnum=26, refobj=0x403e7000, defobj_out=0x7fdffffee78, flags=1, cache=0x0, lockstate=0x7fdffffee40) at rtld.c:1592 #5 0x00000000403cdb1c in _rtld_bind (obj=0x403e7000, reloff=1872) at rtld.c:713 #6 0x00000000403c60a0 in _rtld_bind_start_1 () at /usr/src/libexec/rtld-elf/sparc64/rtld_start.S:166 Attached items: "obj" and "req", as passed to symlook_obj, and my binary of libfontenc.so.1 -- You are receiving this mail because: You are the assignee for the bug.