This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/19492] New: fgets() from multiple processes


https://sourceware.org/bugzilla/show_bug.cgi?id=19492

            Bug ID: 19492
           Summary: fgets() from multiple processes
           Product: glibc
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: tkur at dx dot sly.io
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Hi.
I read a file in a child process using fgets(). When child read some words,
child normally exits and parent forks new one, that continues to read file.
Second child process loses some data at the beginning. F.e. I have a file that
contains of:

aaaa
bbbb
cccc
dddd
eeee
ffff
gggg
hhhh

First child should read 4 words and it successfully do it. Then it exits,
parent forks new one. Second child should also read 4 words, but it reads this:

f
gggg
hhhh

Of course I read more data than 4 words. It is just example.
Why second process loses data?
OS Ubuntu 14.04
Thank you.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]