Re: [gamin] gamin issue with FAMMonitorFile on CentOS5.1.



Title: Re: [gamin] gamin issue with FAMMonitorFile on CentOS5.1.
OK, seems like I found the problem.

In my app. I parsed FAM/gamin events in different thread. Code was something like this:


------------
void MyClas::threadFunc(void *data)
{
...

    while(1)
    {

        //
        //  This will block until there is an event.
        //
        int rc = FAMNextEvent(famConnection, famEvent);

        if(1 != rc)
        {
            DEBUG_THREAD_THUMBNAILS_UPDATE << "FAMNextEvent returned error" << endl;

            //
            //  Connection to FAM is lost...
            //
            break;
        }
...
------------

As you see I didn't use FAMPending to check whether we have new event or not.
This thread was running when I could cancel fam monitor or start it. With fam-2.6.8-15 it's OK.

In gamin it will stuck with the info I provided before.

To correct this I added the following:

------------
void MyClass::threadFunc(void *data)
{
...

    while(1)
    {
        int rc = FAMPending(famConnection);
 
        if (1 != rc)
        {
            continue;
        }

        //
        //  This will block until there is an event.
        //
        rc = FAMNextEvent(famConnection, famEvent);

        if(1 != rc)
        {
            DEBUG_THREAD_THUMBNAILS_UPDATE << "FAMNextEvent returned error" << endl;

            //
            //  Connection to FAM is lost...
            //
            break;
        }
...
------------

Running pending call won't block app. I think you need to put attention to this as it's a big difference from original FAM.
Many app. would have such an issue.

Anyway, thanks for your help.

Vitaliy

On Tue, 2008-07-08 at 18:35, Vitaliy Ivanov wrote:
I'm using it from rpms under CentOS 5.1. But for experiment I just
downloaded gamin-0.1.9 and built it - absolutely the same problem.

It's interesting as fam examples are still working. For experiments I
played with:

http://www.linuxdevcenter.com/pub/a/linux/2004/12/16/fam.html

and their examples:

http://www.linuxdevcenter.com/linux/2004/12/16/examples/fam_examples.tar.gz

but my application is not. So I starting to think it's something with
it.

Do you have any other methods to debug it. I used the docs from:

http://www.gnome.org/~veillard/gamin/debug.html

But it didn't show anything else that I mailed to you already.

Vitaliy

On Tue, 2008-07-08 at 18:21, Barry Rountree wrote:
> On Tue, Jul 08, 2008 at 05:30:17PM +0300, Vitaliy Ivanov wrote:
> > Guys, no thoughts at all? Any help will be appreciated. Any thoughts at
> > least where to look at...
>
>
>
> I see you're using gamin-0.1.7-8.el5.  The most recent version is
> 0.1.9.  Can you duplicate the behavior with that version?
>
> http://www.gnome.org/~veillard/gamin/sources/
>
>
> Barry
>
> >
> > V.
> >
> > On Mon, 2008-07-07 at 16:42, Vitaliy Ivanov wrote:
> > > OK, subscribed to the list...
> > >
> > > Also here is backtrace from gdb:
> > >
> > > (gdb) bt
> > > #0  0x0095d402 in __kernel_vsyscall ()
> > > #1  0x02442a3e in __lll_mutex_lock_wait () from /lib/libpthread.so.0
> > > #2  0x0243e8b4 in _L_mutex_lock_760 () from /lib/libpthread.so.0
> > > #3  0x0243e758 in pthread_mutex_lock () from /lib/libpthread.so.0
> > > #4  0x00265364 in FAMNoExists () from /usr/lib/libfam.so.0
> > > #5  0x00264987 in FAMMonitorFile () from /usr/lib/libfam.so.0
> > > ...
> > >
> > > Thanks,
> > > Vitaliy
> > >
> > > On Mon, 2008-07-07 at 14:33, Vitaliy Ivanov wrote:
> > > > Hi list,
> > > >
> > > > [Please CC me as I'm not subscribed to the list]
> > > >
> > > > I'm having problem in using gamin under CentOS5.1.
> > > > Here is the problem.
> > > >
> > > > Previously, we were using FAM 2.6.8-15 that is coming with RHEL3.
> > > > Everything was OK. Now we are migrating software to more newer
> > > > platform
> > > > CentOS5.1. I found that there is native gamin instead of FAM and it
> > > > should be API compatible.
> > > >
> > > > Everything was built OK. But now when I'm starting my app it stucks
> > > > on
> > > > FAMMonitorFile. I checked all the possible things from permission to
> > > > modifying config to use notify, pull, don't use anything for ext3
> > > > but
> > > > still it stuck on monitorfile command. Here is debug output:
> > > >
> > > > Server:
> > > >
> > > > ----------------------
> > > > [wxws galatea CENTOS_PORT]$ export GAM_DEBUG=
> > > > [wxws galatea CENTOS_PORT]$ cat ~/.gaminrc
> > > > #notify /wxdisk/*
> > > > #poll /wxdisk/*
> > > > notify /wxdisk/Digital_Media/Movies_Output_1.0/Custom/1.mov
> > > >
> > > > [wxws galatea CENTOS_PORT]$ /usr/libexec/gam_server --notimeout test
> > > > added /wxdisk/Digital_Media/Movies_Output_1.0/Custom/1.mov,0 to
> > > > excludes
> > > > added /media/*,1 to excludes
> > > > added /mnt/*,1 to excludes
> > > > added /dev/*,1 to excludes
> > > > added /proc/*,1 to excludes
> > > > Updating list of mounted filesystems
> > > > g_n_n: node for / using kernel with poll timeout of 0
> > > > basic poll backend initialized
> > > > Using inotify as backend
> > > > Ready listening to socket /tmp/fam-wxws-test : 4
> > > > gam_incoming_conn_read called
> > > > accepted incoming connection: 7
> > > > Created connection 7
> > > > gam_client_conn_read called
> > > > read credentials byte
> > > > Credentials: s_uid 500, c_uid 500, c_gid 500, c_pid 6709
> > > > ----------------------
> > > >
> > > > Client:
> > > > ----------------------
> > > > [wxws galatea src]$ ./my.app
> > > > ...
> > > > FAMOpen()
> > > > Connected to socket /tmp/fam-wxws-test : 18
> > > > Wrote credential bytes to socket 18
> > > > Activating thread safety
> > > > ...
> > > > FAMNextEvent(fd = 18)
> > > > Client need auth 18
> > > > read credentials byte
> > > > Credentials: s_uid 500, c_uid 500, c_gid 500, c_pid 6616
> > > > ....
> > > > FAMMonitorFile(/wxdisk/Digital_Media/Movies_Output_1.0/Custom/1.mov)
> > > > (STUCKS HERE....)
> > > > ----------------------
> > > >
> > > > I'm using LVM and here is filesystem structure:
> > > > ----------------------
> > > > [root galatea ~]# df
> > > > Filesystem           1K-blocks      Used Available Use% Mounted on
> > > > /dev/mapper/VolGroup00-LogVol00
> > > >                      234410632  60815004 161496044  28% /
> > > > /dev/sda1               101086     17532     78335  19% /boot
> > > > tmpfs                  1037068         0   1037068   0% /dev/shm
> > > > ----------------------
> > > >
> > > > What can be wrong? Any help will be appreciated?
> > > > Let me know if I can provide anything else that can help.
> > > >
> > > > ----------------------
> > > > [root galatea ~]# rpm -qa| grep -i gamin
> > > > gamin-0.1.7-8.el5
> > > > gamin-python-0.1.7-8.el5
> > > > gamin-devel-0.1.7-8.el5
> > > > [root galatea ~]# uname -a
> > > > Linux galatea 2.6.18-53.1.21.el5 #1 SMP Tue May 20 09:34:18 EDT 2008
> > > > i686 i686 i386 GNU/Linux
> > > > [root galatea ~]#
> > > > ----------------------
> > > >
> > > > TIA,
> > > > Vitaliy
> > > >
> > > >
> > _______________________________________________
> > Gamin-list mailing list
> > Gamin-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gamin-list
>
>
_______________________________________________
Gamin-list mailing list
Gamin-list gnome org
http://mail.gnome.org/mailman/listinfo/gamin-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]