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 <stdlib.h><br>#include <sys/mman.h><br>
#include <stdio.h><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 = "teste123XXXXXX";<br>size_t bytes=10024;<br>
<br>snprintf (path, PATH_MAX, "/dev/shm/%s", file);<br>printf("PATH=%s\n",path);<br><br>fd = mkstemp (path);<br>printf("fd=%d \n",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("ADDR_ORIG:%p ADDR:%p\n",addr_orig,addr); <br>
<br><br> if (addr != addr_orig) {<br> printf("Erro"); <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"><<a href="mailto:asalkeld@redhat.com">asalkeld@redhat.com</a>></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>
> Thanks Steven,<br>
><br>
> Now im try to run on the MCP:<br>
> - Uninstall the pacemaker 1.0<br>
> - Compile and install 1.1<br>
><br>
> But now i have problems to initialize the pacemakerd: Could not initialize<br>
> Cluster Configuration Database API instance error 2<br>
> Debbuging with gdb i see that the error are on the confdb.. most specificaly<br>
> the errors start on coreipcc.c at line:<br>
><br>
><br>
> 448 if (addr != addr_orig) {<br>
> 449 goto error_close_unlink; <- enter here<br>
> 450 }<br>
><br>
> Some ideia about what can cause this ?<br>
><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't get it working in the short time I tried. It's probably<br>
worth looking at the clib implementation to see why it's failing<br>
(I didn'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>