All of lore.kernel.org
 help / color / mirror / Atom feed
From: "dreamtale90@163.com" <dreamtale90@163.com>
To: Philippe Gerum <rpm@xenomai.org>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Fw:some API about RT_TASK occur Segmentation fault
Date: Tue, 7 Feb 2017 14:18:32 +0800 (CST)	[thread overview]
Message-ID: <49057f87.58a5.15a17393fcd.Coremail.dreamtale90@163.com> (raw)
In-Reply-To: <681ccdf8-5b7f-e9e2-2047-d789b6e0d10c@xenomai.org>

Thank you for help.
I had git clone git://git.xenomai.org/xenomai-3.git, compile and install it with:
    ./scripts/bootstrap
    ../xenomai-3/configure --with-core=mercury  --enable-smp --enable-pshared --enable-debug=full

    make install
Then run my demo, but the result is the same as before :
----------------------------------------------------------------------------------------------------------
   0"002.570| WARNING: [main] Xenomai compiled with full debug enabled,
                              very high latencies expected [--enable-debug=full]
enter func ...
enter func ...
rt_task_create: ../../../xenomai-3/lib/copperplate/heapobj-pshared.c:452: alloc_block: Assertion `0' failed.
Aborted
----------------------------------------------------------------------------------------------------------
Yesterday, I add some printf to alloc_block() of heapobj-pshared.c. I found  that segmentaion fault occur when run to the
line 455 "++extent->pagemap[pgnum].bcount;" . At this time the value of "heap->buckets[ilog].freelist" is very big.


Now I think whether my xenomai configuration or system environment have something wrong.
Besides, my system(x86_64bit) run in a 8 cores Oracle virtual machine, the host cpu is Inter(R) xeon(R) CPU E5-2630 v4 @ 2.20GHz.
I don't know whether these information is useful.

Thanks in advance, best regards.





At 2017-02-06 21:50:13, "Philippe Gerum" <rpm@xenomai.org> wrote:
>On 02/06/2017 02:30 AM, dreamtale90@163.com wrote:
>> System configuration:
>> debian-8.6, 3.18.46-rt50
>> Xenomai/mercury v3.0.3
>> Build args: --with-core=mercury --enable-smp --enable-pshared
>> 
>> Now I am need help. Thanks.
>> 
>> 
>> -------- Forwarding messages --------
>> From: "dreamtale90@163.com" <dreamtale90@163.com>
>> Date: 2017-02-04 12:04:15
>> To: xenomai@xenomai.org
>> Subject: some API about RT_TASK occur Segmentation fault
>> Hi
>>     During using API about RT_TASK I found some doubt.
>> 1) rt_task_inquire(RT_TASK * task, RT_TASK_INFO * info ), if info is
>> NULL will occur Segmentation fault, but in API reference this is valid.
>> http://www.xenomai.org/documentation/xenomai-3/html/xeno3prm/group__alchemy__task.html#ga53bad6acf5496f8008e594954507dce8
>> 
>> 2) After main task called rt_task_shadow(), program will create other
>> tasks depend on request, but when create second task will  occur
>> Segmentation fault.
>> Now main task don't call  rt_task_shadow(), program will OK. I don't
>> know why.
>> 
>> 3) I write a demo which create the same task three times as follows:
>> #include <stdio.h>
>> #include <unistd.h>
>> #include <alchemy/task.h>
>> RT_TASK task1;
>> void func(void *arg)
>> {
>>  printf("enter func ...\n");
>> }
>> int main()
>> {
>>  rt_task_spawn(&task1, "task1", 0, 80, 0, func, NULL);
>>  sleep(1);
>>  rt_task_spawn(&task1, "task1", 0, 80, 0, func, NULL);
>>  sleep(1);
>>  rt_task_spawn(&task1, "task1", 0, 80, 0, func, NULL);
>>  //rt_task_delete(&task1);
>>  return 0;
>> }
>> 
>> When the third time create , program will  occur Segmentation fault.
>> 
>
>This bug was fixed in the stable branch some time ago:
>git://git.xenomai.org/xenomai-3.git, branch stable-3.0.x
>
>-- 
>Philippe.

  reply	other threads:[~2017-02-07  6:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06  1:30 [Xenomai] Fw:some API about RT_TASK occur Segmentation fault dreamtale90
2017-02-06 13:50 ` Philippe Gerum
2017-02-07  6:18   ` dreamtale90 [this message]
2017-02-07 14:19     ` [Xenomai] some " dreamtale90
2017-02-07 15:17       ` Philippe Gerum
2017-02-08  2:03         ` dreamtale90

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=49057f87.58a5.15a17393fcd.Coremail.dreamtale90@163.com \
    --to=dreamtale90@163.com \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /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.