zwol: stylized sketch of a face in profile (Default)
[personal profile] zwol
I knew I was asking for trouble by forking and not execing, and even more trouble by messing around with the file descriptors for stdin/out/err in the child process. I crossed the i's and dotted the t's and sacrificed the goats, and that seems to have prevented everything that I knew could go wrong, but this ... this is new and different and I have no fraggin' clue how to fix it: data written to stdout is showing up in a different stdio-opened file, one that has never had anything to do with stdin or out or err. But only part of it, and only intermittently, and (of course) never under strace.

Date: 2007-08-17 06:10 am (UTC)
From: [identity profile] aldren.livejournal.com
You wouldn't happen to be writing to a FILE descriptor allocated on the stack, would you? You could try fprintf(stderr) the fd of the FILE handle, and see if it's what you expect it to be.

I've forgotten what a FILE consists of, but I do know fd is one of its members.

Or it could likely be ghosts.

Date: 2007-08-19 09:52 am (UTC)
From: [identity profile] zwol.livejournal.com
We're going with the ghost theory over here.

Date: 2007-08-19 05:48 pm (UTC)
From: [identity profile] aldren.livejournal.com
If you're running under a BSD or Solaris, try running it normally, but coreing it using gcore.

If you're running under Linux, your distro may have gcore, but you may also want to look at Google's coredumper, which will (I believe) allow you to programmatically create a core file using a function call.

April 2017

S M T W T F S
      1
2345678
9101112131415
16171819 202122
23242526272829
30      

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 3rd, 2026 04:24 am
Powered by Dreamwidth Studios