From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16447 invoked by alias); 13 Dec 2011 19:42:12 -0000 Received: (qmail 16437 invoked by uid 22791); 13 Dec 2011 19:42:11 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp05.smtpout.orange.fr (HELO smtp.smtpout.orange.fr) (80.12.242.127) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Dec 2011 19:41:46 +0000 Received: from treguer.localnet ([90.32.19.6]) by mwinf5d61 with ME id 8jhk1i00407rqCi03jhkgq; Tue, 13 Dec 2011 20:41:45 +0100 From: "Yann E. MORIN" To: crossgcc@sourceware.org Subject: Re: Broken backtrace Date: Tue, 13 Dec 2011 19:42:00 -0000 User-Agent: KMail/1.13.5 (Linux/3.1.5-treguer; KDE/4.4.5; x86_64; ; ) Cc: =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau?= References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201112132041.43690.yann.morin.1998@anciens.enib.fr> Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00049.txt.bz2 Beno=C3=AEt, All, On Tuesday 13 December 2011 19:06:18 Beno=C3=AEt Th=C3=A9baudeau wrote: > Hi Yann, all, >=20 > I'm not sure if it was already the case with previous Ubuntus, but CT-NG's > backtrace is broken at least with Ubuntu 11.10 (using bash): It's also broken here on Debian Squeeze. I have not yet investigated too much, but I plan on doing so after I finish some more important stuff (eg. multilib, canadian...). > [INFO ] Installing PPL: done in 7912.66s (at 198:02) > [INFO ] Saving state to restart at step 'cloog'... > [INFO ] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > [INFO ] Installing CLooG/ppl > [ERROR] make[2]: *** [cloog] Error 1 > [ERROR] make[1]: *** [check-recursive] Error 1 > [ERROR] > [ERROR] >> > [ERROR] >> Error happened in: main[scripts/crosstool-NG.sh] > [ERROR] >> > [ERROR] >> For more info on this error, look at the file: 'build.log' > [ERROR] >> There is a list of known issues, some with workarounds, in: > [ERROR] >> '/Toolchains/crosstool-ng/build/share/doc/ct-ng-hg+def= ault-69cfd6e0f1d1/B - Known issues.txt' > [ERROR] > [ERROR] Build failed in step 'Extracting and patching toolchain compon= ents' > [ERROR] > [ERROR] (elapsed: 198:20.71) >=20 > The step should have been 'Installing CLooG/ppl', and the calls should ha= ve been > backtraced. >=20 > I've performed some tests, which show that this issue is caused by the fo= llowing > lines: >=20 > 14 # Bail out early in subshell, the upper level shell will act a= ccordingly. > 15 [ ${BASH_SUBSHELL} -eq 0 ] || exit $ret >=20 > http://crosstool-ng.org/hg/crosstool-ng/file/096845dbd877/scripts/functio= ns#l14 >=20 > The trace should be displayed for the deepest subshell, not for the top o= ne. >=20 > For this example, I end up with subshells 2 to 0, and the trace variables > CT_STEP_COUNT and CT_STEP_MESSAGE are correct only for subshells 2 and 1.= For > subshell 0, these variables are like before do_cloog() is called, i.e. 1 = for > ${CT_STEP_COUNT}, "" for ${CT_STEP_MESSAGE[1]} and "Extracting and > patching toolchain components" for ${CT_STEP_MESSAGE[2]}. CT_OnError() se= ts > CT_STEP_COUNT to 2 before logging ${CT_STEP_MESSAGE[${CT_STEP_COUNT}]}, h= ence > the result. OK, I just understood what happens! Thanks for pointing this. Can you try to revert changeset #652e56d6d35a: scripts: execute each steps in a subshell To avoid variable leakage from one step to another, isolate the steps from each others by running them in their own sub-shell. This avoids variables leaking from one step to the others. > Notes regarding CT_OnError() (nothing to do with this issue): > - The step variable (already used in main()) could be defined as local t= o be > cleaner, even if it does not really matter when exiting. > - "offset=3D1" seems to be a spurious line. Probably both right, I'll look after dinner. > As to the error itself of my example, I'm testing a patch I've just cooke= d. Thank you! Regards, Yann E. MORIN. --=20 .-----------------.--------------------.------------------.----------------= ----. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspira= cy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ = | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is = no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspirac= y. | '------------------------------^-------^------------------^----------------= ----' -- For unsubscribe information see http://sourceware.org/lists.html#faq