RES: Problem with simple 'new' operator when using RTEMS 4.11 for the SIS BSP

Fabrício de Novaes Kucinskis fabricio at
Mon Jul 28 18:43:24 UTC 2014

Hello Sebastian, and thanks for your answer. 
The following example is enough to illustrate the problem I'm facing:
rtems_task Init(rtems_task_argument argument)
    int *var = new int[10];
    var[0] = 2;
    printk("testing... %i", var[0]);
If 'var' is allocated on the stack ("int var[10]"), the program runs ok.
When using the 'new' operator (and hence using the heap), the execution
doesn't achieve the Init task, stopping at some instruction inside
_Thread_Start_multitasking() – that’s what I vaguely called ‘crash’ before,
sorry for that.
This happens when linking with RTEMS 4.11 for the SIS BSP. Using RTEMS 4.10
for the same BSP, this problem doesn't occur.
I have two suspicions: 
        1) [more likely] Some problem with my compiling environment that I
could not trace yet, or
        2) Some change on the heap setup for the SPARC BSP between the
release 4.10 and the current head of the git repository. I noticed some
change on this aspect with the addition of a 'bsp_early_malloc' function
that didn't exist on 4.10, but I don't think an error like this wouldn't be
noticed previously.
Thanks again and best regards,
On 07/25/2014 09:49 PM, Fabrício de Novaes Kucinskis wrote:
> Hi all,
> I’ve recently installed RTEMS 4.11 from the git head and am facing a
> problem: whenever I use the ‘new’ operator for a C++ application, the
> application crashes.
What do you mean with crash?
> If, for instance, I have a printk instruction some lines before calling
> ‘new’ (as “int *a = new int[10];”), there is no output. It seems that the
> addition of ‘new’ is forcing the link to some C++ library that is not ok
> working well.
I would follow the printk() call and figure out why there is no output.
> I’m using the SIS BSP, and this example works fine with RTEMS 4.10 (note:
> RTEMS 4.10 and 4.11 are installed in different computers).
> I’m feeling dumb right now for not having any idea about what is going on.
> Any tips?
It helps if you provide a self contained example that reproduces the 
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  :  <> sebastian.huber
PGP     : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.


Este email está limpo de vírus e malwares porque a proteção do avast! Antivírus está ativa.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list