<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:"Arial Black";
        panose-1:2 11 10 4 2 1 2 2 2 4;}
@font-face
        {font-family:"Arial Narrow";
        panose-1:2 11 6 6 2 2 2 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin-top:0cm;
        margin-right:0cm;
        margin-bottom:6.0pt;
        margin-left:0cm;
        line-height:110%;
        font-size:10.0pt;
        font-family:"Arial",sans-serif;
        mso-fareast-language:EN-US;}
h1
        {mso-style-priority:12;
        mso-style-link:"Überschrift 1 Zchn";
        margin-top:18.0pt;
        margin-right:0cm;
        margin-bottom:6.0pt;
        margin-left:21.25pt;
        mso-add-space:auto;
        text-indent:-21.25pt;
        line-height:110%;
        page-break-after:avoid;
        mso-list:l3 level1 lfo6;
        font-size:20.0pt;
        font-family:"Arial Narrow",sans-serif;
        color:#009DEC;
        mso-fareast-language:EN-US;
        font-weight:normal;}
h1.CxSpFirst
        {mso-style-priority:12;
        mso-style-link:"Überschrift 1 Zchn";
        mso-style-type:export-only;
        margin-top:18.0pt;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:21.25pt;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        text-indent:-21.25pt;
        line-height:110%;
        page-break-after:avoid;
        mso-list:l3 level1 lfo6;
        font-size:20.0pt;
        font-family:"Arial Narrow",sans-serif;
        color:#009DEC;
        mso-fareast-language:EN-US;
        font-weight:normal;}
h1.CxSpMiddle
        {mso-style-priority:12;
        mso-style-link:"Überschrift 1 Zchn";
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:21.25pt;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        text-indent:-21.25pt;
        line-height:110%;
        page-break-after:avoid;
        mso-list:l3 level1 lfo6;
        font-size:20.0pt;
        font-family:"Arial Narrow",sans-serif;
        color:#009DEC;
        mso-fareast-language:EN-US;
        font-weight:normal;}
h1.CxSpLast
        {mso-style-priority:12;
        mso-style-link:"Überschrift 1 Zchn";
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:6.0pt;
        margin-left:21.25pt;
        mso-add-space:auto;
        text-indent:-21.25pt;
        line-height:110%;
        page-break-after:avoid;
        mso-list:l3 level1 lfo6;
        font-size:20.0pt;
        font-family:"Arial Narrow",sans-serif;
        color:#009DEC;
        mso-fareast-language:EN-US;
        font-weight:normal;}
p.MsoListBullet, li.MsoListBullet, div.MsoListBullet
        {mso-style-priority:17;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:6.0pt;
        margin-left:21.25pt;
        text-indent:-21.25pt;
        line-height:110%;
        mso-list:l2 level1 lfo8;
        font-size:10.0pt;
        font-family:"Arial",sans-serif;
        mso-fareast-language:EN-US;}
p.MsoTitle, li.MsoTitle, div.MsoTitle
        {mso-style-priority:10;
        mso-style-link:"Titel Zchn";
        margin-top:18.0pt;
        margin-right:102.05pt;
        margin-bottom:6.0pt;
        margin-left:0cm;
        mso-add-space:auto;
        line-height:110%;
        font-size:26.0pt;
        font-family:"Arial Narrow",sans-serif;
        color:#009DEC;
        mso-fareast-language:EN-US;}
p.MsoTitleCxSpFirst, li.MsoTitleCxSpFirst, div.MsoTitleCxSpFirst
        {mso-style-priority:10;
        mso-style-link:"Titel Zchn";
        mso-style-type:export-only;
        margin-top:18.0pt;
        margin-right:102.05pt;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        line-height:110%;
        font-size:26.0pt;
        font-family:"Arial Narrow",sans-serif;
        color:#009DEC;
        mso-fareast-language:EN-US;}
p.MsoTitleCxSpMiddle, li.MsoTitleCxSpMiddle, div.MsoTitleCxSpMiddle
        {mso-style-priority:10;
        mso-style-link:"Titel Zchn";
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:102.05pt;
        margin-bottom:0cm;
        margin-left:0cm;
        margin-bottom:.0001pt;
        mso-add-space:auto;
        line-height:110%;
        font-size:26.0pt;
        font-family:"Arial Narrow",sans-serif;
        color:#009DEC;
        mso-fareast-language:EN-US;}
p.MsoTitleCxSpLast, li.MsoTitleCxSpLast, div.MsoTitleCxSpLast
        {mso-style-priority:10;
        mso-style-link:"Titel Zchn";
        mso-style-type:export-only;
        margin-top:0cm;
        margin-right:102.05pt;
        margin-bottom:6.0pt;
        margin-left:0cm;
        mso-add-space:auto;
        line-height:110%;
        font-size:26.0pt;
        font-family:"Arial Narrow",sans-serif;
        color:#009DEC;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#009DEC;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#933973;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:6.0pt;
        margin-left:36.0pt;
        line-height:110%;
        font-size:10.0pt;
        font-family:"Arial",sans-serif;
        mso-fareast-language:EN-US;}
span.berschrift1Zchn
        {mso-style-name:"Überschrift 1 Zchn";
        mso-style-priority:12;
        mso-style-link:"Überschrift 1";
        font-family:"Arial Narrow",sans-serif;
        color:#009DEC;}
span.TitelZchn
        {mso-style-name:"Titel Zchn";
        mso-style-priority:10;
        mso-style-link:Titel;
        font-family:"Arial Narrow",sans-serif;
        color:#009DEC;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.E-MailFormatvorlage23
        {mso-style-type:personal;
        font-family:"Arial",sans-serif;
        color:windowtext;}
span.E-MailFormatvorlage24
        {mso-style-type:personal;
        font-family:"Arial",sans-serif;
        color:#165F9A;}
span.E-MailFormatvorlage25
        {mso-style-type:personal-reply;
        font-family:"Arial",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:-119;
        mso-list-type:simple;
        mso-list-template-ids:-460561208;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:18.0pt;
        mso-level-number-position:left;
        margin-left:18.0pt;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1
        {mso-list-id:424304013;
        mso-list-type:hybrid;
        mso-list-template-ids:-1013431118 -620198656 67567619 67567621 67567617 67567619 67567621 67567617 67567619 67567621;}
@list l1:level1
        {mso-level-start-at:5;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Arial",sans-serif;
        mso-fareast-font-family:Arial;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l2
        {mso-list-id:610864188;
        mso-list-template-ids:-1039730736;}
@list l2:level1
        {mso-level-number-format:bullet;
        mso-level-style-link:Aufzählungszeichen;
        mso-level-text:ı;
        mso-level-tab-stop:21.25pt;
        mso-level-number-position:left;
        margin-left:21.25pt;
        text-indent:-21.25pt;
        mso-ansi-font-size:9.0pt;
        mso-bidi-font-size:9.0pt;
        mso-ascii-font-family:"Arial Black";
        mso-hansi-font-family:"Arial Black";
        mso-bidi-font-family:"Arial Black";}
@list l2:level2
        {mso-level-number-format:bullet;
        mso-level-text:▪;
        mso-level-tab-stop:42.55pt;
        mso-level-number-position:left;
        margin-left:42.5pt;
        text-indent:-21.25pt;
        mso-ansi-font-size:9.0pt;
        mso-bidi-font-size:9.0pt;
        font-family:"Arial",sans-serif;}
@list l2:level3
        {mso-level-number-format:bullet;
        mso-level-text:▪;
        mso-level-tab-stop:63.8pt;
        mso-level-number-position:left;
        margin-left:63.75pt;
        text-indent:-21.25pt;
        mso-ansi-font-size:9.0pt;
        mso-bidi-font-size:9.0pt;
        font-family:"Arial",sans-serif;}
@list l2:level4
        {mso-level-number-format:bullet;
        mso-level-text:▪;
        mso-level-tab-stop:3.0cm;
        mso-level-number-position:left;
        margin-left:85.0pt;
        text-indent:-21.25pt;
        mso-ansi-font-size:9.0pt;
        mso-bidi-font-size:9.0pt;
        font-family:"Arial",sans-serif;}
@list l2:level5
        {mso-level-number-format:bullet;
        mso-level-text:▪;
        mso-level-tab-stop:106.3pt;
        mso-level-number-position:left;
        margin-left:106.25pt;
        text-indent:-21.25pt;
        mso-ansi-font-size:9.0pt;
        font-family:"Arial",sans-serif;}
@list l2:level6
        {mso-level-number-format:bullet;
        mso-level-text:▪;
        mso-level-tab-stop:127.6pt;
        mso-level-number-position:left;
        margin-left:127.5pt;
        text-indent:-21.25pt;
        mso-ansi-font-size:9.0pt;
        mso-bidi-font-size:9.0pt;
        font-family:"Arial",sans-serif;}
@list l2:level7
        {mso-level-number-format:bullet;
        mso-level-text:▪;
        mso-level-tab-stop:148.85pt;
        mso-level-number-position:left;
        margin-left:148.75pt;
        text-indent:-21.25pt;
        mso-ansi-font-size:9.0pt;
        font-family:"Arial",sans-serif;}
@list l2:level8
        {mso-level-number-format:bullet;
        mso-level-text:▪;
        mso-level-tab-stop:6.0cm;
        mso-level-number-position:left;
        margin-left:170.0pt;
        text-indent:-21.25pt;
        mso-ansi-font-size:9.0pt;
        mso-bidi-font-size:9.0pt;
        font-family:"Arial",sans-serif;}
@list l2:level9
        {mso-level-number-format:bullet;
        mso-level-text:▪;
        mso-level-tab-stop:191.35pt;
        mso-level-number-position:left;
        margin-left:191.25pt;
        text-indent:-21.25pt;
        mso-ansi-font-size:9.0pt;
        mso-bidi-font-size:9.0pt;
        mso-ascii-font-family:Arial;
        mso-hansi-font-family:Arial;
        mso-bidi-font-family:Arial;}
@list l3
        {mso-list-id:628360796;
        mso-list-template-ids:-1252723272;}
@list l3:level1
        {mso-level-style-link:"Überschrift 1";
        mso-level-text:%1;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:21.25pt;
        text-indent:-21.25pt;}
@list l3:level2
        {mso-level-text:"%1\.%2";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:29.75pt;
        text-indent:-29.75pt;}
@list l3:level3
        {mso-level-text:"%1\.%2\.%3";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:38.25pt;
        text-indent:-38.25pt;}
@list l3:level4
        {mso-level-text:"%1\.%2\.%3\.%4";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:46.8pt;
        text-indent:-46.8pt;}
@list l3:level5
        {mso-level-text:"%1\.%2\.%3\.%4\.%5";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:55.3pt;
        text-indent:-55.3pt;}
@list l3:level6
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:63.8pt;
        text-indent:-63.8pt;}
@list l3:level7
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:72.3pt;
        text-indent:-72.3pt;}
@list l3:level8
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:80.8pt;
        text-indent:-80.8pt;}
@list l3:level9
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        margin-left:89.3pt;
        text-indent:-89.3pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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="DE" link="#009DEC" vlink="#933973">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;line-height:110%">Hello folks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;line-height:110%">we’re facing the following issue:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;line-height:110%">An application does not receive DBUS signals via the DBUS file descriptor while waiting for a dbus-method response.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;line-height:110%">The basic setup: Two applications are communicating via DBUS, using a
<b>select() loop waiting for events on the</b> <b>dbus-fd</b>.<br>
The faulty procedure:<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l1 level1 lfo10">
<![if !supportLists]><span lang="EN-US" style="font-size:11.0pt;line-height:110%"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">      
</span></span></span><![endif]><span lang="EN-US" style="font-size:11.0pt;line-height:110%;color:#009759">Triggered by a timer event, Application A</span><span lang="EN-US" style="font-size:11.0pt;line-height:110%"> calls the dbus-method “transmit” of
<span style="color:#F6960F">application B</span>.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l1 level1 lfo10">
<![if !supportLists]><span lang="EN-US" style="font-size:11.0pt;line-height:110%"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">      
</span></span></span><![endif]><span lang="EN-US" style="font-size:11.0pt;line-height:110%">During processing of the “transmit”-method,
<span style="color:#F6960F">application B</span> broadcasts a dbus-signal on which
<span style="color:#009759">application A</span> is matched on.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l1 level1 lfo10">
<![if !supportLists]><span lang="EN-US" style="font-size:11.0pt;line-height:110%"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">      
</span></span></span><![endif]><span lang="EN-US" style="font-size:11.0pt;line-height:110%">Afterwards,
<span style="color:#F6960F">application B</span> sleeps for 5ms and then finishes its “transmit”-method by sending a response message towards
<span style="color:#009759">application A.</span><o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l1 level1 lfo10">
<![if !supportLists]><span lang="EN-US" style="font-size:11.0pt;line-height:110%"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">      
</span></span></span><![endif]><span lang="EN-US" style="font-size:11.0pt;line-height:110%">The dbus-fd of
<span style="color:#009759">Application A</span> does not trigger the <b>select() afterwards</b> (same for
<b>epoll() </b>if implemented so).<br>
Though …<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l1 level2 lfo10">
<![if !supportLists]><span lang="EN-US" style="font-size:11.0pt;line-height:110%;font-family:"Courier New""><span style="mso-list:Ignore">o<span style="font:7.0pt "Times New Roman"">  
</span></span></span><![endif]><span lang="EN-US" style="font-size:11.0pt;line-height:110%">… when triggering
<b>sd_bus_process() </b>manually, the signal is being receved in <span style="color:#1F497D">
a</span>pplication A, meaning that the signal was in fact received and queued, but the event was not signalled.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="margin-left:72.0pt;text-indent:-18.0pt;mso-list:l1 level2 lfo10">
<![if !supportLists]><span lang="EN-US" style="font-size:11.0pt;line-height:110%;font-family:"Courier New""><span style="mso-list:Ignore">o<span style="font:7.0pt "Times New Roman"">  
</span></span></span><![endif]><span lang="EN-US" style="font-size:11.0pt;line-height:110%">… other processes, not being “blocked” by waiting for a response-message, do also receive the signal.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;line-height:110%"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;line-height:110%">We saw this behavior on multiple platforms, e.g. Linux kubuntu 4.4.0-137-generic with 229-4ubuntu21.1 and Debian Buster 4.18.0-2-am64 with systemd 239-10.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;line-height:110%">Attached you can find a simple example, including application
<span style="color:#009759">A</span> / <span style="color:#F6960F">B</span>, a makefile and the correlating *.conf-files.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;line-height:110%"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;line-height:110%">Thanks in advance<span style="color:#1F497D"> and
</span>best regards, <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;line-height:110%">Jan Mueller<span style="color:#1F497D"><o:p></o:p></span></span></p>
</div>
</body>
</html>