Skip to content

Tmux #8

@stilscher

Description

@stilscher

Attempt:

  • ./goblint -v [path to tmux repository]/Makefile
  • or, as an intermediate step, to only check whether it can be build with cilly:
    sh autogen.sh && ./configure && make CC="cilly --gcc=/usr/bin/gcc --merge --keepmerged" LD="cilly --gcc=/usr/bin/gcc --merge --keepmerged"

Problems and Workarounds:

  1. missing GNU extended floating point types in CIL (_Float32, _Float64, _Float32x, _Float64x and _Float128x)
    error:
    /usr/include/stdlib.h[140:8-16] : syntax error
    Parsing errorFatal error: exception Frontc.ParseError("Parse error")
    
    This is the same problem as in OpenSSL #7. As a hacky quick fix to find out about other possible problems I patched the goblint-cil implementation: floatsquickfix.patch
  2. error during merging with cilly:
    /usr/include/x86_64-linux-gnu/bits/stdlib.h:37:37: error: redefinition of ‘realpath’
    37 | __NTH (realpath (const char *__restrict __name, char *__restrict __resolved))
    
    I think this has something to do with fortify functions which are some form of extern inlining and that it can be tracked back to this code in usr/include/stdlib.h:
    /* Define some macros helping to catch buffer overflows.  */
    #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
    # include <bits/stdlib.h>
    #endif
    
    and usr/include/x86_64-linux-gnu/bits/stdlib.h:
    __fortify_function __wur char *
    __NTH (realpath (const char *__restrict __name, char *__restrict __resolved))
    {...}
    
    But I haven't found out yet, what exactly causes the problem with cilly.
    If one turns off the gcc option FORTIFIED_SOURCE with
    ./goblint -v --set cppflags[+] -D_FORTIFY_SOURCE=0 [path to tmux repository]/Makefile
    cilly combines the files without any errors and the analysis is started.
    FORTIFY_SOURCE is implicitly enabled (and set to 2) with the activation of optimization level 2 (-O2) in the tmux Makefile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions