[pcre-dev] [Bug 1427] New: pcre 8.34 has alignment bug on SP…

Top Page
Delete this message
Author: Ian Donaldson
Date:  
To: pcre-dev
New-Topics: [pcre-dev] [Bug 1427] pcre 8.34 has alignment bug on SPARC
Subject: [pcre-dev] [Bug 1427] New: pcre 8.34 has alignment bug on SPARC
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1427
           Summary: pcre 8.34 has alignment bug on SPARC
           Product: PCRE
           Version: 8.33
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: iand@???
                CC: pcre-dev@???



SPARC architecture won't let you fetch 32-bit objects unless
they are aligned to a 32-bit boundary. PCRE is violating this
and dumping core on SPARC.

Backing out to 8.32 works fine on SPARC.

Looks like 8.34 has new code that does some optimizations
by doing multibyte copies, but doesn't check for alignment first.
You can get away with this on many architectures like x86 but not SPARC.

Below is a backtrace from a core generated by 'make check'

$ env LD_LIBRARY_PATH=`pwd`/.libs gdb
/import/src/libraries/pcre/pcre-8.34.sparc_sol9_build/.libs/pcretest core
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.9".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/import/src/libraries/pcre/pcre-8.34.sparc_sol9_build/.libs/pcretest...done.
[New LWP 1]

warning: Can't read pathname for load map: I/O error.
Core was generated by
`/import/src/libraries/pcre/pcre-8.34.sparc_sol9_build/.libs/pcretest -q
./testd'.
Program terminated with signal 10, Bus error.
#0  compare_opcodes (code=<optimized out>, utf=utf@entry=0,
    cd=cd@entry=0xffbfb688, base_list=base_list@entry=0xffbfb668,
    base_end=0x53881 "n") at pcre_compile.c:3266
3266            if ((*set1++ & *set2++) != 0) return FALSE;
(gdb) where
#0  compare_opcodes (code=<optimized out>, utf=utf@entry=0,
    cd=cd@entry=0xffbfb688, base_list=base_list@entry=0xffbfb668,
    base_end=0x53881 "n") at pcre_compile.c:3266
#1  0xff36b174 in auto_possessify (cd=<optimized out>, utf=<optimized out>,
    code=0x5385f "n") at pcre_compile.c:3649
#2  pcre_compile2 (
    pattern=0x2eff1
"^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$",
options=<optimized out>, errorcodeptr=0x0,
    errorptr=0xffbfc9c8, erroroffset=0xffbfc9d8, tables=<optimized out>)
    at pcre_compile.c:9210
#3  0x00015ab8 in main (argc=<optimized out>, argv=<optimized out>)
    at pcretest.c:3962
(gdb) p set1
$1 = (const pcre_uint32 *) 0x53860
(gdb) p set2
$2 = (const pcre_uint32 *) 0x53882
(gdb) quit




BTW this bug reporting tool didn't have 8.34 as a known version so I filed
it under 8.33


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email