<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Le 14 mars 09 à 10:14, Russell Bryant a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Mar 13, 2009, at 6:13 PM, Vadim Lebedev wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">Le 11 mars 09 à 02:01, Russell Bryant a écrit :<br></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">This is a known issue. It appears to be a bug with poll() / select()<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">on OSX. See the following bug report for details:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="http://bugs.digium.com/view.php?id=13404">http://bugs.digium.com/view.php?id=13404</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I did some more debugging and see extremely strange stuff:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">main/poll.c is built and linked with the application,<br></blockquote><blockquote type="cite">but when asterisk calls poll it goes straight to the original <br></blockquote><blockquote type="cite">syscall...<br></blockquote><br>How did you go about determining that this was happening? Did you add <br>some logging into the internal poll() or something? It seems quite <br>strange that it would behave this way, indeed!<br><br></div></blockquote><div><br></div><div><br></div><div><br></div><div>Well, first of all i've tried set a breakpoint at poll.</div><div>The breakpoint was installde but NEVER hit.</div><div><br></div><div>So i've did following:</div><div><div>(gdb) disass</div><div>Dump of assembler code for function ast_el_read_char:</div><div>0x0001a43c <ast_el_read_char+0>:<span class="Apple-tab-span" style="white-space:pre">        </span>push %ebp</div><div>0x0001a43d <ast_el_read_char+1>:<span class="Apple-tab-span" style="white-space:pre">        </span>mov %esp,%ebp</div><div>0x0001a43f <ast_el_read_char+3>:<span class="Apple-tab-span" style="white-space:pre">        </span>push %edi</div><div>0x0001a440 <ast_el_read_char+4>:<span class="Apple-tab-span" style="white-space:pre">        </span>push %esi</div><div>0x0001a441 <ast_el_read_char+5>:<span class="Apple-tab-span" style="white-space:pre">        </span>push %ebx</div><div>0x0001a442 <ast_el_read_char+6>:<span class="Apple-tab-span" style="white-space:pre">        </span>sub $0x23c,%esp</div><div>0x0001a448 <ast_el_read_char+12>:<span class="Apple-tab-span" style="white-space:pre">        </span>call 0x1a44d <ast_el_read_char+17></div><div>0x0001a44d <ast_el_read_char+17>:<span class="Apple-tab-span" style="white-space:pre">        </span>pop %ebx</div><div>0x0001a44e <ast_el_read_char+18>:<span class="Apple-tab-span" style="white-space:pre">        </span>movl $0x0,-0x230(%ebp)</div><div>0x0001a458 <ast_el_read_char+28>:<span class="Apple-tab-span" style="white-space:pre">        </span>mov 0x11b10f(%ebx),%edx</div><div>0x0001a45e <ast_el_read_char+34>:<span class="Apple-tab-span" style="white-space:pre">        </span>lea -0x28(%ebp),%eax</div><div>0x0001a461 <ast_el_read_char+37>:<span class="Apple-tab-span" style="white-space:pre">        </span>mov %eax,-0x238(%ebp)</div><div>0x0001a467 <ast_el_read_char+43>:<span class="Apple-tab-span" style="white-space:pre">        </span>lea -0x228(%ebp),%eax</div><div>0x0001a46d <ast_el_read_char+49>:<span class="Apple-tab-span" style="white-space:pre">        </span>mov %eax,-0x23c(%ebp)</div><div>0x0001a473 <ast_el_read_char+55>:<span class="Apple-tab-span" style="white-space:pre">        </span>nop </div><div>0x0001a474 <ast_el_read_char+56>:<span class="Apple-tab-span" style="white-space:pre">        </span>mov 0x11c53b(%ebx),%eax</div><div>0x0001a47a <ast_el_read_char+62>:<span class="Apple-tab-span" style="white-space:pre">        </span>mov %eax,-0x28(%ebp)</div><div>0x0001a47d <ast_el_read_char+65>:<span class="Apple-tab-span" style="white-space:pre">        </span>movw $0x1,-0x24(%ebp)</div><div>0x0001a483 <ast_el_read_char+71>:<span class="Apple-tab-span" style="white-space:pre">        </span>test %dl,%dl</div><div>0x0001a485 <ast_el_read_char+73>:<span class="Apple-tab-span" style="white-space:pre">        </span>jns 0x1a5cc <ast_el_read_char+400></div><div>0x0001a48b <ast_el_read_char+79>:<span class="Apple-tab-span" style="white-space:pre">        </span>mov $0x1,%eax</div><div>0x0001a490 <ast_el_read_char+84>:<span class="Apple-tab-span" style="white-space:pre">        </span>push %esi</div><div>0x0001a491 <ast_el_read_char+85>:<span class="Apple-tab-span" style="white-space:pre">        </span>push $0xffffffff</div><div>0x0001a493 <ast_el_read_char+87>:<span class="Apple-tab-span" style="white-space:pre">        </span>push %eax</div><div>0x0001a494 <ast_el_read_char+88>:<span class="Apple-tab-span" style="white-space:pre">        </span>pushl -0x238(%ebp)</div><div><b><font class="Apple-style-span" color="#FF2822">0x0001a49a <ast_el_read_char+94>:</font></b><span class="Apple-tab-span" style="white-space:pre"><b><font class="Apple-style-span" color="#FF2822">        </font></b></span><b><font class="Apple-style-span" color="#FF2822">call 0x15452b <dyld_stub_poll$UNIX2003></font></b></div><div>0x0001a49f <ast_el_read_char+99>:<span class="Apple-tab-span" style="white-space:pre">        </span>add $0x10,%esp</div><div>0x0001a4a2 <ast_el_read_char+102>:<span class="Apple-tab-span" style="white-space:pre">        </span>test %eax,%eax</div><div>0x0001a4a4 <ast_el_read_char+104>:<span class="Apple-tab-span" style="white-space:pre">        </span>js 0x1a5f8 <ast_el_read_char+444></div><div>0x0001a4aa <ast_el_read_char+110>:<span class="Apple-tab-span" style="white-space:pre">        </span>mov 0x11b10f(%ebx),%edx</div><div>0x0001a4b0 <ast_el_read_char+116>:<span class="Apple-tab-span" style="white-space:pre">        </span>test %dl,%dl</div><div>0x0001a4b2 <ast_el_read_char+118>:<span class="Apple-tab-span" style="white-space:pre">        </span>js 0x1a4bf <ast_el_read_char+131></div><div>0x0001a4b4 <ast_el_read_char+120>:<span class="Apple-tab-span" style="white-space:pre">        </span>cmpw $0x0,-0x1a(%ebp)</div><div>0x0001a4b9 <ast_el_read_char+125>:<span class="Apple-tab-span" style="white-space:pre">        </span>jne 0x1a7e0 <ast_el_read_char+932></div><div>0x0001a4bf <ast_el_read_char+131>:<span class="Apple-tab-span" style="white-space:pre">        </span>cmpw $0x0,-0x22(%ebp)</div><div>0x0001a4c4 <ast_el_read_char+136>:<span class="Apple-tab-span" style="white-space:pre">        </span>je 0x1a474 <ast_el_read_char+56></div><div>0x0001a4c6 <ast_el_read_char+138>:<span class="Apple-tab-span" style="white-space:pre">        </span>push %esi</div><div>0x0001a4c7 <ast_el_read_char+139>:<span class="Apple-tab-span" style="white-space:pre">        </span>push $0x1ff</div><div>0x0001a4cc <ast_el_read_char+144>:<span class="Apple-tab-span" style="white-space:pre">        </span>pushl -0x23c(%ebp)</div><div>0x000</div></div><div><br></div><div><br></div><div>Thanks</div><div>Vadim</div><br><blockquote type="cite"><div><blockquote type="cite">I think what needs to be done is following:<br></blockquote><blockquote type="cite">1) replace all calls to poll( by AST_POLL<br></blockquote><blockquote type="cite">2) on non Darwin platform AST_POLL will be defined as poll on darwin<br></blockquote><blockquote type="cite">as ast_internal_poll<br></blockquote><blockquote type="cite">3) rename poll in asterisk/poll.c as ast_internal_poll<br></blockquote><br>--<br>Russell Bryant<br>Digium, Inc. | Senior Software Engineer, Open Source Team Lead<br>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>Check us out at: <a href="http://www.digium.com">www.digium.com</a> & <a href="http://www.asterisk.org">www.asterisk.org</a><br><br><br><br><br><br>_______________________________________________<br>--Bandwidth and Colocation Provided by <a href="http://www.api-digital.com">http://www.api-digital.com</a>--<br><br>asterisk-dev mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br><br></div></blockquote></div><br></body></html>