Friday, October 13, 2017

Bitten by cdrkit bug

At work, I recently ran into a problem that I eventually tracked down to a bug in cdrkit.  This glosses over a few steps, but should capture the essentials.

A computer that, among other things, is used for burning DVD's recently made the move from RHEL (Red Hat Enterprise Linux) version 5 to version 7.  We realized shortly there-after that it was failing to burn DVD's successfully.  After some testing, we found that the same problem occurred on another box with the exact same model of DVD drive.

After confirming that the model of DVD drive would still write using RHEL5, I took the cdrecord binary from RHEL5, ran it under RHEL7, and it worked.  Clearly the difference was between cdrecord (from cdrtools, used on RHEL5) and wodim (from cdrkit, which is aliased to cdrecord on RHEL7).

I ran both through strace, and found that for fixating (finalizing) the disc, cdrecord was using a timeout of 1000 seconds, while wodim was using 200 seconds.  On the drive in question, fixating the drive takes about 240 seconds.  So with wodim, the timeout is hit, some diagnostic codes are dumped, and wodim reports that the fixate process failed.

Digging into source code, I found that one of Red Hat's patches for cdrtools was injecting a function (fixate_mdvd) that extends the timeout to 1000 seconds, calls the original cdrecord fixate function (fixate_mmc), and restores the 200-second timeout.

That Red Hat patch became part of the cdrkit fork, but additional changes 1 made in 1.1.6 interfere with it.  In cdrtools, the time-consuming part of the operation is happening inside of scsi_flush_cache, which is called by fixate_mmc.  The change in 1.1.6 makes an additional call to scsi_flush_cache from fixate_mdvd, before it extends the timeout.  This essentially negates the effect of the timeout change for Disk-At-Once sessions.  This 1.1.6 change appears to have been made to solve a Debian bug 2, but I don't see the evidence that it helped anything. Even if it did appear to help, it may have just been hiding the real cause.

I believe the 1.1.6 change to fixate_mdvd should be reverted to fix the present bug.  If the bug in the Debian report is encountered again, more rigor needs to go into determining the root cause.


1 It's hard to find code history for cdrkit, but the change can be seen here: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/gutsy/cdrkit/gutsy/revision/8/wodim/drv_mmc.c
2 Debian Bug #411362: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411362

Thursday, October 12, 2017

Book Summary: Do Over by Jon Acuff


While I'm only commuting 4-5 hours in total most weeks, I want to make better use of that time, and I am getting a bit tired of just music on the radio.  Last week, I decided to start with listening to Do Over by Jon Acuff, and because I'm no quitter, I just reached the finish line with it.  As indicated by the title, this is not so much a review, as just a summary to help me remember some key points.


The core of the book is about making investments into your CSA.  That would be your Career Savings Account.  The components of the CSA are skills, relationships, character, and hustle.  Any time you encounter a career transition, voluntary or not, a healthy CSA will be a valuable asset.

That old phrase "it's not what you know, it's who you know" speaks to the importance of relationships to your career.  There is a lot of truth to this.  You may think you can pull yourself up by your own bootstraps, but the world was not designed that way.  We all need each other.


The skills that you know are still important though.  Relationships may help you get your foot in the door, but without skills, you'll still have a hard time getting to the next one.  In addition to the technical skills we may think of, soft skills like showing up reliably, diplomacy, and flexibility are valuable.

Character is who you are.  It will bleed into everything you do and touch everyone you know.  Jon likens it to an orchard, as it takes time and constant tending to develop it.  You won't see the fruit for a while, but it will come.

Hustle will have an amplifying effect on the other investments.  Frequency is key to strong relationships.  Time and effort are essential to sharpen and build new skills.  Constancy is required to grow character.  Hustle is about putting in the time, and time is key.

With a healthy, diversified CSA, you will be ready for any career transition, whether that be breaking through a ceiling, making a jump, recovering from a bump, or taking advantage of an opportunity.