07.01.2015 20:09, Oliver Eichler пишет:
>
> >
>
> > The second patch fixes numerous warnings "Warning: QImage::setColor:
>
> > Index out of bound" and crash in displaying Garmin maps from
>
> > http://velo100.ru/gps/download (site in Russian) with stranger.typ.
>
>  
>
> I am not sure if that fix is so good. If the value is above 256 it's
> probably because some flags are stored with the value. In that case it
> would be interesting to know their function. Any chance to find that out?
>
>  
>
> Oliver
>
Hi Oliver,

warnings and crash are not related.

As I remember my debugging, decodeColorTable is sometimes called with
maxcolor=1<<16. This results in a series of warnings.

I reproduced the crash and include the output of gdb. Full output is in
attachment.

> #9  0x0000000000746b3d in CMapTDB::drawLabels
> (this=this@entry=0x1065d790,
>     p=..., lbls=...) at
> /usr/src/debug/qlandkartegt-1.7.7/src/CMapTDB.cpp:3010
> 3010            CCanvas::drawText(lbl->str, p, lbl->pt, Qt::black,
> fonts[lbl->type]);
> (gdb) print lbl->type
> $1 = 7
> (gdb) 
Vector fonts has size 5 but index lbl->type=7. I don't know why, so I
simply increased the size of vector to maximum possible value of
lbl->type. It is always masked with 7, when assigned.
Warning: QImage::setColor: Index out of bound 65532
Warning: QImage::setColor: Index out of bound 65533
Warning: QImage::setColor: Index out of bound 65534
Warning: QImage::setColor: Index out of bound 65535
Warning: libpng warning: iCCP: known incorrect sRGB profile

Program received signal SIGSEGV, Segmentation fault.
0x00000033bd1fa9a3 in QFontDatabase::load(QFontPrivate const*, int) ()
   from /lib64/libQtGui.so.4
Missing separate debuginfos, use: debuginfo-install 
lib64GConf2_4-3.2.6-4.mga4.x86_64 lib64ORBit2_0-2.14.19-10.mga4.x86_64 
lib64art_lgpl2-2.3.21-6.mga4.x86_64 lib64atk1.0_0-2.10.0-2.mga4.x86_64 
lib64avahi-client3-0.6.31-8.mga4.x86_64 lib64avahi-common3-0.6.31-8.mga4.x86_64 
lib64avahi-glib1-0.6.31-8.mga4.x86_64 lib64bonobo2_0-2.32.1-7.mga4.x86_64 
lib64bonoboui2_0-2.24.5-6.mga4.x86_64 lib64cairo2-1.12.16-2.mga4.x86_64 
lib64canberra-gtk0-0.30-4.mga4.x86_64 lib64canberra0-0.30-4.mga4.x86_64 
lib64dbus-glib1_2-0.100.2-2.mga4.x86_64 lib64drm2-2.4.51-1.mga4.x86_64 
lib64gail18-2.24.22-3.mga4.x86_64 lib64gbm1-10.0.5-1.1.mga4.tainted.x86_64 
lib64gcrypt11-1.5.4-1.mga4.x86_64 lib64gdk_pixbuf2.0_0-2.30.1-1.mga4.x86_64 
lib64gnome-keyring0-3.10.1-2.mga4.x86_64 lib64gnome-vfs2_0-2.24.4-5.mga4.x86_64 
lib64gnome2_0-2.32.1-11.mga4.x86_64 lib64gnomecanvas2_0-2.30.3-6.mga4.x86_64 
lib64gnomeui2_0-2.24.5-6.mga4.x86_64 lib64gpg-error0-1.12-2.mga4.x86_64 
lib64graphite2_3-1.2.4-1.mga4.x86_64 lib64gtk+-x11-2.0_0-2.24.22-3.mga4.x86_64 
lib64harfbuzz0-0.9.22-2.mga4.x86_64 lib64lcms2_2-2.5-2.1.mga4.x86_64 
lib64mesaegl1-10.0.5-1.1.mga4.tainted.x86_64 lib64mng2-2.0.2-3.mga4.x86_64 
lib64ogg0-1.3.1-2.mga4.x86_64 lib64pango1.0_0-1.36.1-1.mga4.x86_64 
lib64pango1.0_0-modules-1.36.1-1.mga4.x86_64 
lib64pixman1_0-0.32.4-1.mga4.x86_64 lib64popt0-1.16-5.mga4.x86_64 
lib64qtsvg4-4.8.6-1.mga4.x86_64 lib64tdb1-1.2.12-2.mga4.x86_64 
lib64vorbis0-1.3.3-4.mga4.x86_64 lib64vorbisfile3-1.3.3-4.mga4.x86_64 
lib64wayland-client0-1.3.0-2.mga4.x86_64 
lib64wayland-server0-1.3.0-2.mga4.x86_64 lib64x11-xcb1-1.6.2-2.mga4.x86_64 
lib64xcb-dri2_0-1.9.1-2.1.mga4.x86_64 lib64xcb-render0-1.9.1-2.1.mga4.x86_64 
lib64xcb-shm0-1.9.1-2.1.mga4.x86_64 lib64xcb-xfixes0-1.9.1-2.1.mga4.x86_64 
lib64xcomposite1-0.4.4-5.mga4.x86_64 lib64xdamage1-1.1.4-5.mga4.x86_64 
qt4-database-plugin-sqlite-4.8.6-1.mga4.x86_64
(gdb) where
#0  0x00000033bd1fa9a3 in QFontDatabase::load(QFontPrivate const*, int) ()
   from /lib64/libQtGui.so.4
#1  0x00000033bd1d8e19 in QFontPrivate::engineForScript(int) const ()
   from /lib64/libQtGui.so.4
#2  0x00000033bd20e962 in QTextEngine::fontEngine(QScriptItem const&, QFixed*, 
QFixed*, QFixed*) const () from /lib64/libQtGui.so.4
#3  0x00000033bd20f113 in QTextEngine::shapeTextWithHarfbuzz(int) const ()
   from /lib64/libQtGui.so.4
#4  0x00000033bd210212 in QTextEngine::shapeText(int) const ()
   from /lib64/libQtGui.so.4
#5  0x00000033bd210535 in QTextEngine::shape(int) const ()
   from /lib64/libQtGui.so.4
#6  0x00000033bd216140 in QTextEngine::boundingBox(int, int) const ()
   from /lib64/libQtGui.so.4
#7  0x00000033bd1ed224 in QFontMetrics::boundingRect(QString const&) const ()
   from /lib64/libQtGui.so.4
#8  0x00000000004e0f29 in CCanvas::drawText (str=..., p=..., center=..., 
    color=..., font=...)
    at /usr/src/debug/qlandkartegt-1.7.7/src/CCanvas.cpp:721
#9  0x0000000000746b3d in CMapTDB::drawLabels (this=this@entry=0x1065d790, 
    p=..., lbls=...) at /usr/src/debug/qlandkartegt-1.7.7/src/CMapTDB.cpp:3010
#10 0x0000000000754c66 in CMapTDB::draw (this=0x1065d790)
    at /usr/src/debug/qlandkartegt-1.7.7/src/CMapTDB.cpp:2151
#11 0x0000000000752b76 in CMapTDB::draw (this=0x1065d790, p=...)
---Type <return> to continue, or q <return> to quit---q
 at /usr/src/debQuit
(gdb) frame 9
#9  0x0000000000746b3d in CMapTDB::drawLabels (this=this@entry=0x1065d790, 
    p=..., lbls=...) at /usr/src/debug/qlandkartegt-1.7.7/src/CMapTDB.cpp:3010
3010            CCanvas::drawText(lbl->str, p, lbl->pt, Qt::black, 
fonts[lbl->type]);
(gdb) print lbl->type
$1 = 7
(gdb)   
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Qlandkartegt-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qlandkartegt-users

Reply via email to