<div><br></div><div>while hang,stack info:</div><div><br></div><div><div>&nbsp;Program&nbsp;received&nbsp;signal&nbsp;SIGINT,&nbsp;Interrupt.<br>0x0000003e1380b43c&nbsp;in&nbsp;pthread_cond_wait@@GLIBC_2.3.2&nbsp;()&nbsp;from&nbsp;/lib64/libpthread.so.0<br>Missing&nbsp;separate&nbsp;debuginfos,&nbsp;use:&nbsp;debuginfo-install&nbsp;glibc-2.12-1.107.el6.x86_64&nbsp;glusterfs-3.4.0.57rhs-1.el6_5.x86_64&nbsp;glusterfs-api-3.4.0.57rhs-1.el6_5.x86_64&nbsp;glusterfs-libs-3.4.0.57rhs-1.el6_5.x86_64&nbsp;keyutils-libs-1.4-4.el6.x86_64&nbsp;krb5-libs-1.10.3-10.el6.x86_64&nbsp;libcom_err-1.41.12-14.el6.x86_64&nbsp;libselinux-2.0.94-5.3.el6.x86_64&nbsp;openssl-1.0.1e-16.el6_5.14.x86_64&nbsp;uuid-1.6.1-10.el6.x86_64&nbsp;zlib-1.2.3-29.el6.x86_64<br>(gdb)&nbsp;bt<br>#0&nbsp;&nbsp;0x0000003e1380b43c&nbsp;in&nbsp;pthread_cond_wait@@GLIBC_2.3.2&nbsp;()&nbsp;from&nbsp;/lib64/libpthread.so.0<br>#1&nbsp;&nbsp;0x00007ffff7b9903b&nbsp;in&nbsp;syncop_lookup&nbsp;()&nbsp;from&nbsp;/usr/lib64/libglusterfs.so.0<br>#2&nbsp;&nbsp;0x00007ffff7ddfd59&nbsp;in&nbsp;glfs_first_lookup_safe&nbsp;()&nbsp;from&nbsp;/usr/lib64/libgfapi.so.0<br>#3&nbsp;&nbsp;0x00007ffff7ddfde7&nbsp;in&nbsp;__glfs_first_lookup&nbsp;()&nbsp;from&nbsp;/usr/lib64/libgfapi.so.0<br>#4&nbsp;&nbsp;0x00007ffff7ddfe66&nbsp;in&nbsp;__glfs_active_subvol&nbsp;()&nbsp;from&nbsp;/usr/lib64/libgfapi.so.0<br>#5&nbsp;&nbsp;0x00007ffff7de010f&nbsp;in&nbsp;glfs_active_subvol&nbsp;()&nbsp;from&nbsp;/usr/lib64/libgfapi.so.0<br>#6&nbsp;&nbsp;0x00007ffff7ddd0ff&nbsp;in&nbsp;glfs_creat&nbsp;()&nbsp;from&nbsp;/usr/lib64/libgfapi.so.0<br>#7&nbsp;&nbsp;0x00000000004014c2&nbsp;in&nbsp;main&nbsp;(argc=1,&nbsp;argv=0x7fffffffe6f8)&nbsp;at&nbsp;glfs_example.c:80</div><div>thank you.</div><div><span id="_editor_bookmark_start_5" style="display: none; line-height: 0px;">‍</span>Best Regards,</div><div>Lixiaopo</div></div><div><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------&nbsp;原始邮件&nbsp;------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b>&nbsp;"360532762";&lt;360532762@qq.com&gt;;</div><div><b>发送时间:</b>&nbsp;2014年8月28日(星期四) 中午1:01</div><div><b>收件人:</b>&nbsp;"Soumya Koduri"&lt;skoduri@redhat.com&gt;; "Pranith Kumar Karampuri"&lt;pkarampu@redhat.com&gt;; <wbr></div><div><b>抄送:</b>&nbsp;"Gluster Devel"&lt;gluster-devel@gluster.org&gt;; <wbr></div><div><b>主题:</b>&nbsp;Re:&nbsp; [Gluster-devel] glfs_creat this method hang up</div></div><div><br></div><div><div>Hi~:</div><div>Soumya,<span id="_editor_bookmark_start_4" style="display: none; line-height: 0px;">‍</span></div><div>the glusterfs_example.c is placed in directory /usr/local/glusterfs.</div><div>I want to the file name generated by uuid.but now have not to do that yet,the variable filename is hard code.e.g."<span style="line-height: 1.5;">/2fcdec2e-688c-4077-bf96-4a42963dcffc.MOV<span id="_editor_bookmark_start_1" style="display: none; line-height: 0px;">‍</span></span><span style="line-height: 1.5;">".</span></div><div><div>result is ok.</div><div><br></div><div>&nbsp;[root@localhost glusterfs]# pwd<br>/usr/include/glusterfs<br>[root@localhost glusterfs]# gcc -o glusterfs_example glusterfs_example.c -lgfapi<br>[root@localhost glusterfs]# ./glusterfs_example dr 192.168.108.150<br>glfs_init: returned 0<br>----/2fcdec2e-688c-4077-bf96-4a42963dcffc.MOV----<br>/2fcdec2e-688c-4077-bf96-4a42963dcffc.MOV: (0x20241e0) Success<br>/2fcdec2e-688c-4077-bf96-4a42963dcffc.MOV: (0x20241e0) Structure needs cleaning<br>read 32, hi there<span id="_editor_bookmark_start_2" style="display: none; line-height: 0px;">‍</span>&nbsp;</div></div><div><span style="line-height: 1.5;"><br></span></div><div>keep the source code not changed and then &nbsp;I add "-luuid" to gcc , compiled result is ok, but while run,hanging occured.</div><div><br></div><div><div>&nbsp;[root@localhost glusterfs]# gcc -o glusterfs_example glusterfs_example.c -lgfapi -luuid<br>[root@localhost glusterfs]# ./glusterfs_example dr 192.168.108.151<br>glfs_init: returned 0<br>----/2fcdec2e-688c-4077-bf96-4a42963dcffc.MOV----<br></div></div><div>&lt;------------------------------hanging &nbsp;here -----------------------------&gt;</div><div><span style="line-height: 1.5;"><br></span></div><div>&nbsp;source code :</div><div>&nbsp;#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;errno.h&gt;<br>#include "api/glfs.h"<br>#include "api/glfs-handles.h"<br>#include &lt;string.h&gt;<br>#include &lt;time.h&gt;<br><br>int<br>main (int argc, char *argv[])<br>{<br>&nbsp; glfs_t&nbsp;&nbsp;&nbsp; *fs2 = NULL;<br>&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ret = 0;<br>&nbsp; glfs_fd_t *fd = NULL;<br>&nbsp; glfs_fd_t *fd2 = NULL;<br>&nbsp; char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readbuf[32];<br>&nbsp; char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; writebuf[32];<br>&nbsp; char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *filename = "/2fcdec2e-688c-4077-bf96-4a42963dcffc.MOV";<br><br>&nbsp; if (argc != 3) {<br>&nbsp;&nbsp;&nbsp; printf ("Expect following args\n\t%s &lt;volname&gt; &lt;hostname&gt;\n", argv[0]);<br>&nbsp;&nbsp;&nbsp; return -1;<br>&nbsp; }<br><br>&nbsp; fs2 = glfs_new (argv[1]);<br>&nbsp; if (!fs2) {<br>&nbsp;&nbsp;&nbsp; fprintf (stderr, "glfs_new: returned NULL\n");<br>&nbsp;&nbsp;&nbsp; return 1;<br>&nbsp; }<br>&nbsp; ret = glfs_set_volfile_server (fs2, "tcp", argv[2], 24007);<br>&nbsp; ret = glfs_set_logging (fs2, "/dev/stderr", 1);<br>&nbsp; ret = glfs_init (fs2);<br>&nbsp; fprintf (stderr, "glfs_init: returned %d\n", ret);<br><br>&nbsp; printf("----%s----\n", filename);<br>&nbsp; fd = glfs_creat (fs2, filename, O_RDWR, 0644);<br>&nbsp; fprintf (stderr, "%s: (%p) %s\n", filename, fd, strerror (errno));<br><br>&nbsp; fd2 = glfs_open (fs2, filename, O_RDWR);<br>&nbsp; fprintf (stderr, "%s: (%p) %s\n", filename, fd, strerror (errno));<br><br>&nbsp; sprintf (writebuf, "hi there\n");<br>&nbsp; ret = glfs_write (fd, writebuf, 32, 0);<br><br>&nbsp; glfs_lseek (fd2, 0, SEEK_SET);<br>&nbsp; ret = glfs_read (fd2, readbuf, 32, 0);<br>&nbsp; printf ("read %d, %s", ret, readbuf);<br><br>&nbsp; glfs_close (fd);<br>&nbsp; glfs_close (fd2);<br><br>&nbsp;&nbsp; glfs_fini (fs2);<br><br>&nbsp; return ret;<br>}<span id="_editor_bookmark_start_0" style="display: none; line-height: 0px;">‍</span><br></div></div><div><div><br></div><div>Thanks,</div><div>Lixiaopo</div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From: </b>&nbsp;"Soumya Koduri";&lt;skoduri@redhat.com&gt;;</div><div><b>Date: </b>&nbsp;Wed, Aug 27, 2014 07:42 PM</div><div><b>To: </b>&nbsp;"Pranith Kumar Karampuri"&lt;pkarampu@redhat.com&gt;; "ABC-new"&lt;360532762@qq.com&gt;; <wbr></div><div><b>Cc: </b>&nbsp;"Gluster Devel"&lt;gluster-devel@gluster.org&gt;; <wbr></div><div><b>Subject: </b>&nbsp;Re: [Gluster-devel] glfs_creat this method hang up</div></div><div><br></div>Could you please share your glusterfs_example code and the steps you <br>have used to compile it and execute the binary? Would like to check how <br>the gfapi header files are linked.<br><br>Thanks,<br>Soumya<br><br>On 08/27/2014 03:22 PM, Pranith Kumar Karampuri wrote:<br>&gt; Guys who work with glfs_*, could you guys reply to this question.<br>&gt;<br>&gt; Pranith<br>&gt; On 08/27/2014 03:16 PM, ABC-new wrote:<br>&gt;&gt; hi~:<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; while i run the glusterfs example via libgfapi, gcc -c<br>&gt;&gt; glusterfs_example -o glfs -luuid<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; the method glfs_creat hang up.<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; I want to generate the uuid for file name.<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;&nbsp; &nbsp; thank you.<br>&gt;<br>&gt; _______________________________________________<br>&gt; Gluster-devel mailing list<br>&gt; Gluster-devel@gluster.org<br>&gt; http://supercolony.gluster.org/mailman/listinfo/gluster-devel</div></div>