From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] Bug in longjmp (was: Re: bug in dash compile with buildroot)
Date: Mon, 14 Jul 2014 07:40:02 +0200 [thread overview]
Message-ID: <53C36D32.1090206@mind.be> (raw)
In-Reply-To: <53BFA406.7080408@gmail.com>
[Removing dash from the list, since it's not related to dash.]
On 11/07/14 10:44, Luigi Tarenga wrote:
> Hi lists,
> for the buildroot mailing list: I tried to post this bug report but I wasn't
> subscribed.
> Below you can see my original bug report.
>
> I did some more test and the dash source looks good, the longjmp destination is
> correct (actually it jump to main()). The problem seems the longjmp implementation.
> In the case of command like dash -c "(echo ciao; /bin/true)&" a longjmp is not
> performed and so no segfault is triggered.
>
> as a POC I tried this little c code:
> [vortex at lizard ~]$ cat longjmptest.c
> #include <stdio.h>
> #include <setjmp.h>
>
> static jmp_buf env1;
>
> long int func2 () {
> long int b;
> b=1000;
> longjmp(env1,1);
> return b;
> }
>
> long int func1 () {
> long int a;
> a = func2 () ;
> return a;
> }
>
> int main() {
> long int num;
> num=0;
>
> printf("\nstart jump test\n");
>
> if (setjmp(env1)) {
> printf("jumped to env1\n");
> } else {
> num = func1 ();
> }
>
> printf("check 1 num=%ld\n",num);
> printf("finish\n");
> return 0;
> }
For the record: I could reproduce this with gcc-4.8.2 + uClibc 0.9.33.2, but
not with the gcc-4.7.3 + uClibc 0.99.33.2 downloaded from the autobuilders
br-x86-64-core2-full-2014.02-rc1.tar.bz2
Unfortunately, my i386-fu is not good enough to determine anything more than
that _longjmp_unwind seems to get an argument that overflows the stack.
Regards,
Arnout
[snip]
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
prev parent reply other threads:[~2014-07-14 5:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-08 14:23 bug in dash compile with buildroot Luigi Tarenga
2014-07-11 8:44 ` [Buildroot] " Luigi Tarenga
2014-07-11 8:44 ` Luigi Tarenga
2014-07-14 5:40 ` Arnout Vandecappelle [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53C36D32.1090206@mind.be \
--to=arnout@mind.be \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.