From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,4590cbe206fc9bb9 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.42.68 with SMTP id r4mr2969702qae.4.1347034710574; Fri, 07 Sep 2012 09:18:30 -0700 (PDT) Received: by 10.236.87.71 with SMTP id x47mr914723yhe.6.1347034710552; Fri, 07 Sep 2012 09:18:30 -0700 (PDT) Path: da15ni12456543qab.0!nntp.google.com!b19no4140519qas.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 7 Sep 2012 09:18:30 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=192.31.106.36; posting-account=YkFdLgoAAADpWnfCBA6ZXMWTz2zHNd0j NNTP-Posting-Host: 192.31.106.36 References: <6dfcb108-01de-42e4-962a-87a9ac91741c@googlegroups.com> <87fw6u2abw.fsf@ludovic-brenta.org> <016ff78a-64f9-4a42-a079-e544526e2f8a@googlegroups.com> <87bohi26kl.fsf@ludovic-brenta.org> <0b591914-1915-4c8b-b0d5-ebf188fc2de4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <00367705-1c58-4ae1-9965-c6415feae8c3@googlegroups.com> Subject: Re: Stumped: Seg Fault with System.Secondary_Stack.SS_Mark() From: awdorrin Injection-Date: Fri, 07 Sep 2012 16:18:30 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-09-07T09:18:30-07:00 List-Id: On Friday, September 7, 2012 11:35:42 AM UTC-4, Simon Wright wrote: > > Have you registered these threads with the Ada RTS? See > g-thread.ads. You need to do this before doing anything (such as > accessing the secondary stack) which requires Ada-specific setup in the > TCB or equivalent. I thought I was, but perhaps I'm not doing it correctly. I have all of the Ada code compiled into a library (libsimlib.a) and I initialize the Ada through a generated function: 'simlibinit()' The C code then makes multiple pthread_create() calls to spawn off each thread. The function pointer passed to pthread_create() is a C function that wraps the Ada call. For example: extern e_mainline(); int rtctl_rts() { e_mainline(); return 0; } pthread_create(&tid, attrp, &rtctl_rts, NULL); where 'e_mainline' is exported from the RTCTL package with: pragma EXPORT(Ada, E_MAINLINE, "e_mainline");