[Bug 201026] rtld-elf reaches divide-by-zero in symlook_obj on 11.0-CURRENT

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Jun 22 01:05:07 UTC 2015


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 at FreeBSD.org
          Reporter: gmbroome at 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=<value
optimized out>, 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.


More information about the freebsd-bugs mailing list