Crash on xlanguage

A few months ago, when building a multilingual site with xlanguage, I found the site was crashed occasionally when xlanguage was enabled.
To fix the problem, I hacked the sections module to store different languages of contents with different column and let xlanguage watch slight contents only, like menu, titles, tables.

Yesterday pgroell reported the same problem. Very early this morning, I got his message:

i just found this on the net, maybe it ’s the problem.
http://www.phpbuilder.com/lists/php-documentation-list/2003101/0039.php
A bug in Php, I’m using php 4.3.10, and don’t know if this has been fixed.

And then, the original bug report at php.net:

From http://www.pcre.org/pcre.txt, LIMITATIONS:

“The maximum length of a subject string is the largest
positive number that an integer variable can hold. However,
PCRE uses recursion to handle subpatterns and indefinite
repetition. This means that the available stack space may
limit the size of a subject string that can be processed by
certain patterns.”

It should be noted that the maximum amount of data between pairs of tags
in this PCRE case is not a constant as it differs between platforms,
even with the same installed PHP versions. On a Debian box, I was able
to process about 11650 bytes between to matching div tags.

Seems I was so lucky, using a silly but right solution before knowing the causes.
There will be some related documentation for xlanguage.

Thanks pgroell.

multilingual: OpenType FontFonts and the Languages They Speakmultilingual: Erika - vilnius.cafebabel.commultilingual: Fantastic RTL Support in Drupal

11 Comments

  1. Pingback by XOOPS CHINA :: GPL | PHP | MySQL | BLOG | CMS - WordPress:

    […] This is copy from XPress. […]

  2. Comment by ccv_ddeus:

    x-language crash my site too :( . when we are making the translation of the modules cannot miss because if we wandered when executing the modifications the site crash

  3. Comment by David:

    x-language is a great module.

    So simple yet powerful - an elegant piece of work!

    However, for those of you who may be having trouble with an “Internal Server Error” when using xlanguage with extra long articles.

    I found if you break the tagged text section into a couple of chunks, it works perfectly.

    In other words, don’t have one humungous english block followed by an equally humungous japanese block. Break each text block into sections using x-language tags.

    That is all

    Merry Christmas 2005

  4. Comment by tamarix:

    This module is really elegant for translation and I find i really useful.

    There is still some bugs. For example, having several translations of a news (news module) title and asking to show the ‘recent news’ blocks gives the Famous blank page.

    That is surprising because if we look directly to the news, the translation is well done in the title.

    Thanks to the developpers for the work done !
    Franck

  5. Comment by Pierre:

    this module could be excellent.. anyway, i had this Internal Server Error, i have lot of small word that should be translate french/english for a menu (with many many items) and also image or javascript. nothing more for now ;(

  6. Trackback by Buy Dalacin C:

    Buy Dalacin C…

    Buy Dramamine | Cheap Nizoral Ketoconazole 200 Mg | …

  7. Comment by jdferjy:

    ????????IT??????????????????????????????DTP????WEB

  8. Comment by djnddn22:

    ????ITgl?U??`??|???UDTP??WEB

  9. Comment by xiaoxiao:

    www.xytfy.com Xinyitong translation

  10. Comment by xiaoxiao:

    www.e-fanyi.com.cn

  11. Comment by Cozzie:

    My problem is similar but a little different.

    The Recent Comments Block (wp_comments.php) can’t display the excerpt in 2 languages. I translate all comments in to my site’s other language so that the site is totally bilingual.

    But this causes a big problem for the comments excerpt used in the recent comments block.

    In the blocks administration you must define how many characters the excerpt will be but if the comment is added in 2 languages it almost always exceeds this number. The results is that the language tags can’t be read properly because only part of the comment (the excerpt)is being read.

    The result on screen is that the page display goes crazy and langauge tags are shown.

    If I turn the recent commments block off everyting is ok but I really need this feature.

    After reading this thread I realised the solution is to split the language tags up in to 2 sets with the first tag exactly matching the number of characters defined for the excerpt.

    Like this:

    [en]comment in english starts here[/en][zh]the same thing translated[/zh][en]and is finished here[/en][zh]and the translation is fininished here[/zh]

    In this case the permitted value for the excerpt must be 73 characters (ie the 1st language tag set). If it is even one character more or less the page will not display properly because the set of language tags have not been read properly.

    I’ve tried entering all my comments like this but it takes too much time and I often have mistakes (when I miscounted).

    Can anybody tell me how to better deal with this problem?

    If not can someone tell me how to change the wp_comments.php file in wordpress/blocks so that instead of displaying the comment excerpt the Post Title is displayed each time a new comments is added. This would solve the problem also

    Thanks a lot! And I hope I’ve explained it ok!!

Leave a comment