Bug 78588 - hang while reading a file in UTF-8 mode
hang while reading a file in UTF-8 mode
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: perl (Show other bugs)
8.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Warren Togami
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-11-25 20:02 EST by Christopher Blizzard
Modified: 2013-01-10 16:39 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-11 07:47:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test script (133 bytes, text/plain)
2002-11-25 20:07 EST, Christopher Blizzard
no flags Details
test data (3.69 KB, text/plain)
2002-11-25 20:08 EST, Christopher Blizzard
no flags Details

  None (edit)
Description Christopher Blizzard 2002-11-25 20:02:33 EST
Description of Problem:

Hang when reading a UTF-8 file.

Version-Release number of selected component (if applicable):

perl-5.8.0-55

How Reproducible:

Every time.

Steps to Reproduce:
1. Use attached script and file.
2. Run script.

Actual Results:

Script hangs.

Expected Results:

Script should complete.

Additional Information:
	
This hangs in the line:

while (<FOO>)

so it's hanging while reading data from the file.
Comment 1 Christopher Blizzard 2002-11-25 20:07:34 EST
Created attachment 86426 [details]
test script
Comment 2 Christopher Blizzard 2002-11-25 20:08:07 EST
Created attachment 86427 [details]
test data
Comment 3 Christopher Blizzard 2002-11-25 20:21:13 EST
This is preventing me from getting mozilla translations in for our translations
team.
Comment 4 Christopher Blizzard 2002-11-25 21:34:49 EST
Seems to be getting stuck here:

#0  0x400eace4 in Perl_is_utf8_char ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#1  0x400eadf6 in Perl_is_utf8_string ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#2  0x4009b97f in Perl_sv_utf8_decode ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#3  0x400f04cf in XS_utf8_decode ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#4  0x400958c5 in Perl_pp_entersub ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#5  0x4008e059 in Perl_runops_standard ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#6  0x40036139 in S_call_body ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#7  0x40036047 in Perl_call_sv ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#8  0x400359f6 in Perl_call_method ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#9  0x40125fa9 in PerlIOEncode_fill ()
   from
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/auto/PerlIO/encoding/encoding.so
#10 0x400f3c38 in Perl_PerlIO_fill ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
---Type <return> to continue, or q <return> to quit---
#11 0x400f447f in PerlIOBase_read ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#12 0x400f6129 in PerlIOBuf_read ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#13 0x400f38e6 in Perl_PerlIO_read ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#14 0x400f7bc2 in PerlIO_getc ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#15 0x400a03a7 in Perl_sv_gets ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#16 0x40092012 in Perl_do_readline ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#17 0x4008ebd2 in Perl_pp_readline ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#18 0x4008e059 in Perl_runops_standard ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#19 0x400355bb in S_run_body ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#20 0x40035355 in perl_run ()
   from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
#21 0x08049173 in main ()
#22 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6
Comment 5 Chip Turner 2002-11-29 19:59:00 EST
I'll submit this upstream, looks like a pretty definite and nasty bug.  In the
meantime, can you try this workaround?  instead of using binmode, open the file
in utf8 encoding:

open (FOO, "<:utf8", "contentAreaCommands.dtd") || die();

alternatively, if LANG is set to something resembling utf8, perl will default to
utf8 IO
Comment 6 Christopher Blizzard 2002-12-02 13:09:43 EST
Using :utf8 works.  Thanks!

The encoding() example is actually from the perl documentation.
Comment 7 Chip Turner 2002-12-15 18:18:01 EST
try rawhide's perl; it should fix your original problem (workaround should still
work, too, of course)

Note You need to log in before you can comment on or make changes to this bug.