• Stephan Bergmann's avatar
    Make cpp cope with long source lines · dac11d8d
    Stephan Bergmann yazdı
    under --with-lang=ALL it had started to crash during e.g.
    
    > LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}".../instdir/program:.../instdir/program" .../workdir/LinkTarget/Executable/cpp -+ -P -DWITH_POSTGRESQL_SDBC -DWITH_FIREBIRD_SDBC -DWITHOUT_EXTENSION_MEDIAWIKI -DWITHOUT_SCRIPTING_BEANSHELL -DWITHOUT_SCRIPTING_JAVASCRIPT -DWITH_HELPPACK_INTEGRATION -DWITH_EXTENSION_INTEGRATION -DENABLE_EXTENSION_UPDATE -DX86_64 -DLINUX -D_PTHREADS -DUNIX -DUNX -DCOMID=gcc3 -D_gcc3 -DWITH_LPSOLVER -I.../scp2/inc -I.../workdir -I.../config_host -I.../workdir/CustomTarget/scp2/macros -I.../workdir/ScpTemplateTarget/scp2/source/templates .../scp2/source/calc/file_calc.scp > .../workdir/ScpPreprocessTarget/scp2/source/calc/file_calc.pre
    
    because of
    
    > Syscall param read(buf) points to unaddressable byte(s)
    >    at 0x4F31A80: __read_nocancel (syscall-template.S:84)
    >    by 0x404F98: fillbuf (_lex.c:631)
    >    by 0x404CCF: gettokens (_lex.c:479)
    >    by 0x400F0A: process (_cpp.c:77)
    >    by 0x400E80: main (_cpp.c:60)
    >  Address 0x5278494 is 0 bytes after a block of size 32,772 alloc'd
    >    at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
    >    by 0x402034: domalloc (_cpp.c:321)
    >    by 0x40554F: setsource (_lex.c:679)
    >    by 0x403E38: doinclude (_include.c:130)
    >    by 0x401F9D: control (_cpp.c:297)
    >    by 0x401002: process (_cpp.c:101)
    >    by 0x400E80: main (_cpp.c:60)
    
    There appears to be no other check that fillbuf doesn't overflow the Source's
    input buffer, other than gettokens checking that the buffer isn't more than
    three quarters full ("if (ip >= s->inb + (3 * INS / 4)) ...").  That smells like
    cpp assumes input lines to be shorter than some maximum number of characters
    (like the C99 standard setting a minimum limit of "4095 characters in logical
    source lines"), and
    
    > #define README_TXT_ALL_LANG(key, name, ext) \
    > 	key (af) = READMETXTFILENAME(name,_af,ext); \
    > 	Name (am) = CONFIGLANGFILENAME(name,am,ext); \
    > 	Name (ar) = CONFIGLANGFILENAME(name,ar,ext); \
    [...]
    > 	Name (zh-CN) = CONFIGLANGFILENAME(name,zh-CN,ext); \
    > 	Name (zh-TW) = CONFIGLANGFILENAME(name,zh-TW,ext); \
    > 	key (zu) = READMETXTFILENAME(name,_zu,ext)
    
    in workdir/CustomTarget/scp2/macros/langmacros.inc (which appears to be the
    culprit here) exceeding that limit under --with-lang=ALL.
    
    So just bump the input buffer size.
    
    Change-Id: I5d863050fb772dc7e691a604009ff8702dc718e3
    dac11d8d
Adı
Son kayıt (commit)
Son güncelleme
..
cpp Loading commit data...
mkdepend Loading commit data...
Executable_cpp.mk Loading commit data...
Executable_makedepend.mk Loading commit data...
Makefile Loading commit data...
Module_soltools.mk Loading commit data...