From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23069 invoked by alias); 20 Sep 2015 04:09:20 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36565 Received: (qmail 16620 invoked from network); 20 Sep 2015 04:09:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=oBMnawF0KphcdwlwFCaOUKVk5tcaX7YiDIVV4uFqFc4=; b=igePxfGDLJYn9aRyv8iMotlzksulUh41MnXId0YjHf8OAcvxXCdkFwo6B8V28QIOQ9 X9CtkRJYlabUlbxafFvHuNrSOD6qMYsvWhJEovEp8s4WomEsLuTAtGlZINp6JLibFMCM nF3Tz581tLr5TEUV2I2abOjliKowz0d4PRqg94yrFZGQPeS41Bchccf0QPqCV67PMhJv 3igKN4LS4By6l0U5lTkEg6s2/tTa6huI3pYsVSs+VBxGdnrLJyjKNvTDEJhwrRK9q+u7 3VAC/toOA1cRWTBoLfN61xyggdmXHsuMjB1YOKUddoY3Ru908WeAk91cQorxmsYKoN6t s3FQ== X-Gm-Message-State: ALoCoQmYucwE9D+2bzg9k4ZvB40D2vZqQMq0kQmP0G+iErOjV21YYgTdRWLzQMze0F+hKBjzsngz X-Received: by 10.60.177.73 with SMTP id co9mr7830405oec.5.1442722156644; Sat, 19 Sep 2015 21:09:16 -0700 (PDT) From: Bart Schaefer Message-Id: <150919210913.ZM23887@torch.brasslantern.com> Date: Sat, 19 Sep 2015 21:09:13 -0700 In-Reply-To: <20150919233528.41828582@ntlworld.com> Comments: In reply to Peter Stephenson "Re: Two issues found with -fsanitize=undefined" (Sep 19, 11:35pm) References: <20150917075759.GA24365@x4> <20150919205751.5338bddc@ntlworld.com> <20150919201814.GA409@x4> <20150919233528.41828582@ntlworld.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Two issues found with -fsanitize=undefined MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 19, 11:35pm, Peter Stephenson wrote: } Subject: Re: Two issues found with -fsanitize=undefined } } On Sat, 19 Sep 2015 22:18:14 +0200 } Markus Trippelsdorf wrote: } > ./D02glob.ztst: starting. } > exec.c:2240:6: runtime error: index 8 out of bounds for type 'int [8]' } > exec.c:2048:10: runtime error: index 8 out of bounds for type 'int [8]' } > exec.c:2122:7: runtime error: index 8 out of bounds for type 'int [8]' } } It may be the compiler isn't actually looking at the memory allocated, } only the definition of the structure. Certainly valgrind has never } complained here and this is something it should pick up. Yep, this is clearly a case of the compiled-in bounds-checking making the assumption that the size of the allocated space is the same as the size of the declared structure. We're making deliberate use of C's lack of strict pointer bounds. We can shut it up with a "#pragma clang ..." but it's going to get annoying to do that for every possible compiler.