Bug 92195

Summary: Perl extension hangs on file I/O
Product: [Retired] Red Hat Linux Reporter: John Sintilas <john>
Component: perlAssignee: Jason Vas Dias <jvdias>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: high    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ALL Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-11-12 00:59:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test code to reproduce error none

Description John Sintilas 2003-06-03 19:15:06 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; .NET 
CLR 1.0.3705)

Description of problem:
When working with files(opening, reading, seeking, closing) from within a Perl 
C extension, the program will hang during one of the file operations, usually a 
fseek. I haven't tested this on RedHat 8 yet, but previous versions of RedHat 
prior to that all work with this code on perl v5.8.0. I have condensed the C 
code and perl script to the bare minimum to reproduce the error. My 
installation of RH9 is a complete install, all available packages are already 
installed. 

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

How reproducible:
Always

Steps to Reproduce:
1. After unzipping the files, compile the C code using the following command: 
    gcc -O -c -I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE *.c

The path following -I is where your perl.h,EXTERN.h,and XSUB.h files should be 
located by default. The CAtest_wrap.c file may give errors for crypt.h, if that 
happens use this instead: 
    gcc -O -DGNU_SOURCE -c -I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE 
*.c

2. Link the objects into CAtest.so using the command:
    ld -G -o CAtest.so *.o
3. Run the perl script test_4CA.pl 
    

Actual Results:  Hangs after displaying "Ok after read".

Expected Results:  The program should complete after the "Ok after read" 
message and should return control of the shell to the user. 

Additional info:

I have noticed that running the perl script with MALLOC_CHECK set seems to 
alleviate the hanging, but using that isn't an option on the client end and 
would probably degrade performance significantly. You can test this by typing 
MALLOC_CHECK_=1 perl test_4CA.pl

Comment 1 John Sintilas 2003-06-03 19:16:43 UTC
Created attachment 92121 [details]
Test code to reproduce error

Comment 2 John Sintilas 2003-06-04 17:20:40 UTC
I just tested the same code on a clean install of RedHat 8.0 and it runs with 
no problems, so this is definitely a version 9 issue.

Comment 3 John Sintilas 2003-06-04 20:07:54 UTC
Correction to step 1, -DGNU_SOURCE should actually be -D_GNU_SOURCE. Sorry for 
any confusion. 

Comment 4 Jason Vas Dias 2005-11-12 00:59:11 UTC
Sorry this bug seems to have been overlooked.
This bug is not a problem with any current Red Hat perl releases.