Angus,<br><br>I make some test program (based on the code coreipcc.c) and i now i sure that are problems with the mmap systems call on sparc.. <br><br>Source code of my test program:<br><br>#include &lt;stdlib.h&gt;<br>#include &lt;sys/mman.h&gt;<br>
#include &lt;stdio.h&gt;<br><br>#define PATH_MAX  36<br><br>int main()    <br>{<br><br>int32_t fd;<br>void *addr_orig;<br>void *addr;<br>char path[PATH_MAX];<br>const char *file = &quot;teste123XXXXXX&quot;;<br>size_t bytes=10024;<br>
<br>snprintf (path, PATH_MAX, &quot;/dev/shm/%s&quot;, file);<br>printf(&quot;PATH=%s\n&quot;,path);<br><br>fd = mkstemp (path);<br>printf(&quot;fd=%d \n&quot;,fd);<br><br><br>addr_orig = mmap (NULL, bytes, PROT_NONE,<br>
              MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);<br><br><br>addr = mmap (addr_orig, bytes, PROT_READ | PROT_WRITE,<br>              MAP_FIXED | MAP_SHARED, fd, 0);<br><br>printf(&quot;ADDR_ORIG:%p  ADDR:%p\n&quot;,addr_orig,addr); <br>
<br><br>  if (addr != addr_orig) {<br>               printf(&quot;Erro&quot;); <br>        }<br>}<br><br>Results on x86: <br>PATH=/dev/shm/teste123XXXXXX<br>fd=3 <br>ADDR_ORIG:0x7f867d8e6000  ADDR:0x7f867d8e6000<br><br>Results on sparc:<br>
PATH=/dev/shm/teste123XXXXXX<br>fd=3 <br>ADDR_ORIG:0xf7f72000  ADDR:0xffffffff<br><br><br>But im wondering if is really needed to call mmap 2 times ?  What are the reason to call the mmap 2 times, on the second time using the address of the first?<br>
<br><br><br><br><br><br><div class="gmail_quote">2011/5/31 Angus Salkeld <span dir="ltr">&lt;<a href="mailto:asalkeld@redhat.com">asalkeld@redhat.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Tue, May 31, 2011 at 06:25:56PM -0300, william felipe_welter wrote:<br>
&gt; Thanks Steven,<br>
&gt;<br>
&gt; Now im try to run on the MCP:<br>
&gt; - Uninstall the pacemaker 1.0<br>
&gt; - Compile and install 1.1<br>
&gt;<br>
&gt; But now i have problems to initialize the pacemakerd: Could not initialize<br>
&gt; Cluster Configuration Database API instance error 2<br>
&gt; Debbuging with gdb i see that the error are on the confdb.. most specificaly<br>
&gt; the errors start on coreipcc.c  at line:<br>
&gt;<br>
&gt;<br>
&gt; 448        if (addr != addr_orig) {<br>
&gt; 449                goto error_close_unlink;  &lt;- enter here<br>
&gt; 450       }<br>
&gt;<br>
&gt; Some ideia about  what can cause this  ?<br>
&gt;<br>
<br>
</div>I tried porting a ringbuffer (<a href="http://www.libqb.org" target="_blank">www.libqb.org</a>) to sparc and had the same failure.<br>
There are 3 mmap() calls and on sparc the third one keeps failing.<br>
<br>
This is a common way of creating a ring buffer, see:<br>
<a href="http://en.wikipedia.org/wiki/Circular_buffer#Exemplary_POSIX_Implementation" target="_blank">http://en.wikipedia.org/wiki/Circular_buffer#Exemplary_POSIX_Implementation</a><br>
<br>
I couldn&#39;t get it working in the short time I tried. It&#39;s probably<br>
worth looking at the clib implementation to see why it&#39;s failing<br>
(I didn&#39;t get to that).<br>
<br>
-Angus<br>
<br>
<br>
_______________________________________________<br>
Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker" target="_blank">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>William Felipe Welter<br>------------------------------<br>Consultor em Tecnologias Livres<br><a href="mailto:william.welter@4linux.com.br" target="_blank">william.welter@4linux.com.br</a><br>
<a href="http://www.4linux.com.br" target="_blank">www.4linux.com.br</a><br><br>