Fixed memory corruption caused by Xft fonts jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 21 Sep 2015 21:17:16 +0100
branchjv
changeset 6918 c5cb9d5dfaae
parent 6917 9b45c9a1bab5
child 6925 4d77a816de2c
Fixed memory corruption caused by Xft fonts Recent freetype library seems to do a huge alloca()s which may (and actyally does) overrun to other's (Smalltalk) process stack segment, corrupting the memory badly. To solve this, declare (some) calls to Xft library as UNLIMITEDSTACK.
XftFontDescription.st
--- a/XftFontDescription.st	Wed Sep 09 16:32:20 2015 +0100
+++ b/XftFontDescription.st	Mon Sep 21 21:17:16 2015 +0100
@@ -680,7 +680,7 @@
 	drawIdIsShared := true.
     ].
 
-%{
+%{  /* UNLIMITEDSTACK */
 #ifdef XFT
     XftFont *font;
     XftDraw *draw;
@@ -1080,7 +1080,7 @@
 	]
     ].
     pix := aColor colorId.
-%{
+%{  /* UNLIMITEDSTACK */
 #ifdef XFT
     XftColor clr;
     if ( ! __isExternalAddressLike(drawIdArg) ) {
@@ -1135,7 +1135,7 @@
 	wObj := rect width.
 	hObj := rect height.
     ].
-%{
+%{  /* UNLIMITEDSTACK */
 #ifdef XFT
     XRectangle r;
     if ( ! __isExternalAddressLike(drawIdArg) ) {
@@ -1178,7 +1178,7 @@
 	]
     ].
     pix := aColor colorId.
-%{
+%{  /* UNLIMITEDSTACK */
 #ifdef XFT
     int _start, _stop;
     int __x, __y;
@@ -1345,7 +1345,7 @@
 xftFontMatch: displayId screen: screen pattern: patternId
     | error |
 
-%{
+%{  /* UNLIMITEDSTACK */
 #ifdef XFT
     XftPattern* p;
     XftResult r;
@@ -1382,7 +1382,7 @@
 xftFontOpenPattern: displayId pattern: patternId
     | error |
 
-%{
+%{  /* UNLIMITEDSTACK */
 #ifdef XFT
     XftFont* f;
     if ( ! __isExternalAddressLike(displayId) ) {
@@ -1650,7 +1650,7 @@
 
     extents :=  Array new: 6.
     bitsPerCharacter := text bitsPerCharacter.
-%{
+%{  /* UNLIMITEDSTACK */
 #ifdef XFT
     XGlyphInfo info;
     int bytesPerCharacter;