Bug 212370

Summary: beagled hangs few minutes after it was started
Product: [Fedora] Fedora Reporter: Stefan Schwandter <schwandter>
Component: beagleAssignee: Alexander Larsson <alexl>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: drago01, edavis6678, fedora, genneth, hdegoede, joeshaw, jtl, mark, mick.lausch, mszpak, ralph+rh-bugzilla, samuel-rhbugs, vladimir.mv, zingale
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: beagle-0.2.10-7.fc6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-11-22 20:00:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
beagle log
none
index helper log
none
index helper exceptions log
none
Possible fix none

Description Stefan Schwandter 2006-10-26 15:30:26 UTC
Description of problem:

Beagled hangs after it has been running for a few minutes.

Version-Release number of selected component (if applicable):
0.2.10-5.fc6


How reproducible:

Always

Steps to Reproduce:
1. start beagled
2. wait a few minutes

  
Actual results:

beagled hangs, commands like beagle-status that are executed afterwards hang too.

When I start beagled manually from the command line, I see the following in the
moment it hangs:

Xlib: unexpected async reply (sequence 0x15)!

The sequence number changes from time to time.


I've attached the logs from beagled --debug.

Comment 1 Stefan Schwandter 2006-10-26 15:30:26 UTC
Created attachment 139472 [details]
beagle log

Comment 2 Stefan Schwandter 2006-10-26 15:31:13 UTC
Created attachment 139473 [details]
index helper log

Comment 3 Stefan Schwandter 2006-10-26 15:31:50 UTC
Created attachment 139474 [details]
index helper exceptions log

Comment 4 Jens Lautenbacher 2006-10-27 09:22:17 UTC
the same symptom here: neiter beagle-ping nor any of the status stuff works
anymore some minutes after beagle is started.

Comment 5 drago01 2006-10-28 07:18:17 UTC
the same happens here on 3 different boxes

Comment 6 zingale 2006-10-28 13:54:37 UTC
I have the same problem.  Nothing is ever indexed even though beagled is
running.  Just after rebooting if I do:

beagle-info --status

I get:

Scheduler:
Count: 0
Status: Waiting for the next trigger time

Pending Tasks:
Scheduler queue is empty.

Future Tasks:
Maintenance 0 (10/28/2006 9:46:43 AM)
Optimize KMailIndex
Hold until 10/28/2006 9:56:43 AM

Maintenance 0 (10/28/2006 9:46:43 AM)
Optimize FileSystemIndex
Hold until 10/28/2006 9:56:43 AM

Maintenance 0 (10/28/2006 9:46:45 AM)
Optimize GaimLogIndex
Hold until 10/28/2006 9:56:45 AM

Maintenance 0 (10/28/2006 9:46:45 AM)
Optimize IndexingServiceIndex
Hold until 10/28/2006 9:56:45 AM

Maintenance 0 (10/28/2006 9:46:45 AM)
Optimize TomboyIndex
Hold until 10/28/2006 9:56:45 AM

Maintenance 0 (10/28/2006 9:46:45 AM)
Optimize BlamIndex
Hold until 10/28/2006 9:56:45 AM

Maintenance 0 (10/28/2006 9:46:45 AM)
Optimize LifereaIndex
Hold until 10/28/2006 9:56:45 AM

Maintenance 0 (10/28/2006 9:46:45 AM)
Optimize AkregatorIndex
Hold until 10/28/2006 9:56:45 AM

Maintenance 0 (10/28/2006 9:46:45 AM)
Optimize KonqHistoryIndex
Hold until 10/28/2006 9:56:45 AM

Maintenance 0 (10/28/2006 9:46:46 AM)
Optimize KopeteIndex
Hold until 10/28/2006 9:56:46 AM


but then shortly thereafter, this command no longer works, but simply hangs.



Comment 7 zingale 2006-10-28 14:02:14 UTC
I am also seening the Xlib error when beagled hangs:

Xlib: unexpected async reply (sequence 0x9)!


Comment 8 Andreas Tunek 2006-10-30 23:27:01 UTC
I also have the same problem, but for some reason Beagle indexes web pages for me.

Comment 9 drago01 2006-10-31 07:56:45 UTC
(In reply to comment #7)
> I am also seening the Xlib error when beagled hangs:
> 
> Xlib: unexpected async reply (sequence 0x9)!
> 

why does beagled use xlib?

Comment 10 Russell Harrison 2006-11-01 22:48:51 UTC
I am also seeing this problem.  beagle-status, fails after a few minutes but
queries still work.  After a longer period of time searches will also start failing.

Comment 11 Eric Davis 2006-11-02 07:09:10 UTC
I'm seeing problems with Beagle as well.  

I deleted the .Beagle directory and then forced an immediate index build.  Able
to search web and IM logs initial, but fails after short period of time.


Comment 12 drago01 2006-11-02 07:17:50 UTC
(In reply to comment #11)
> I'm seeing problems with Beagle as well.  
> 
> I deleted the .Beagle directory and then forced an immediate index build.  Able
> to search web and IM logs initial, but fails after short period of time.
> 

that was the first thing I tryed same result

Comment 13 Michael Lausch 2006-11-02 08:09:22 UTC
(In reply to comment #9)
> (In reply to comment #7)
> > I am also seening the Xlib error when beagled hangs:
> > 
> > Xlib: unexpected async reply (sequence 0x9)!
> > 
> 
> why does beagled use xlib?

checking screensaver status si that it can tune to the load of the workstation.

Comment 14 Hans de Goede 2006-11-03 12:13:44 UTC
Do you happen to be using the proprietary ATI driver? I've received a similar
(although different) bug report against gkrellm on FC-6 which seems related to
the use of the proprietary ATI driver.


Comment 15 Vladimir Mosgalin 2006-11-03 12:16:50 UTC
I have the same problem and I'm using fglrx driver. I don't have much choice,
having Radeon X1K series card..

Comment 16 Ralph Angenendt 2006-11-03 12:18:01 UTC
(In reply to comment #14)
> Do you happen to be using the proprietary ATI driver? 

Nope, same thing happens with the radeon driver from XOrg.



Comment 17 Jens Lautenbacher 2006-11-03 13:46:13 UTC
and with the i810 driver, too

Comment 18 zingale 2006-11-03 13:47:19 UTC
yep, i810 here too, and I get the Xlib error (i945 integrated graphics)

Comment 19 Michael Lausch 2006-11-03 13:53:56 UTC
I'm rather sure it's the screensaver checking code.

hint 1: It does not crash if the DISPLAY enviuronment variable is *not* set.
        Quick fix: unset DISPLAY in the /usr/bin/beagled shell script

hint2: setting  MONO_EXTRA_ARGS environment variable to 
       --trace=T:Beagle.Util.SystemInformation 
       shows the following output:

ENTER: Beagle.Util.SystemInformation:get_InputIdleTime ()()
. ENTER: Beagle.Util.SystemInformation:CheckScreenSaver ()()
. . ENTER: (wrapper managed-to-native) 
Beagle.Util.SystemInformation:screensaver_info 
(Beagle.Util.SystemInformation/ScreenSaverState*,Beagle.Util.SystemInformation/ScreenSaverKind*,ulong*,ulong*)
        (0xb68cec68, 0xb68cec64, 0xb68cec5c, 0xb68cec54, )
Xlib: unexpected async reply (sequence 0x9)!


Comment 20 Michael Lausch 2006-11-03 14:43:00 UTC
The real problem is in the patch to the screensaver-glue.c file which tries to
detect X Connection errors by reading X Events from the display in a glib IO
callback. The callback is initialized in the main thread and therefore accesses
the X display from the main thread. the screensaver information, which also 
accesses the X display is called from the Scheduler thread. This leads to a 
situation where two threads are reading X Events from the same X display,
without locking and without a call to XInitThreads. 

Solution: 
Maybe the patch xconnection-exit is not necessary at all. the connection to the
X display is checked everytime the screensaver_info function is called. Polling
the display may make the process of detecting a broken X display connection
faster, but being threadsafe is even much more overhead. Or simple register the
g_io callback for G_IO_ERR and G_IO_HUP. Then the callback is only called when
the X display lost it's connection (AFAIK, i may be wrong here). 

Comment 21 drago01 2006-11-04 10:04:37 UTC
unset DISPLAY isn't really a solution, because beagle will not be killed after
logout or X restart.

Comment 22 Alexander Larsson 2006-11-08 16:34:51 UTC
without the xconnection-exit patch we were leaving beagle processes alive after
logout, so that is certanly needed.

A simple lock should solve the problem though, right?


Comment 23 Alexander Larsson 2006-11-08 16:42:54 UTC
Created attachment 140665 [details]
Possible fix

Anyone want to try this patch and see if it helps?
(it replaces beagle-0.2.10-xconnection-exit.patch in the rpm)

Comment 24 Santiago Martinez 2006-11-09 20:58:18 UTC
(In reply to comment #23)
> Created an attachment (id=140665) [edit]
> Possible fix
> 
> Anyone want to try this patch and see if it helps?
> (it replaces beagle-0.2.10-xconnection-exit.patch in the rpm)

Hi, I tested this patch over four hours and works fine for me. 
Beagle daemon don't hangs anymore. And no more  "Xlib: unexpected async reply"
when beagled is started from command line. 

Comment 25 Fedora Update System 2006-11-10 15:06:22 UTC
beagle-0.2.10-7.fc6 has been pushed for fc6, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.

Comment 26 drago01 2006-11-11 08:48:32 UTC
works fine here
thx for the fix ;)

Comment 27 Raoul 2006-11-20 16:32:47 UTC
seems to work fine here too.
Thanks :)

Comment 28 Fedora Update System 2006-11-20 16:47:59 UTC
beagle-0.2.10-7.fc6 has been pushed for fc6, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.