xrmx / bootchart

merge of bootchart-collector and pybootchartgui
GNU General Public License v2.0
233 stars 88 forks source link

pybootchartgui.py crash on CentOS 6 #28

Closed reidrac closed 13 years ago

reidrac commented 13 years ago
# ./pybootchartgui.py -o out/
No path given, trying /var/log/bootchart.tgz
parsing '/var/log/bootchart.tgz'
parsing 'header'
parsing 'dmesg'
parsing 'cmdline2.log'
parsing 'paternity.log'
parsing 'proc_cpuinfo.log'
parsing 'proc_diskstats.log'
parsing 'proc_meminfo.log'
parsing 'proc_stat.log'
parsing 'taskstats.log'
merged 0 logger processes
pruned 772 process, 0 exploders, 81 threads, and 1 runs
merged 0 logger processes
Traceback (most recent call last):
  File "./pybootchartgui.py", line 23, in <module>
    sys.exit(main())
  File "/root/bootchart/pybootchartgui/main.py", line 161, in main
    render()
  File "/root/bootchart/pybootchartgui/main.py", line 152, in render
    batch.render(writer, res, options, filename)
  File "/root/bootchart/pybootchartgui/batch.py", line 43, in render
    draw.render (ctx, options, 1.0, trace)
  File "/root/bootchart/pybootchartgui/draw.py", line 405, in render
    curr_y = draw_header (ctx, trace.headers, duration)
  File "/root/bootchart/pybootchartgui/draw.py", line 475, in draw_header
    header_y = ctx.font_extents()[2] + 10
MemoryError
xrmx commented 13 years ago

Which version of pybootchartgui? The error means you have run out of memory, this may be a shortage on your machine or maybe an infinite loops or something. Can you please upload /var/log/bootchart.tgz somewhere to help debugging the issue? Thanks!

reidrac commented 13 years ago

I'm using github code and I've tried with both 512MB and 1GB of RAM in the VM.

Finally I tried the same version in a Fedora 14 to process the bootchart.tgz, and it worked. I guess the problem is related to any of the libraries that are shipped with CentOS 6 :(

xrmx commented 13 years ago

Could you please report how much memory pybootchartgui is consuming? The output of this is fine: watch -n 1 "ps aux | grep python" From the data i have here memory grows up to 200MB when drawing the png so i think we have some room for improvement. Need to investigate the issue more.

reidrac commented 13 years ago

I'm afraid I can't report how many memory is using because it crashes too fast.

You can get the bootchart.tgz file here:

http://blackshell.usebox.net/pub/tmp/bootchart.tgz

... although pybootchartgui.py works perfectly with that file in Fedora 14, so I think is related to a problem with any of the CentOS 6 packages.

Another thing, probably unrelated, is that I'm running the OS in runlevel 3 and I'm using EXIT_PROC="mingetty". It doesn't seem to detect mingetty properly because I get the login prompt in about 6 secs but bootchart captures data for about 29 seconds (?).

I hope it helps, I had to setup the VM again :)

reidrac commented 13 years ago

Look, the problem is in a method of ctx, and that comes from:

# from pybootchartgui/batch.py
ctx = cairo.Context (surface)
    draw.render (ctx, options, 1.0, trace)

So I guess it's cairo/pycairo's fault:

pycairo-1.8.6-2.1.el6.x86_64 cairo-1.8.8-3.1.el6.x86_64

If you spot something obvious (ie. cairo misuse), then fix it; but my wild guess is that it's related to these versions of the libraries.

xrmx commented 13 years ago

I cannot reproduce here, pybootchartgui uses at max 50MB with your data, so it may be some bugs in centos 6 old versions of libraries.

wrt mingetty, we wait 20 more seconds before stopping to gather the data when we see the EXIT_PROC in order to get more post-login data for slow systems.

So i'm closing this. Thanks for reporting anyway.

reidrac commented 13 years ago

Thanks for you time.

You may add a note in the documentation regarding the required cairo/pycairo version, saying that you can run pybootchartgui.py in a different system once you got the data :)