<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<!-- Template generated by Exclaimer Mail Disclaimers on 08:42:32 donderdag, 4 mei 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">P.ImprintUniqueID {
        MARGIN: 0cm 0cm 0pt
}
LI.ImprintUniqueID {
        MARGIN: 0cm 0cm 0pt
}
DIV.ImprintUniqueID {
        MARGIN: 0cm 0cm 0pt
}
TABLE.ImprintUniqueIDTable {
        MARGIN: 0cm 0cm 0pt
}
DIV.Section1 {
        page: Section1
}
</style>
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="NL" link="blue" vlink="purple">
<p class="ImprintUniqueID"></p>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">We are configuring maximum 64 file descriptors at the moment:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_APPLICATION_EXTRA_DRIVERS DYPLO_DRIVER_TABLE_ENTRY<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_MAXIMUM_DRIVERS 10<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_EXECUTIVE_RAM_SIZE    (128*1024*1024)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_STACK_SPACE_SIZE      (10*1024*1024)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_UNLIMITED_OBJECTS<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_INIT_TASK_STACK_SIZE  (1024*1024)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_INTERRUPT_STACK_SIZE                (32*1024)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_MINIMUM_TASK_STACK_SIZE (32*1024)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_MAXIMUM_TASKS                               3<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_MAXIMUM_SEMAPHORES           64<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_RTEMS_INIT_TASKS_TABLE<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_MICROSECONDS_PER_TICK 1000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 64<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#include <rtems/confdefs.h><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_SHELL_COMMANDS_INIT<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#define CONFIGURE_SHELL_COMMANDS_ALL<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">#include <rtems/shellconfig.h><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></a></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> users [mailto:users-bounces@rtems.org]
<b>On Behalf Of </b>Joel Sherrill<br>
<b>Sent:</b> woensdag 3 mei 2017 22:42<br>
<b>To:</b> Sebastian Huber<br>
<b>Cc:</b> rtems-users@rtems.org<br>
<b>Subject:</b> Re: C++ iostream only working in Init, not in other RTEMS Tasks<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, May 3, 2017 at 12:46 AM, Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">On 03/05/17 07:15, Sebastian Huber wrote:<o:p></o:p></p>
<p class="MsoNormal">On 03/05/17 00:47, Chris Johns wrote:<o:p></o:p></p>
<p class="MsoNormal">On 2/5/17 6:03 pm, Sebastian Huber wrote:<o:p></o:p></p>
<p class="MsoNormal">On 02/05/17 09:35, Chris Coppens wrote:<o:p></o:p></p>
<p class="MsoNormal">Hello,<br>
<br>
In our RTEMS application C++ iostream (e.g. "cout") is only working in<br>
the “Init” function?<br>
If I use “cout” in a RTEMS Task other than Init, no output is shown in<br>
the console.<br>
Any idea why this is happening?<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">The C++ library uses thread-local standard IO streams (Newlib feature)<br>
for the global IO stream objects. I am not sure how to fix this<br>
properly, but I guess a RTEMS-specific change in the libstdc++ would be<br>
necessary.<o:p></o:p></p>
<p class="MsoNormal">Does a ticket exist for this? This should be fixed for 4.12.0 so please<br>
set the milestone to 4.12.0 and blocker.<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
I don't know if a ticket exists. This issue exits in all RTEMS versions with C++ support. Since the initialization thread is restarted after the C++ global constructor calls this issue is more obvious now.<br>
<br>
Before you make this a release blocker, then please find someone who can fix this.<o:p></o:p></p>
<p class="MsoNormal"><br>
Just for reference. The std::cout etc. is initialized here<br>
<br>
<a href="https://gcc.gnu.org/viewcvs/gcc/trunk/libstdc%2B%2B-v3/src/c%2B%2B98/ios_init.cc?view=markup#l85" target="_blank">https://gcc.gnu.org/viewcvs/gcc/trunk/libstdc%2B%2B-v3/src/c%2B%2B98/ios_init.cc?view=markup#l85</a><br>
<br>
via a placement new. The "stdout" etc. is thread-local in Newlib. Using this for a global object like std::cout is quite broken.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Is there a test program to demonstrate that this is broken?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Since Cygwin also uses newlib, I have trouble believing this would<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">not also be broken there.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Going back to the original post. How many file descriptors are configured?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I am suspicious that the way C++ does it might require more file descriptors.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">--joel<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><br>
<br>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone   : <a href="tel:%2B49%2089%20189%2047%2041-16" target="_blank">+49 89 189 47 41-16</a><br>
Fax     : <a href="tel:%2B49%2089%20189%2047%2041-09" target="_blank">+49 89 189 47 41-09</a><br>
E-Mail  : <a href="mailto:sebastian.huber@embedded-brains.de" target="_blank">sebastian.huber@embedded-brains.de</a><br>
PGP     : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
<br>
</p>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
<p></p>
<p class="ImprintUniqueID"><font face="Calibri Light"></font> </p>
<p class="ImprintUniqueID"><font face="Calibri Light">Kind regards,</font></p>
<p class="ImprintUniqueID"><font face="Calibri Light"></font> </p>
<p class="ImprintUniqueID"><font style="font-family:Calibri Light;font-size:12pt;font-weight:bold;">Chris Coppens</font></p>
<p class="ImprintUniqueID"><font style="font-family:Calibri Light;font-size:12pt;">Software Designer</font></p>
<p class="ImprintUniqueID"><font face="Calibri Light"></font> </p>
<p class="ImprintUniqueID"><font face="Calibri Light"></font></p>
<p class="ImprintUniqueID"><font face="Calibri Light"></font></p>
<p class="ImprintUniqueID"><img width="375" height="74" style="border: 0px Solid ; " src="cid:image140503.PNG@2bf96124.46b8295e"><br>
<br>
</p>
<p class="ImprintUniqueID">
<table class="ImprintUniqueIDTable" style="HEIGHT: 72px; BORDER-COLLAPSE: collapse; WIDTH: 475px" cellspacing="0" cols="3" cellpadding="0" border="0">
<tbody>
<tr>
<td style="WIDTH: 205px">
<p class="ImprintUniqueID"><font size="1" face="Calibri Light"><strong>TOPIC Products</strong></font></p>
</td>
<td style="WIDTH: 6px">
<p class="ImprintUniqueID"><font size="1" face="Calibri Light"></font> </p>
</td>
<td style="WIDTH: 256px">
<p class="ImprintUniqueID"><font size="1" face="Calibri Light"></font> </p>
</td>
</tr>
<tr>
<td>
<p class="ImprintUniqueID"><font size="1" face="Calibri Light">Materiaalweg 4</font></p>
</td>
<td style="WIDTH: 29px">
<p class="ImprintUniqueID"><font size="1" face="Calibri Light"></font> </p>
</td>
<td>
<p class="ImprintUniqueID"><font size="1" face="Calibri Light"></font> </p>
</td>
</tr>
<tr>
<td>
<p class="ImprintUniqueID"><font size="1" face="Calibri Light">5681 RJ Best</font></p>
</td>
<td>
<p class="ImprintUniqueID"><font size="1" face="Calibri Light">T:</font></p>
</td>
<td>
<p class="ImprintUniqueID"><font size="1" face="Calibri Light">+31 (0) 499 33 69 69</font></p>
</td>
</tr>
<tr>
<td style="HEIGHT: 14px">
<p class="ImprintUniqueID"><font size="1" face="Calibri Light">Postbus 440</font></p>
</td>
<td>
<p class="ImprintUniqueID"><font size="1" face="Calibri Light">E:</font></p>
</td>
<td>
<p class="ImprintUniqueID"><font style="font-family:Calibri Light;font-size:8pt;">Chris.Coppens@TopicProducts.com</font></p>
</td>
</tr>
<tr>
<td>
<p class="ImprintUniqueID"><font size="1" face="Calibri Light">5680 AK Best</font></p>
</td>
<td>
<p class="ImprintUniqueID"><font size="1" face="Calibri Light">W:</font></p>
</td>
<td>
<p class="ImprintUniqueID"><font size="1" face="Calibri Light"><a href="http://www.topicproducts.com">www.topicproducts.com</a></font></p>
</td>
</tr>
<tr>
<td><font size="1" face="Calibri Light">The Netherlands</font></td>
<td><font size="1" face="Calibri Light"></font></td>
<td><font size="1" face="Calibri Light"></font></td>
<td><font size="1" face="Calibri Light"></font></td>
</tr>
</tbody>
</table>
</p>
<p class="ImprintUniqueID"><a href="https://www.facebook.com/TopicProducts"><font size="1" face="Calibri Light"><img id="IMG1" border="0" src="cid:imagef17685.JPG@0cd661b5.4692de6b" width="20" height="19">
</font></a><a href="https://twitter.com/TopicProducts"><font size="1" face="Calibri Light"><img id="IMG1" border="0" src="cid:image142cc7.JPG@4f054b35.4aa92564" width="20" height="19"></font></a><a href="https://www.linkedin.com/company/topic-embedded-products"><font size="1" face="Calibri Light"><img id="IMG1" border="0" src="cid:image0b71b0.JPG@780a0bf3.4a9dec55" width="20" height="18"></font></a><br>
<font color="green" size="1" face="Calibri Light">Please consider the environment before printing this e-mail</font><br>
<br>
<a href=""><font style="font-family:Arial;font-size:8pt;"></font></a><br>
<br>
</p>
<p class="ImprintUniqueID"></p>
<div class="WordSection1">
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/users" target="_blank">http://lists.rtems.org/mailman/listinfo/users</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
<p></p>
<p><font face="Calibri Light"></font></p>
<p><font face="Calibri Light"></font></p>
</body>
</html>