... reaching a image width or height of 1, leading to an invalid map that devides by 0. Fixed in all branches >= 6.1The "rasterview" example crashes when ...
https://sourceforge.net/p/qwt/bugs.Where can I do that ?.
Uwe
... reaching a image width or height of 1, leading to an invalid map that devides by 0. Fixed in all branches >= 6.1The "rasterview" example crashes when ...
https://sourceforge.net/p/qwt/bugs.Where can I do that ?.
Uwe
The issue is already posted here : https://sourceforge.net/p/qwt/bugs/272/
Otherwise, I'm still curious why is there a segfault whereas the read bounds are correct (existential question) ???!!!???
Are you sure, I'm having crashes with Qwt 6.1Fixed in all branches >= 6.1
Last edited by embeddedmz; 11th July 2019 at 09:40.
With this one ?UweQt Code:
svn export https://svn.code.sf.net/p/qwt/code/branches/qwt-6.1To copy to clipboard, switch view to plain text mode
Hi Uwe,
No crash with this one.
So, what is the recommended branch (link please) should I use (We package Qwt in a RPM file, especially for Centos 7. Sadly, for the machine running Ubuntu, the package downloaded with apt is not patched).
UPDATE:
I will need the 6.2 version as it contains the features you described in your first reply.
Last edited by embeddedmz; 11th July 2019 at 16:32.
Going back to your first reply, I want to do an analogy with VTK color mapping classes : vtk_color_mapping.png
From what I understood, using QwtColorMap::RGB format, is like using the VTK class vtkColorTransferFunction (take a look at the picture above), which requires the computation of an RGB color based on the value of the raster pixel.
This is slower than looking up colors in a 256 color array which can be done by setting the format to QwtColorMap::Indexed. In VTK, the corresponding class would be vtkLookupTable. However, the VTK's look up table size can be changed which is not possible with QwtColorMap::Indexed.
In Qwt 6.2, as you said, you added a method QwtPlotSpectrogram::setMaxRGBTableSize, I took a look to the code, and, from what I understood, the mode QwtColorMap::RGB now uses a look up table (like vtkLookupTable) instead of computing RGB values (interpolation) with each replot (if the data changes), so it's a little bit faster than the older versions.
Is DEBUG_RENDER a compilation macro ? Do I need to rebuild the library in order to use it ?
I tried changing the format from RGB to Indexed and the replot crashes only if the QwtMatrixRasterData's setResampleMode is set to NearestNeighbour. Otherwise, with BilinearInterpolation the replot doesn't crash. Below the callstack of the crash :
Thread 1 (Thread 0x7fffcf98f980 (LWP 26954)):
#0 0x00007fffddc44348 in convertIndexedToARGB32PM(unsigned int*, unsigned int const*, int, QVector<unsigned int> const*, QDitherInfo*) () at /lib64/libQt5Gui.so.5
#1 0x00007fffddc4e581 in blend_untransformed_generic(int, QT_FT_Span_ const*, void*) () at /lib64/libQt5Gui.so.5
#2 0x00007fffddc7b6c6 in fillRect_normalized(QRect const&, QSpanData*, QRasterPaintEnginePrivate*) () at /lib64/libQt5Gui.so.5
#3 0x00007fffddc80d9d in QRasterPaintEngine::drawImage(QRectF const&, QImage const&, QRectF const&, QFlags<Qt::ImageConversionFlag>) [clone .part.109] () at /lib64/libQt5Gui.so.5
#4 0x00007fffddc9a3b7 in QPainter::drawImage(QRectF const&, QImage const&, QRectF const&, QFlags<Qt::ImageConversionFlag>) () at /lib64/libQt5Gui.so.5
#5 0x00007fffea6f5ef8 in QwtPainter::drawImage(QPainter*, QRectF const&, QImage const&) (image=..., r=<synthetic pointer>, this=0x7fffffffb540) at /usr/include/qt5/QtGui/qpainter.h:848
#6 0x00007fffea6f5ef8 in QwtPainter::drawImage(QPainter*, QRectF const&, QImage const&) (painter=painter@entry=0x7fffffffb540, rect=..., image=...) at ../../qwt-6.1/src/qwt_painter.cpp:665
#7 0x00007fffea7581b2 in QwtPlotRasterItem::draw(QPainter*, QwtScaleMap const&, QwtScaleMap const&, QRectF const&) const (this=<optimized out>, painter=0x7fffffffb540, xMap=..., yMap=..., canvasRect=...) at ../../qwt-6.1/src/qwt_plot_rasteritem.cpp:761
yInterval = {d_minValue = 9750, d_maxValue = 10750, d_borderFlags = {i = 2}}
paintRect = {xp = 0, yp = 0, w = 1229, h = 714}
area = {xp = 0, yp = 9750, w = 500, h = 1000}
imageRect = {xp = 0, yp = 1, w = 1228, h = 713}
yyMap = {d_s1 = 9750, d_s2 = 10750, d_p1 = 713, d_p2 = 0, d_cnv = -0.71299999999999997, d_ts1 = 9750, d_transform = 0x0}
xInterval = {d_minValue = 0, d_maxValue = 500, d_borderFlags = {i = 2}}
xxMap = {d_s1 = 0, d_s2 = 500, d_p1 = 0, d_p2 = 1228, d_cnv = 2.456, d_ts1 = 0, d_transform = 0x0}
br = {xp = 0, yp = 9750, w = 500, h = 1000}
image = <incomplete type>
pixelRect = {xp = 0, yp = 9750, w = 2, h = 7.8125}
#8 0x00007fffea740495 in QwtPlotSpectrogram::draw(QPainter*, QwtScaleMap const&, QwtScaleMap const&, QRectF const&) const (this=this@entry=0xd92010, painter=painter@entry=0x7fffffffb540, xMap=..., yMap=..., canvasRect=...) at ../../qwt-6.1/src/qwt_plot_spectrogram.cpp:645
#9 0x00007fffea721c00 in QwtPlot::drawItems(QPainter*, QRectF const&, QwtScaleMap const*) const (this=<optimized out>, painter=0x7fffffffb540, canvasRect=..., maps=0x7fffffffb320) at ../../qwt-6.1/src/qwt_plot.cpp:790
item = 0xd92010
it = {i = 0xd92b18}
itmList = @0xaf5e50: {<QListSpecialMethods<QwtPlotItem*>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = {<std::__atomic_base<int>> = {_M_i = -1}, <No data fields>}}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0xd92b00}, d = 0xd92b00}}
#10 0x00007fffea721e75 in QwtPlot::drawCanvas(QPainter*) (this=0x976300, painter=0x7fffffffb540) at ../../qwt-6.1/src/qwt_plot.cpp:755
maps = {{d_s1 = 9750, d_s2 = 10750, d_p1 = 713, d_p2 = 0, d_cnv = -0.71299999999999997, d_ts1 = 9750, d_transform = 0x0}, {d_s1 = -0.021730000153183937, d_s2 = 1.2283560037612915, d_p1 = 713, d_p2 = 0, d_cnv = -570.36075739376076, d_ts1 = -0.021730000153183937, d_transform = 0x0}, {d_s1 = 0, d_s2 = 500, d_p1 = 0, d_p2 = 1228, d_cnv = 2.456, d_ts1 = 0, d_transform = 0x0}, {d_s1 = 0, d_s2 = 1000, d_p1 = 0, d_p2 = 1228, d_cnv = 1.228, d_ts1 = 0, d_transform = 0x0}}
#11 0x00007fffea75176a in QwtPlotCanvas::drawCanvas(QPainter*, bool) (this=this@entry=0xa9ba40, painter=painter@entry=0x7fffffffb540, withBackground=withBackground@entry=false) at ../../qwt-6.1/src/qwt_plot_canvas.cpp:920
hackStyledBackground = <optimized out>
#12 0x00007fffea75398e in QwtPlotCanvas:aintEvent(QPaintEvent*) (this=0xa9ba40, event=<optimized out>) at ../../qwt-6.1/src/qwt_plot_canvas.cpp:761
p = {static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x7fffdddc5de0, data = 0x7fffdddc5d20, static_metacall = 0x0, relatedMetaObjects = 0x0, extradata = 0x0}}, d_ptr = {d = 0xea0290}}
bs = @0xa9b4b0: <incomplete type>
pixelRatio = <optimized out>
painter = {static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x7fffdddc5de0, data = 0x7fffdddc5d20, static_metacall = 0x0, relatedMetaObjects = 0x0, extradata = 0x0}}, d_ptr = {d = 0xb81410}}
I can see a call stack of an application ( Qwt 6.1 ) that is somewhere inside of the Qt raster paint engine ?I tried changing the format from RGB to Indexed and the replot crashes only...
Like always: use your debugger/sanitizer and/or come up with a small demo code showing the problem.
When using qmake use:
CONFIG += sanitizer
CONFIG += sanitize_address
otherwise have a look at -fsanitize... in the gcc/clang docs.
Uwe
PS1: doing bilinear interpolation is more expensive, than what you get from using a color table
PS2: Please allow me not respond to questions, where I have nothing to add to what I already wrote before
embeddedmz (12th July 2019)
Hi Uwe,
You can easily reproduce the crash with the "rasterview" example, the binary will crash at startup :
Qt Code:
{ public: ColorMap(): { addColorStop( 0.2, Qt::blue ); addColorStop( 0.4, Qt::cyan ); addColorStop( 0.6, Qt::yellow ); addColorStop( 0.8, Qt::red ); } };To copy to clipboard, switch view to plain text mode
The 6.2 is in beta right ? is it right to use it in production ?
Indeed the raster paint engine is running on a nullptr for the color map of the backing store of the canvas. It happens in convertIndexedToARGB32PM painting/qdrawhelper.cpp.
Seems like there is a bug, when drawing an Indexed8 QImage to a QPixmap. But as this does not happen with the spectrogram example it needs more investigation, what additional side effects are relevant here.
Like expected the problem does not happen, when using the X11 paint engine, that has been reintroduced with Qt 5.10. Using the X11 paint engine is recommended for all type of vector data ( curves ) as it makes use of hardware acceleration - in opposite to the raster paint engine, that is a pure software renderer. X11 can be enabled with "export QT_XCB_NATIVE_PAINTING=1" ( or "export QT_GRAPHICSSYSTEM=native" with Qt4 ).
Using X11 for a spectrogram ( or other raster data ) does not make the same difference as for vector data, beside you are running remote X11.
Note, that using setMaxRGBTableSize is not affected by this problem, as it does not create a Indexed8 image.
But anyway - there is a crash in the raster paint engine, that needs to understood. Maybe I can find a workaround and/or create a bug report for Qt, but it is kind of random when Qt development does fixes.
Uwe
embeddedmz (12th July 2019)
I set DEBUG_RENDER to 1 and compiled/tested Qwt in debug and release mode but qDebug won't work ! any idea how to fix that ? (the stuff in StackOverflow is outdated...) I could change qDebug by std::cout, but I want to know why this kind of stuff doesn't work when needed
Last edited by embeddedmz; 15th July 2019 at 10:44.
Cool are the bugfixes included in the qwt downloaded via :
Qt Code:
svn export svn://svn.code.sf.net/p/qwt/code/branches/qwt-6.1To copy to clipboard, switch view to plain text mode
?
Bookmarks