Hi,

This patch works very well.


Kr

Mel


________________________________
From: Niko Tyni <[email protected]>
Sent: Saturday, June 30, 2018 8:27 PM
To: [email protected]
Cc: Gavin Smith; Melvin Mawhin
Subject: Re: Infinite loop generating QEMU docs after upgrade to Perl 5.28.0

Hi, I believe I've found the issue with makeinfo on Perl 5.28.

Aside from the trivial unescaped left brace things, there's a change
in locale handling that can indeed cause a busy loop for some inputs
under non-UTF8 locales.

I've been able to reduce the necessary input to just two lines:

  @documentencoding UTF-8
  @indicateurl{foo}

The busy loop happens in xspara__add_next()
(Texinfo::Convert::XSParagraph) when mbrtowc(3) returns -1, indicating
an invalid multibyte sequence even though it is valid UTF-8.

Perl 5.28 introduced thread-safe locales, where setlocale() only affects
the locale of the current thread. Apparently external code like mbrtowc(3)
isn't aware of this thread specific locale without special handling.

I'm attaching a patch that fixes this for me, and another one for the
necessary left brace escaping. Even with this, I suppose xspara.c could
use some mbrtowc(3) return value checks.

Some pointers:

 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmetacpan.org%2Fpod%2Fdistribution%2Fperl%2Fpod%2Fperldelta.pod%23Locales-are-now-thread-safe-on-systems-that-support-them&data=02%7C01%7C%7C32812a55a29a47253c6b08d5deb71b44%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636659800370669808&sdata=2D%2ByWbpJrVhkSUennUsu0Fp0EizHByIGLVJyg9vtuEc%3D&reserved=0
 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmetacpan.org%2Fpod%2Fdistribution%2Fperl%2Fdist%2FExtUtils-ParseXS%2Flib%2Fperlxs.pod%23CAVEATS&data=02%7C01%7C%7C32812a55a29a47253c6b08d5deb71b44%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636659800370669808&sdata=4KJz%2BqnPrK4lgtv9vX2fjTYODu2rXngW%2BmPfvVgVE1M%3D&reserved=0
 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fperl5.git.perl.org%2Fperl.git%2Fcommitdiff%2Fe9bc6d6b34a&data=02%7C01%7C%7C32812a55a29a47253c6b08d5deb71b44%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636659800370669808&sdata=MiXfEdLzhCFbafsC%2FzCCDb1jwQMYn8WWc%2BPwaPnOezU%3D&reserved=0
 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fperl5.git.perl.org%2Fperl.git%2Fcommitdiff%2F58e641fba50&data=02%7C01%7C%7C32812a55a29a47253c6b08d5deb71b44%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636659800370669808&sdata=2OhndDPpYQdybHbCggPTwt%2B3Ht6w2BL%2B5%2BD9xjEj6Ag%3D&reserved=0

Hope this helps,
--
Niko Tyni   [email protected]

Reply via email to