From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-01.nifty.com (conssluserg-01.nifty.com [210.131.2.80]) by sourceware.org (Postfix) with ESMTPS id 71F643857010 for ; Sat, 6 Mar 2021 01:07:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 71F643857010 Received: from Express5800-S70 (y085178.dynamic.ppp.asahi-net.or.jp [118.243.85.178]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 12616mK9018188 for ; Sat, 6 Mar 2021 10:06:48 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 12616mK9018188 X-Nifty-SrcIP: [118.243.85.178] Date: Sat, 6 Mar 2021 10:06:57 +0900 From: Takashi Yano To: cygwin@cygwin.com Subject: Re: stack grow direction wrongly detected Message-Id: <20210306100657.135a86aacf935a7f9e9a7847@nifty.ne.jp> In-Reply-To: References: <6eded5d3-93f3-7c98-5055-ee5ac2566bc8@gmail.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 01:07:26 -0000 On Fri, 5 Mar 2021 21:29:49 +0100 Marco Atzeri wrote: > guile 1.8.8 is 10 years old, but it is still used by some programs > as all the guile 2.x series were slower. > the code on recent guile 3.0.x is different, with no recursion at all. > > SCM_I_GSC_STACK_GROWS_UP=0 > AC_RUN_IFELSE([AC_LANG_SOURCE( > [AC_INCLUDES_DEFAULT > int > find_stack_direction (int *addr, int depth) > { > int dir, dummy = 0; > if (! addr) > addr = &dummy; > *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; > dir = depth ? find_stack_direction (addr, depth - 1) : 0; ^^^^^^^^^^^^^^^^^^^^ This calls find_stack_direction() recursively, isn't it? > return dir + dummy; > } > > int > main (int argc, char **argv) > { > return find_stack_direction (0, argc + !argv + 20) < 0; > }])], Recursion depth seems to be increased to more than 20. -- Takashi Yano