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/1377] seg fault inside getwc() when using LD_PRELOADed code


------- Additional Comments From kkylheku at gmail dot com  2009-11-13 00:25 -------
(In reply to comment #3)
> I'm going to try the workaround of implementing popen from scratch, so that 
> the stream is then just created with fdopen.

There is a much simpler workaround which may work well for some applications, 
like mine, which have already wrapped streams in an object that can be 
extended with extra context info.

The recipe is: Create the FILE * command stream with popen. Then pull out the 
file descriptor with fileno, duplicate it with dup, and use fdopen to create a 
new FILE * descriptor on the duplicate. Then use the new FILE * in place of 
the old for I/O operations.  Keep the original handle in order to call pclose, 
to collect the process exit status.


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1377

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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