talexb has asked for the wisdom of the Perl Monks concerning the following question:

I'm seeing a blob of NULLs in the log file for a script that's using Log::Log4perl, like this:

2315760 616f 2064 7661 7265 6761 7365 203a 2e30 o a d sp a v e r a g e s : sp 0 . 2316000 3133 3020 332e 2035 2e30 3233 000a 0000 3 1 sp 0 . 3 5 sp 0 . 3 2 nl nul nul nul 2316020 0000 0000 0000 0000 0000 0000 0000 0000 nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul * 2320000 3032 3432 302f 2f35 3130 3020 3a37 3034 2 0 2 4 / 0 5 / 0 1 sp 0 7 : 4 0 2320020 303a 2032 5245 4f52 2052 203a 2f2e 7263 : 0 2 sp E R R O R sp : sp . / c r
The output is from the command od -ha cpt3.log.1 | less. Based only on the fact that the NULLs end on a block boundary, I'm wondering if this might be a problem with the hard drive. Thoughts?

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Replies are listed 'Best First'.
Re: Seeing NULLs in my Log::Log4perl log file
by NERDVANA (Priest) on May 01, 2024 at 20:11 UTC
    Was there a reboot around that time? I sometimes see blocks of NULs written to log files (unrelated to Perl) if a machine lost power. I suspect it has something to do with the file metadata (saying the file now includes that block) getting committed to the drive before the contents of that block are fully written.

      Huh. Good catch. The response I was ready to post was "Nope, there were no reboots, and there were about a dozen other scripts that didn't exhibit this behaviour." -- but I thought, Meh, I better have a look.

      No one's supposed to touch this server, and (I believe) it's on a UPS, but it looks like someone power cycled it this morning at about 0730. That's not good. I'll have to investigate some more.

      Alex / talexb / Toronto

      Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.