From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4DF9D22E8F for ; Fri, 28 Dec 2018 03:51:08 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p0dqHlM24xIQ for ; Fri, 28 Dec 2018 03:51:08 -0500 (EST) Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 88EF92041C for ; Fri, 28 Dec 2018 03:51:07 -0500 (EST) Date: Fri, 28 Dec 2018 11:51:04 +0300 From: Kirill Yukhin Subject: [tarantool-patches] Re: [PATCH] cmake: workaround GCC 7.2 segfault on v?sn?printf Message-ID: <20181228085104.ddkqgqwestb4vqqm@tarantool.org> References: <20181228082425.vfv6gpuntbgoxaes@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181228082425.vfv6gpuntbgoxaes@esperanza> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org Cc: Alexander Turenko On 28 Dec 11:24, Vladimir Davydov wrote: > On Fri, Dec 28, 2018 at 07:48:54AM +0300, Alexander Turenko wrote: > > GCC 7.2.1 fails like so on our codebase: > > > > /tarantool/src/lib/json/json.c: In function ‘json_token_snprint’: > > /tarantool/src/lib/json/json.c:324:1: internal compiler error: Segmentation fault > > json_token_snprint(char *buf, int size, const struct json_token *token, > > ^~~~~~~~~~~~~~~~~~ > > > > The backtrace of cc1 is the following (failed to install compatible > > debuginfo on Fedora 26, so ??s): > > > > #0 0x0000000000d0320c in get_source_location_for_substring(cpp_reader*, string_concat_db*, unsigned int, cpp_ttype, int, int, int, unsigned int*) () > > #1 0x00000000005c0e79 in c_get_substring_location(substring_loc const&, unsigned int*) () > > #2 0x00000000007f8418 in format_warning_va(substring_loc const&, source_range const*, char const*, int, char const*, __va_list_tag (*) [1]) () > > #3 0x00000000007f838b in format_warning_at_substring(substring_loc const&, source_range const*, char const*, int, char const*, ...) () > > #4 0x0000000000c72c2d in ?? () > > #5 0x0000000000f6f308 in execute_one_pass(opt_pass*) () > > #6 0x0000000000787da6 in ?? () > > #7 0x00000000012ac338 in symbol_table::compile() () > > #8 0x0000000000de650f in symbol_table::finalize_compilation_unit() () > > #9 0x00000000012ee8df in ?? () > > #10 0x0000000000d3ba84 in toplev::main(int, char**) () > > #11 0x0000000000d3d35b in main () > > > > The issue in the GCC bugtracker: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83448 > > > > The idea of the commit is to check builtin snprintf with the code from > > GCC test suite and disable all related builtins if the compiler is GCC > > and the case fails. > > > > We also need to disable FORTIFY_SOURCES in the case, because it uses > > v?sn?printf builtins directly. > > Frankly, I don't think it's worth adding a workaround for a buggy > compiler version that's only used by distributions that passed EOL. > IMO we'd better disable compilation for those distributions. I agree. GCC is now 7.4 and problem was fixed in 7.3, so I'd put a note into docs or even do nothing. -- Regards, Kirill Yukhin