[pcre-dev] [Bug 1432] New: pcre_compile.c generates unaligne…

Páxina inicial
Borrar esta mensaxe
Autor: Brian Ripley
Data:  
Para: pcre-dev
Asunto: [pcre-dev] [Bug 1432] New: pcre_compile.c generates unaligned int pointers
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1432
           Summary: pcre_compile.c generates unaligned int pointers
           Product: PCRE
           Version: 8.34
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: bug
          Priority: low
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: ripley@???
                CC: pcre-dev@???



An R user using gcc pre-49 (a Debian snapshot) and the Undefined Behaviour
sanitizer reported

/home/Hornik/src/R/src/extra/pcre/pcre_compile.c:3266:24: runtime error: load
of misaligned address 0x611000152bc5 for type 'const pcre_uint32' (aka 'const
unsigned int'), which requires 4 byte alignment
0x611000152bc5: note: pointer points here
 78 00 7b 6e 00 3e 00  00 ff ff 00 fc 01 00 00  f8 01 00 00 78 00 00 00  00 00
00 00 00 00 00 00  00
             ^ 
I can reproduce this with clang 3.4: it is new in 8.34.  All that is needed is
to compile the code with -fsanitize=undefined (or for clang,
-fsanitize=alignment).


Unfortunately the PCRE call is buried rather deep in R (www.r-project.org), but
it seems clear from the code that there is no attempt to ensure alignment.


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