* Xdec crashing
@ 2000-02-25 5:00 Dan Forrest
0 siblings, 0 replies; only message in thread
From: Dan Forrest @ 2000-02-25 5:00 UTC (permalink / raw)
Wondering if anyone has seen this before.
I have an application that writes rotated text (90, 180, or 270
degrees) using the following steps:
1) Create a pixmap (XCreatePixmap) to hold the text
2) Write the text (XDrawImageString) to the pixmap
3) Get the pixels from the pixmap (XGetImage)
4) Rotate the image data
5) Write the rotated pixels to the window (XPutImage)
This has worked without problems on all kinds of X-servers. We are
now experiencing random core dumps with Xdec under OSF1 V4.0D. From
an analysis of the core dump, it appears that Xdec is writing over
areas of memory with data intended for the pixmap. Further testing
shows the following pattern:
String Result (in pixmap after XDrawImageString)
A A
AB AB
ABC ABC
ABCD ABCD
ABCDE ABCDE
ABCDEF ABCDEF
ABCDEFG ABCDEFG
ABCDEFGH EFGH
ABCDEFGHI DEFGHI
ABCDEFGHIJ CDEFGHIJ
ABCDEFGHIJK BCDEFGHIJK
ABCDEFGHIJKL EFGHIJKL
ABCDEFGHIJKLM DEFGHIJKLM (the server crashes around here)
ABCDEFGHIJKLMN CDEFGHIJKLMN
ABCDEFGHIJKLMNO BCDEFGHIJKLMNO
Once the string is longer than 7 characters, the first (4 - (N % 4))
characters are apparently not drawn to the pixmap, but instead into
some random part of the server memory.
The workaround I am using is to make "N" calls to XDrawImageString
each with length one, instead of one call with length "N" (i.e. draw
the text into the pixmap one character at a time). This seems to
work, but we only figured it out yesterday and haven't done extensive
testing.
Has anyone seen this before? Known problem? Patches available?
--
Dan
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-02-25 5:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-02-25 5:00 Xdec crashing Dan Forrest
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox