Skip to contentSkip to conversation

tcb alloc fail in main_overlay

Xenomai Steve Freyder 2 participants 2 messages Jul 30, 2018 – Aug 2, 2018

lore
Share & tools
lore
#0 lore raw

With 3.0.7, it seems that I'm still doing something bad to the pshared heap. I haven't gotten to a trimmed-down test case yet, but I'm seeing this:

0"033.613| BUG in main_overlay(): [main] failed to allocate main tcb

Is there any kind of pshared heap analyzer I can use to check for corruption?

I don't see any status display that shows utilization for
the pshared heap (like /proc/xenomai/heap does for other kinds of heaps), is there some debug I need to enable?

Best regards,
Steve

#1 lore raw
Quoted 6 lines · Steve Freyder

With 3.0.7, it seems that I'm still doing something bad to the pshared heap.  I haven't gotten to a trimmed-down test case yet, but I'm seeing this:

   0"033.613| BUG in main_overlay(): [main] failed to allocate main tcb

You may want to use gdb to debug this, setting a breakpoint in the overlay routine where the assertion trips. The first hit is ok, this should be the main() context creating its own tcb. Any subsequent call of the overlay routine for the same process would be wrong. Dumping the stack backtrace at this point should point at the offender.

Quoted 3 lines

Is there any kind of pshared heap analyzer I can use to check for corruption?

Nope. But you may want to build with --enable-debug=full to enable all internal checks (caution: this may slow execution significantly).

Quoted 4 lines

I don't see any status display that shows utilization for
the pshared heap (like /proc/xenomai/heap does for other kinds of heaps), is there some debug I need to enable?

/proc exports the status of kernel objects created by Cobalt, the shared heap is merely a userland beast in this respect. AFAIR, the fuse-based registry should expose this information for your process.

Signature · 1 line
Philippe.