All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Freyder <steve@freyder.net>
To: Philippe Gerum <rpm@xenomai.org>,
	"Xenomai@xenomai.org" <Xenomai@xenomai.org>
Subject: Re: [Xenomai] Performance issue with memory allocators
Date: Thu, 14 Jun 2018 11:41:19 -0500	[thread overview]
Message-ID: <5B229AAF.1040505@freyder.net> (raw)
In-Reply-To: <7a1a9208-b1c3-a3fd-a40a-bb42c89669e7@xenomai.org>

On 6/14/2018 10:21 AM, Philippe Gerum wrote:
> On 06/14/2018 03:10 PM, Philippe Gerum wrote:
>> On 06/14/2018 12:53 AM, Steve Freyder wrote:
>>> I rebuilt my program with a 512K stack, same problem with the SEGV.
>>>
>>> Tried something different, without running my application at all, I ran
>>> this script:
>>>
>>> ulimit -c unlimited
>>> smokey --run=memory_pshared --verbose=2 --mem-pool-size=32M --session=foo
>>>
>>> it ran fine, but if I ran it a second time, without waiting for the
>>> first invocation to
>>> finish, then I got the same SEGV that I previously was seeing with my
>>> program and the
>>> traceback looks the same.
>>>
>>> It's as if there's an initialization issue when you're not the creator
>>> of the
>>> pshared heap.
>>>
>>>
>> Yeah, this can't work just yet. Implementation blunder. I'll follow up
>> on this.
>>
> Could you check if the situation gets any better with this change in?
>
> http://git.xenomai.org/xenomai-3.git/commit/?h=next&id=7e3d69ae6c9235289a8984b609ae2400ab950f17
>
> Thanks,
>
Philippe,

This looks pretty similar.  At first I thought my patching didn't fly, 
but I double-checked
my work and although the size of the "smokey" binary didn't change, the 
size of
libcopperplate DID change so the patch is there.

Core was generated by `smokey --run=memory_pshared --verbose=2 
--mem-pool-size=32M --session=foo'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  compare_range_by_size (r=0xfffcb000, l=0x741f38ec) at 
../../../../xenomai-3/lib/copperplate/heapobj-pshared.c:638
638     ../../../../xenomai-3/lib/copperplate/heapobj-pshared.c: No such 
file or directory.
[Current thread is 1 (LWP 800)]
(gdb) bt
#0  compare_range_by_size (r=0xfffcb000, l=0x741f38ec) at 
../../../../xenomai-3/lib/copperplate/heapobj-pshared.c:638
#1  search_range_by_size (avl=avl@entry=0x741f38ec, 
node=node@entry=0x7eca29d4, pdelta=0x7eca29c0,
     pdelta@entry=0x76f418fc <add_free_range+216>, dir=dir@entry=0) at 
../../../../xenomai-3/lib/copperplate/heapobj-pshared.c:640
#2  0x76f418fc in shavl_search_inner (ops=0x76f56630 <size_search_ops>, 
delta=0x76f418fc <add_free_range+216>, n=0x7eca29d4,
     avl=0x741f38ec) at 
../../../../xenomai-3/include/boilerplate/avl-inner.h:285
#3  shavl_search_nearest (ops=0x76f56630 <size_search_ops>, dir=1, 
node=0x7eca29d4, avl=0x741f38ec)
     at ../../../../xenomai-3/include/boilerplate/avl-inner.h:395
#4  shavl_search_ge (ops=0x76f56630 <size_search_ops>, node=0x7eca29d4, 
avl=0x741f38ec)
     at ../../../../xenomai-3/include/boilerplate/avl-inner.h:415
#5  find_suitable_range (size=1536, ext=0x741f38b8) at 
../../../../xenomai-3/lib/copperplate/heapobj-pshared.c:207
#6  reserve_page_range (size=1536, ext=0x741f38b8) at 
../../../../xenomai-3/lib/copperplate/heapobj-pshared.c:219
#7  add_free_range (heap=0x7eca29c0, heap@entry=0x741f3000, 
bsize=1995793968, bsize@entry=1536, log2size=1948200960, log2size@entry=0)
     at ../../../../xenomai-3/lib/copperplate/heapobj-pshared.c:432
#8  0x76f41be4 in sheapmem_alloc (heap=0x741f3000, size=size@entry=1272) 
at ../../../../xenomai-3/lib/copperplate/heapobj-pshared.c:553
#9  0x76f42a44 in xnmalloc (size=size@entry=1272) at 
../../../../xenomai-3/lib/copperplate/heapobj-pshared.c:1197
#10 0x76f3f8f4 in __threadobj_alloc 
(tcb_struct_size=tcb_struct_size@entry=248, 
wait_union_size=wait_union_size@entry=1024,
     thobj_offset=thobj_offset@entry=0) at 
../../../../xenomai-3/lib/copperplate/threadobj.c:1118
#11 0x76f407c0 in main_overlay () at 
../../../../xenomai-3/lib/copperplate/threadobj.c:1787
#12 threadobj_pkg_init (anon_session=anon_session@entry=0) at 
../../../../xenomai-3/lib/copperplate/threadobj.c:1818
#13 0x76f3da3c in copperplate_init () at 
../../../../xenomai-3/lib/copperplate/init.c:225
#14 0x76f1c5ac in __xenomai_init (argcp=0x7eca2bcc, 
argcp@entry=0x7eca2c14, argvp=0x1a7430, argvp@entry=0x7eca2c10,
     me=me@entry=0x76f244e0 "program") at 
../../../../xenomai-3/lib/boilerplate/setup.c:601
#15 0x76f1cd70 in xenomai_init (argcp=0x7eca2c14, 
argcp@entry=0x7eca2c0c, argvp=argvp@entry=0x7eca2c10)
     at ../../../../xenomai-3/lib/boilerplate/setup.c:656
#16 0x000149f0 in call_init (argvp=0x7eca2c10, argcp=0x7eca2c0c) at 
../../../../../xenomai-3/lib/boilerplate/init/bootstrap.c:105
#17 xenomai_bootstrap () at 
../../../../../xenomai-3/lib/boilerplate/init/bootstrap.c:169
#18 0x0002a334 in __libc_csu_init (argc=5, argv=0x7eca2da4, 
envp=0x7eca2dbc) at /usr/src/debug/glibc/2.23-r0/git/csu/elf-init.c:88
#19 0x41408088 in __libc_start_main () from /lib/libc.so.6
#20 0x00014c94 in _start () at ../sysdeps/arm/start.S:124
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)



  reply	other threads:[~2018-06-14 16:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 18:23 [Xenomai] Performance issue with memory allocators Philippe Gerum
2018-05-20 18:15 ` Philippe Gerum
2018-06-08 12:48   ` Philippe Gerum
2018-06-11 20:37     ` Steve Freyder
2018-06-12  6:39       ` Philippe Gerum
2018-06-12 19:15         ` Steve Freyder
2018-06-13  7:06           ` Philippe Gerum
2018-06-13 22:53             ` Steve Freyder
2018-06-14 13:10               ` Philippe Gerum
2018-06-14 15:21                 ` Philippe Gerum
2018-06-14 16:41                   ` Steve Freyder [this message]
2018-06-14 16:52                     ` Philippe Gerum
2018-06-15 17:23                       ` Steve Freyder
2018-06-15 18:26                         ` Philippe Gerum
2018-06-15 19:25                           ` Steve Freyder
2018-06-19 18:44                           ` Steve Freyder

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=5B229AAF.1040505@freyder.net \
    --to=steve@freyder.net \
    --cc=Xenomai@xenomai.org \
    --cc=rpm@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.