Bug 96670 - xload crashes if the window is wider than 2048 pixels
Summary: xload crashes if the window is wider than 2048 pixels
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xaw (show other bugs)
Version: 7.0 (2005.12)
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-24 18:40 UTC by Keith Thompson
Modified: 2018-03-30 22:57 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Keith Thompson 2016-06-24 18:40:14 UTC
I ran into this recently when I switched to a new 2560x1600 monitor.

If I run xload with a window that's 2048 or fewer pixels wide, it works
correctly.

If the window size is more than 2048 pixels, it works correctly until
2048 data points have been plotted. Once it gets past 2048 plotted data
points, it either crashes with a segmentation fault or misbehaves in
some other way. In various circumstances, I've seen the window either
stop updating or go blank.

To reproduce:

    xload -geom 2050x200 -update 1

and wait about 34 minutes until the graph exceeds 2048 columns. Depending
on the window manager, you might need a large X display to do this.

I've seen this on Ubuntu 14.04 and 16.04.

As a workaround, I'm running xload with width of 2048 pixels -- but if I
maximize my xload window, it immediately crashes.
Comment 1 Keith Thompson 2016-06-24 18:47:52 UTC
And here's the problem:

ftp://ftp.x.org/pub/xorg/individual/lib/libXaw-1.0.13.tar.gz

libXaw-1.0.13/include/X11/Xaw/StripCharP.h, line 74

    double valuedata[2048];     /* record of data points */

Increasing the size would be a quick fix. Dynamic allocation would be
another (but the size would need to increase if the window is resized).
Comment 2 Alan Coopersmith 2018-03-25 05:46:57 UTC
Thanks for the report - patch submitted for code review:
https://patchwork.freedesktop.org/patch/212798/

I wasn't sure if the size of valuedata could be changed without breaking
the ABI, since it's embedded in the class structure, so I just added
bounds checks to keep us from exceeding it.   If you need more than 2048
points of load average data, you probably want a better monitoring tool
than xload anyway.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.