<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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="2050" />
</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="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoPlainText">Kornilios,<o:p></o:p></p>
<p class="MsoPlainText">&nbsp;&nbsp; I believe that I have found a bug in the nameserver. The problem appears to be in the use of the nameserver functions in multiple threads running on a single core. In this case the nameserver functions are non-reentrant. To illustrate
 this I took your message example (xmpl-msg) and wrapped both the client and server functions in separate threads and ran the application on a single core. The same assertion fired as illustrated below:<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText"><img width="723" height="163" id="Picture_x0020_1" src="cid:image001.png@01CF0D2F.B983CB80"><o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">The nameservice blocking lookup is invoked by the client application near the beginning to get the iref. The server then tries to register the iref in the nameserver and gets the assertion.<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">In general for the nameserver to be useful, it needs to be accessible by any number of threads running on any number of cores in a concurrent manner.<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">Thanks,<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">Mark Brown<o:p></o:p></p>
<p class="MsoPlainText">Huawei Technologies Inc.<o:p></o:p></p>
<p class="MsoPlainText">5340 Legacy Dr., Suite 175<o:p></o:p></p>
<p class="MsoPlainText">Plano, TX 75024<o:p></o:p></p>
<p class="MsoPlainText">Tel: 469-277-5700 x5870<o:p></o:p></p>
<p class="MsoPlainText">Email: m.brown@huawei.com<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">-----Original Message-----<br>
From: Kornilios Kourtis [mailto:kornilios.kourtis@inf.ethz.ch] <br>
Sent: Thursday, December 19, 2013 6:33 AM<br>
To: M Brown<br>
Cc: barrelfish-users@lists.inf.ethz.ch<br>
Subject: Re: [Barrelfish-users] Assertion fired when calling &quot;nameserver_register&quot; function<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">Dear Mark,<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">On Mon, Dec 16, 2013 at 05:38:37PM &#43;0000, M Brown wrote:<o:p></o:p></p>
<p class="MsoPlainText">&gt; Guys,<o:p></o:p></p>
<p class="MsoPlainText">&gt; <o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp; I’m getting the following assertion fired when calling the<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp; nameserver_register function from within an export callback<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp; function:<o:p></o:p></p>
<p class="MsoPlainText">&gt; <o:p></o:p></p>
<p class="MsoPlainText">&gt; [cid]<o:p></o:p></p>
<p class="MsoPlainText">&gt; <o:p></o:p></p>
<p class="MsoPlainText">&gt; The example message test works fine. The structure of the code I have
<o:p></o:p></p>
<p class="MsoPlainText">&gt; is as follows:<o:p></o:p></p>
<p class="MsoPlainText">&gt; <o:p></o:p></p>
<p class="MsoPlainText">&gt; main {<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; thread_create(myTask, NULL);<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<o:p></o:p></p>
<p class="MsoPlainText">&gt; }<o:p></o:p></p>
<p class="MsoPlainText">&gt; <o:p></o:p></p>
<p class="MsoPlainText">&gt; int myTask(void* arg) {<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;iface&gt;_export(NULL,<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export_cb, connect_cb,<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; get_default_waitset(),<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IDC_EXPORT_FLAGS_DEFAULT);<o:p></o:p></p>
<p class="MsoPlainText">&gt; <o:p></o:p></p>
<p class="MsoPlainText">&gt; }<o:p></o:p></p>
<p class="MsoPlainText">&gt; <o:p></o:p></p>
<p class="MsoPlainText">&gt; void export_cb(void *st, errval_t err, iref_t iref) {<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The assertion fires within this invocation<o:p></o:p></p>
<p class="MsoPlainText">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nameserver_register(“iface”, iref); }<o:p></o:p></p>
<p class="MsoPlainText">&gt; <o:p></o:p></p>
<p class="MsoPlainText">&gt; Is there something I’m doing wrong here?<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">[I'm guessing you mean nameservice_register() above]<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">Judging from the failed assertion (!_rpc-&gt;rpc_in_progress), I'm guessing that it might have something to do with using multiple threads. What are the other threads doing? Can you reproduce the problem when using a single thread?<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">cheers,<o:p></o:p></p>
<p class="MsoPlainText">Kornilios.<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">--<o:p></o:p></p>
<p class="MsoPlainText">Kornilios Kourtis<o:p></o:p></p>
<p class="MsoPlainText"><o:p>&nbsp;</o:p></p>
<p class="MsoPlainText">_______________________________________________<o:p></o:p></p>
<p class="MsoPlainText">Barrelfish-users mailing list<o:p></o:p></p>
<p class="MsoPlainText"><a href="mailto:Barrelfish-users@lists.inf.ethz.ch"><span style="color:windowtext;text-decoration:none">Barrelfish-users@lists.inf.ethz.ch</span></a><o:p></o:p></p>
<p class="MsoPlainText"><a href="https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users"><span style="color:windowtext;text-decoration:none">https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users</span></a><o:p></o:p></p>
</div>
</body>
</html>