Hi Andrew,<br><br> I ran it. However, an error has been output.<br> Probably I have a feeling that glib does not move well.<br> I attached ha-log.<br><br> I feel like cannot read a library well.<br> It is contents of core as follows.<br>
---- <br>$ gdb /usr/sbin/corosync core.27920<br>GNU gdb Fedora (6.8-37.el5)<br>Copyright (C) 2008 Free Software Foundation, Inc.<br>License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</a>><br>
This is free software: you are free to change and redistribute it.<br>There is NO WARRANTY, to the extent permitted by law. Type "show copying"<br>and "show warranty" for details.<br>This GDB was configured as "x86_64-redhat-linux-gnu"...<br>
<br>warning: core file may not match specified executable file.<br>Core was generated by `/usr/lib64/heartbeat/pengine'.<br>Program terminated with signal 11, Segmentation fault.<br>[New process 27920]<br>#0 0x00002b247fa8b53a in ?? ()<br>
(gdb) where<br>#0 0x00002b247fa8b53a in ?? ()<br>#1 0x00002b247ebc5027 in ?? ()<br>#2 0x0000000000000000 in ?? ()<br>------<br><br>Regards,<br>Tomo<br><br><div class="gmail_quote">2010/11/11 Andrew Beekhof <span dir="ltr"><<a href="mailto:andrew@beekhof.net">andrew@beekhof.net</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 Thu, Nov 11, 2010 at 10:26 AM, nozawat <<a href="mailto:nozawat@gmail.com">nozawat@gmail.com</a>> wrote:<br>
> Hi Andrew,<br>
><br>
> Thanks for a revision.<br>
> I confirmed completion of compiling it.<br>
> I revised it a little, I attach a patch.<br>
<br>
</div>Thanks! Did you try running it?<br>
<div><div></div><div class="h5"><br>
><br>
> Regards,<br>
> Tomo<br>
><br>
><br>
> 2010/11/11 Andrew Beekhof <<a href="mailto:andrew@beekhof.net">andrew@beekhof.net</a>><br>
>><br>
>> This might be a little better:<br>
>><br>
>> diff -r dd75da218e4f <a href="http://configure.ac" target="_blank">configure.ac</a><br>
>> --- a/<a href="http://configure.ac" target="_blank">configure.ac</a> Fri Oct 29 12:12:45 2010 +0200<br>
>> +++ b/<a href="http://configure.ac" target="_blank">configure.ac</a> Tue Nov 09 13:20:55 2010 +0100<br>
>> @@ -654,7 +654,7 @@ AC_MSG_RESULT(using $GLIBCONFIG)<br>
>><br>
>> AC_CHECK_LIB(glib-2.0, g_hash_table_get_values)<br>
>> if test "x$ac_cv_lib_glib_2_0_g_hash_table_get_values" != x""yes; then<br>
>> - AC_MSG_ERROR(Your version of Glib is too old, you need at least 2.14)<br>
>> + AC_MSG_WARN(Your version of Glib is too old, you should have at least<br>
>> 2.14)<br>
>> fi<br>
>><br>
>> #<br>
>> diff -r dd75da218e4f include/crm/common/util.h<br>
>> --- a/include/crm/common/util.h Fri Oct 29 12:12:45 2010 +0200<br>
>> +++ b/include/crm/common/util.h Tue Nov 09 13:20:55 2010 +0100<br>
>> @@ -298,4 +298,59 @@ extern int node_score_infinity;<br>
>> extern xmlNode *create_operation_update(xmlNode *parent, lrm_op_t<br>
>> *op, const char *caller_version, int target_rc, const char *origin,<br>
>> int level);<br>
>> extern void free_lrm_op(lrm_op_t *op);<br>
>><br>
>> +#if HAVE_LIBGLIB_2_0<br>
>> +<br>
>> +#else<br>
>> +<br>
>> +typedef struct fake_ghi<br>
>> +{<br>
>> + int offset;<br>
>> + GHashTable *hash;<br>
>> + GList *values;<br>
>> +<br>
>> +} GHashTableIter;<br>
>> +<br>
>> +static inline void g_hash_append_value(gpointer key, gpointer value,<br>
>> gpointer user_data)<br>
>> +{<br>
>> + GList **values = (GList **)user_data;<br>
>> + *values = g_list_append(*values, value);<br>
>> +}<br>
>> +<br>
>> +static inline GList *g_hash_table_get_values(GHashTable *hash_table);<br>
>> +{<br>
>> + GList *values = NULL;<br>
>> + g_hash_table_foreach(hash_table, g_hash_append_value, &values);<br>
>> +}<br>
>> +<br>
>> +static inline void g_hash_table_iter_init(GHashTableIter *iter,<br>
>> GHashTable *hash_table)<br>
>> +{<br>
>> + iter->offset = 0;<br>
>> + iter->hash = hash_table;<br>
>> +<br>
>> + /* iter->values = g_hash_table_get_values(hash_table); */<br>
>> +<br>
>> + /* We could cache the values, but then we need to clean up the list<br>
>> + * later which doesn't fit the glib2 API<br>
>> + * So instead we calculate it in _next() every time its needed<br>
>> + */<br>
>> +}<br>
>> +<br>
>> +<br>
>> +static inline gboolean g_hash_table_iter_next(GHashTableIter *iter,<br>
>> gpointer *key, gpointer *value)<br>
>> +{<br>
>> + GList *values = iter->values;<br>
>> + if(iter->values == NULL) {<br>
>> + values = g_hash_table_get_values(iter->hash_table);<br>
>> + }<br>
>> +<br>
>> + iter->offset++;<br>
>> + *value = g_list_nth_data(values, iter->offset);<br>
>> +<br>
>> + if(iter->values == NULL) {<br>
>> + g_list_free(values);<br>
>> + }<br>
>> + return (*value) != NULL;<br>
>> +}<br>
>> +<br>
>> #endif<br>
>> +<br>
>> +#endif<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:<br>
>> <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>
><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:<br>
> <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>
><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>
</div></div></blockquote></div><br>