I've encounted what I believe to be an error in either a) 
FileHandle.pm, b) Perl, or c) Linux 2.2.17.

I'm writing a bulkmailer (for legitimate resons).  I dump all the 
emails to a file sorted by domain.  My parent process begins reading 
the file and forks a "domain processor" whenever it encounter a 
'--mlm:', which seperates the domains.  The domain processor then 
begins reading where the parent stopped, since it in herited the 
parents filehandle.  Meanwhile the parent process beings looking for 
the next '--mlm:' line.

This is where the error occurs... The "domain processor", which is 
reading the data from the filehandle line by line, seems to skip 
2048, 4096, or 8192 bytes at seemingly random intervals.

I think that when I fork, I'm getting a copy of the file descriptor, 
but not a copy of the buffer.  Then, when my parent process moves on 
to the next 2k, 4k, or 8k block, the kernel cleans up that memory 
even though my "domain processor" is still reading from it.  I'd 
think that this would cause a core dump, but I'm not seeing any core 
files and my exit codes all look clean.

Does anyone have any suggestions as to what might be the problem?  In 
the short term, I will open a new file handle within the "domain 
processor" and use tell and seek which should work just as well...

Thanks,

Rob

--
Warning: The contents of this message are made of bits which may or may not
be an accurate representation of my thoughts.

Reply via email to