Follow-up Comment #26, bug #64421 (project groff): OK I found an option in /etc/makepkg.conf which lets me control link time optimization. *When turning on that LTO flag, the bug appears* -- so it *is* the -flto=auto flag which makes the issue appear.
*I updated the good-and-bad-groff.tar file* on https://blog.gnoack.org/good-and-bad-groff.tar so it has all three package versions and the corresponding build logs: * good - the package which worked * good-turned-bad - the same, but broken -- I only enabled link-time-optimization which was disabled in "good" * broken - the older package which was broken, included for completeness The diff between the good and good-turned-bad build logs is also interesting: * You can see that the only flag difference is -flto=auto * There is a compiler warning about vsnprintf disappearing (weird?) * But many compiler warnings are appearing about out-of-bound memory accesses (I can't quite follow the code there) Diff: $ diff good/groff-1.23.0-3-x86_64-build.log good-turned-bad/groff-1.23.0-3-x86_64-build.log 328c328 < C++ compiler and options : g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS --- > C++ compiler and options : g++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -flto=auto 330c330 < C compiler and options : gcc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection --- > C compiler and options : gcc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -flto=auto 490,501d489 < In file included from /usr/include/stdio.h:964, < from ./lib/stdio.h:43, < from ./src/include/getopt.h:35, < from ./src/include/lib.h:44, < from src/preproc/html/pre-html.cpp:24: < In function ‘int vsnprintf(char*, size_t, const char*, __va_list_tag*)’, < inlined from ‘char* make_string(const char*, ...)’ at src/preproc/html/pre-html.cpp:408:16: < /usr/include/bits/stdio2.h:68:36: warning: null destination pointer [-Wformat-truncation=] < 68 | return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, < | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ < 69 | __glibc_objsize (__s), __fmt, __ap); < | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 561a550,575 > In member function ‘merge’, > inlined from ‘make_reference.isra’ at src/preproc/refer/refer.cpp:1088:26: > src/preproc/refer/ref.cpp:179:31: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] > 179 | field = new string[nfields]; > | ^ > src/preproc/refer/ref.cpp:179:31: note: in a call to built-in allocation function ‘operator new []’ > src/preproc/refer/ref.cpp: In member function ‘__ct_base ’: > src/preproc/refer/ref.cpp:140:29: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] > 140 | field = new string[nfields]; > | ^ > src/preproc/refer/ref.cpp:140:29: note: in a call to built-in allocation function ‘operator new []’ > In member function ‘delete_field’, > inlined from ‘set_date’ at src/preproc/refer/ref.cpp:1073:17, > inlined from ‘compute_label’ at ../src/preproc/refer/label.ypp:855:13: > src/preproc/refer/ref.cpp:225:33: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] > 225 | field = new string[nfields - 1]; > | ^ > src/preproc/refer/ref.cpp:225:33: note: in a call to built-in allocation function ‘operator new []’ > In member function ‘insert_field’, > inlined from ‘set_date’ at src/preproc/refer/ref.cpp:1075:17, > inlined from ‘set_date’ at src/preproc/refer/ref.cpp:1070:6, > inlined from ‘compute_label’ at ../src/preproc/refer/label.ypp:855:13: > src/preproc/refer/ref.cpp:200:33: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] > 200 | field = new string[nfields + 1]; > | ^ > src/preproc/refer/ref.cpp:200:33: note: in a call to built-in allocation function ‘operator new []’ 566a581,602 > In member function ‘add_rows’, > inlined from ‘process_format’ at src/preproc/tbl/main.cpp:1205:16: > src/preproc/tbl/main.cpp:688:49: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] > 688 | entry[nrows + i] = new entry_format[ncolumns]; > | ^ > src/preproc/tbl/main.cpp:688:49: note: in a call to built-in allocation function ‘operator new []’ > In member function ‘__ct ’, > inlined from ‘process_format’ at src/preproc/tbl/main.cpp:1208:35: > src/preproc/tbl/main.cpp:651:30: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] > 651 | width = new string[ncolumns]; > | ^ > src/preproc/tbl/main.cpp:651:30: note: in a call to built-in allocation function ‘operator new []’ > src/preproc/tbl/main.cpp:660:41: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] > 660 | entry[i] = new entry_format[ncolumns]; > | ^ > src/preproc/tbl/main.cpp:660:41: note: in a call to built-in allocation function ‘operator new []’ > In member function ‘__ct ’, > inlined from ‘process_data’ at src/preproc/tbl/main.cpp:1286:28: > src/preproc/tbl/table.cpp:1257:38: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] > 1257 | minimum_width = new string[ncolumns]; > | ^ > src/preproc/tbl/table.cpp:1257:38: note: in a call to built-in allocation function ‘operator new []’ Branden, I wonder - do you think you can reproduce this locally when building with -flto=auto? _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?64421> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/