GNOME Bugzilla – Bug 348139
xdgmime loops incessantly on certain file types (jar, javascript, matlab)
Last modified: 2007-01-11 21:35:38 UTC
Please describe the problem: beagle runs fine up to the point, where IndexHelper reaches a directory with matlab files. Then beagled-helper uses all cpu power. Steps to reproduce: 1. start beagled and wait (reproduceable every day) 2. 3. Actual results: see log; CPU is at 100% Expected results: normal operation Does this happen every time? yes Other information: yes, the log file, but how to attach!?
Created attachment 69263 [details] IndexHelper log file
Looks like either your matlab files are really big, or our matlab filter is just really inefficient. Can you please also attach a matlab file that triggers the problem?
Thanks for the quick answer. I don't know which file triggers this behaviour, but I attached bowtie.m. All matlab files are very small files and even, if the filter is inefficient, it should not use all cpu cycles...
Created attachment 69308 [details] bowtie.m
Matlab files are simple programs written in matlab scripting language. There is no reason for them to take huge CPU resources while indexing. I tried the attachment, and it was filtered very quickly w/out any noticeable CPU usage. Can you try the following: $ beagle-extract-content /path/to/bowtie.m Observe CPU usage during this process and paste its output here.
sebastian@yates ~ $ time beagle-extract-content "/home/sebastian/HFT/Doku/Skripte/Antenna and EM Modeling with Matlab/chapter07/mesh/bowtie.m" Filename: file:///home/sebastian/HFT/Doku/Skripte/Antenna and EM Modeling with Matlab/chapter07/mesh/bowtie.m Debug: Loaded 46 filters from /usr/lib/beagle/Filters/Filters.dll Filter: Beagle.Filters.FilterMatlab MimeType: Content: BOWTIE Bowtie mesh in the xy plane The following parameters need to be specified: Discretization parameter N Half-height of bowtie h Width of the feeding neck d Bowtie flare angle flareangle Change(decrease) the width of the feeding neck if inaccurate results are obtained Copyright 2002 AEMM. Revision 2002/03/25 Chapter 7 clear all N Discretization parameter h Half-height of bowtie d Width of the feeding neck flareangle pi Bowtie flare angle StepY h N TAN tan flareangle Set y grid (from -h to h) j N y j h j StepY Set x grid (from d/2 to upper boundary) i N Vector i TAN y N i d Set left and right boundary XLeft Vector N Vector N XRight Vector N Vector N Initialize amd plot polygon, which encloses bowtie Xpol XLeft XRight N Ypol y y N fill Xpol Ypol g axis equal pause hold on Initialize vertexes inside bowtie L j N M j abs j N StepX XRight j XLeft j M j i M j X L XLeft j i StepX Y L y j L L Use Delaunay triangulation TRI delaunay X Y t ; p=[X; Y; zeros(1,length(X))]; q=trimesh(t X Y zeros size X pause hold off Remove unnecessary triangles m length t Center m sum p t m IN inpolygon Center Center Xpol Ypol TrianglesTotal length t Triangle m TrianglesTotal IN m Triangle Triangle t m clear t t Triangle TrianglesTotal length t t Save result save bowtie p t viewer bowtie view (no hot content) real 0m0.498s user 0m0.434s sys 0m0.041s It's to fast, to observe cpu utilization. Maybe it's only by accident; internal structures in beagled-helper may be the cause and this file has nothing to do with it. Is there a way to tell beagled, that it should terminate the beagled-helper more often?
now I think it has nothing to do with matlab files. Here is why: sebastian@yates ~ $ top PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 23040 sebastia 0 0 124m 62m 43m S 98.0 6.1 43:59.44 beagled-helper sebastian@yates ~ $ strace -p 23040 Process 23040 attached - interrupt to quit poll([{fd=20, events=POLLIN}], 1, -1) = -1 EINTR (Interrupted system call) --- SIGPWR (Power failure) @ 0 (0) --- futex(0x81c6eac, FUTEX_WAKE, 3) = 0 rt_sigsuspend(~[INT QUIT ABRT TERM XCPU RTMIN RT_1]) = ? ERESTARTNOHAND (To be restarted) --- SIGXCPU (CPU time limit exceeded) @ 0 (0) --- sigreturn() = ? (mask now ~[INT QUIT ABRT KILL TERM STOP RTMIN]) futex(0x81c6eac, FUTEX_WAKE, 3) = 0 sigreturn() = ? (mask now []) poll( The process hangs on this unfinished "poll(" system call. After quite some time it return with the above "-1 EINTR (Interrupted system call)". yates ~ # lsof | grep 23040 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME beagled-h 23040 sebastian 20r FIFO 0,5 304922 pipe beagled-helper tries to read from a pipe! I thought 0.2.7 doesn't do this anymore. Am I able to instruct beagled not to read from pipes?
The pipe might be due to some internal mechanism. I doubt the problem is with matlab files. It will be very helpful if you can narrow down the bug. Does the high CPU utilization happen everytime beagled-helper reaches that directory ?
The high CPU utilization happens every day. I just started beagled (through kerry) and everything is alright. # ps ax 10483 ? Sl 0:04 beagled --debug /usr/lib/beagle/BeagleDaemon.exe --bg --autostarted beagled-helper takes only very little cpu. I don't know enough about beagled to get any further. Attached you'll find the output of lsof of beagle processes in known good state.
Created attachment 69787 [details] lsof | grep beagle beagle is running fine and not consuming much cpu power
It happened again: # top top - 10:57:17 up 2:54, 1 user, load average: 1.41, 1.45, 1.42 Tasks: 159 total, 1 running, 158 sleeping, 0 stopped, 0 zombie Cpu(s): 33.2% us, 4.6% sy, 1.3% ni, 24.6% id, 35.3% wa, 0.2% hi, 0.9% si Mem: 1035884k total, 1010164k used, 25720k free, 77796k buffers Swap: 506036k total, 256k used, 505780k free, 488628k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 16693 sebastia 0 0 125m 63m 42m S 84.5 6.2 30:55.66 beagled-helper logfiles attached...
Created attachment 69806 [details] lsof | grep beagle now beagle-helper consumes nearly all cpu power
Created attachment 69807 [details] IndexHelper logfile beagle-helper consumes nearly all cpu power
Comment on attachment 69807 [details] IndexHelper logfile Fixed mimetype.
*** Bug 348874 has been marked as a duplicate of this bug. ***
*** Bug 353327 has been marked as a duplicate of this bug. ***
I can't duplicate this all the time, and never with beagle-extract-content, but this sometimes happens to me, usually with javascript files but also the occasional matlab file. I'm not sure why yet.
I filled bug 353618 It seems related to this bug
*** Bug 353618 has been marked as a duplicate of this bug. ***
I just checked in a fix for this.
*** Bug 363744 has been marked as a duplicate of this bug. ***