No Decode Delegates… and Conflicts

It’s not often that we run into unusual conflicts rooted in hard to find places, but those few times that they are encountered–no matter how rare–can be infuriating. I was recently bitten by this one, demonstrated by a particularly bizarre error when attempting to load an image (any type) into the php-imagick ImageMagick extension:

$ php -a 
Interactive shell
 
php > $c = new Imagick('kmix.png');
PHP Warning:  Uncaught exception 'ImagickException' with message 'no decode delegate for this image format `kmix.png' @ error/constitute.c/ReadImage/552' in php shell code:1
Stack trace:
#0 php shell code(1): Imagick->__construct('kmix.png')
#1 {main}
  thrown in php shell code on line 1

Yet, paradoxically, convert -list delegate, convert -list configure, and convert -list format all hinted that PNG and JPEG support were both installed. Worse, searching for “php imagick no decode delegate” resulted in few useful hits, and of those hits most were indicative of configuration problems, custom builds missing the appropriate libraries, and other dilemmas punctuated by the usual PEBKAC retort (though such accusations are sometimes accurate).

Nothing worked, of course. Swapping out to older versions of ImageMagick failed, and I had no intention of trying an earlier version of PHP or php-imagick. At this point, I had no expectations to find the solution online, and the only thing I surmised might work would be to attempt duplicating the problem on another machine. So, I set about installing ImageMagick (v6.8.5-10) and php-imagick (v3.0.1 plus PHP 5.4 patches and v3.1.0RC2) with the current-latest version of PHP available in the Arch repositories (v5.4.16) and quickly discovered that it worked quite well. This was a positive sign: Nothing about the latest builds indicated there was a problem, so it was plausible that the problem lurked elsewhere.

And it did.

I soon noted that the virtual machine I booted was lacking php-gmagick and GraphicsMagick both, though ImageMagick and GraphicsMagick worked quite well on my machine together. Thus, I speculated that perhaps php-gmagick was conflicting somehow with php-imagick. I commented out the gmagick extension, re-ran some unit tests, and presto! php-imagick was now working perfectly fine. Uncommenting the gmagick extension resulted in a return of the problem, and so I was (and am) convinced that the problem is a conflict between both extensions. Possibly, this is due to the definition of symbols or other such nonsense in gmagick that imagick requires (and is very upset when it discovers they already exist).

Is it possible to get them to play nicely together? Maybe.

On my machine, PHP extensions and their options are loaded from /etc/php/conf.d. These files are, apparently, loaded alphabetically in order, and since “G” comes before “I,” you might imagine (correctly) then that gmagick gets loaded before imagick which is where the magic stops (my apologies; that pun was awful). By renaming them to something creative, such as “10-imagick.ini” and “20-gmagick.ini”, it is then possible to force imagick to load before gmagick, and they’ll both work cooperatively near as I can tell. Perhaps gmagick defines–but doesn’t use–some interpreter symbols that imagick actually needs, but if they’re already defined gmagick doesn’t care? I don’t know. I can only speculate, because I know next to nothing about PHP internals. (Perhaps now might be a good time to start.)

Although renaming or otherwise moving the extension configs into an order that would suggest imagick.so gets loaded first seems like an adequate solution, the problem is that these two extensions most assuredly do conflict. Between PHP versions, you can’t be guaranteed that the loader mechanism for extensions will remain static and thus the possibility exists that renaming the *.ini files is only an ephemeral solution. Moreover, it’s also possibly an accident that it works on my machine; perhaps the inode order is such that imagick.so now gets loaded before gmagick.so simply due to luck. Or maybe I’ve now reduced it to a race condition? The point is that you shouldn’t rely on this in production. Instead, you should select between GraphicsMagick or ImageMagick, picking the one that best fits your use case. If you’re using a wrapper library to select the best backend available, force it to load a specific one in production mode. Obviously such concerns aren’t much of a bother on a development box, but I’d nevertheless recommend a healthy dose of caution.

If you’ve encountered this issue yourself but never found a reasonable solution, let me know. If this article helps in any measurable way, I’d be happy to hear from you. It’s been a frustrating few hours for me, and I hope that this will at least alleviate you of wasting further time on something that is poorly documented but easy to fix.

2 comments.
***

KDE 4.10 Upgrade and Disappearing Windows

So, KDE 4.10 just came out last week, the Arch repos sometime thereafter, and I updated today. I really love new versions of KDE–honestly–but this time something really bizarre happened. I updated, rebooted to the new kernel (I was running 3.7.4, the update was to 3.7.6), fired up KDE, and started loading my usual applications.

Then nothing worked quite right. I’d open one window, and the others I had open would disappear. Opening the launcher would also exhibit this problem: Open terminal windows would disappear the instant the launcher was clicked or any other application (including Dolphin) was opened. Infuriating. It seemed that I couldn’t have all my usual windows open at once–everything would disappear!

Fortunately, after some trial and error, I found the culprit. This latest version of KDE has made significant changes to ~/.kde4/share/config/kconf_updaterc. So, there’s two solutions:

Easy Mode

Log out, switch to a virtual terminal (ctrl+alt+F1), log in from there, and delete the file ~/.kde4/share/config/kconf_updaterc. Then switch back to X (usually ctrl+alt+F7 or F8) and log back in to KDE so it regenerates the file. Enjoy!

Hard Mode

Follow the previous steps but retain a backup of your .kde4 directory. Then run a diff on the two versions of kconf_updaterc and figure out what you want to keep, what line caused the problem, and retain as many of your previous settings as possible.

Otherwise, I hope this saves you some difficulty if you run into the same thing I have!

February 13th edit:

It seems that this post by “George” on the Arch Linux forums indicates a potentially easier solution, which is to change the window transparency settings. I changed the title transparency settings, but I’m not entirely sure if this will resolve the disappearing windows.

No comments.
***

Why Smart Posts Start Arguments

Effective sub-titles or substitute titles for this article would be “Why Arguing on the Internet is Stupid, Like Setting your Genitals on Fire” or “People Just Like Being Assholes.” But, neither of these seemed catchy enough. I’m sorry, folks, but you’re stuck with what I’ve decided to put in the title bar.

You’ve probably posted something somewhere on the Internet at some point in recent memory, and if you’re a friend of mine it was guaranteed to be a thoughtful, inspirational post (I don’t have dumb friends). So, whether it was on a forum, on a mailing list, on Reddit, or even Facebook, why did your post accumulate dozens of inflammatory remarks? Moreover, why does it often seem that a non-trivial subset of these comments are made in disagreement with your post simply for the sake of disagreement rather than to counter your claims with a substantive riposte?

Fortunately for you, I suffered through a mostly sleepless night laying awake with this question fresh in my mind after having observed (and partaken in) a few discussions on the cultural brewery that is Reddit with the occasional flashback to Slashdot debates, message board posts, and lurking mailing lists watching the ebb and flow of intellectual titans duking it out for all to see.

First, let’s start off with a typical scenario. Someone–probably you–has posted a fairly lengthy, carefully articulated post that delves into a given subject with greater depth than 99.9% of the other contributions. Upon a cursory glance, your immediate competition consists of numerous repeated memes and one-liners, often duplicated with varying degrees of accuracy, and a handful of insightful (but short!) gems that may or may not be applicable to the discussion. Most of these serve as fodder and bait for community members with frighteningly short attention spans. If the post in question is longer than 3 or 4 paragraphs, most genuine replies (those that aren’t “TL;DR”) typically won’t appear for over an hour–anything that appears within 30 minutes or less of the original post may contribute slightly more than other, more immediate, ones, but don’t get your hopes up. Substantive replies take time, because it takes time to read, digest the material, and respond.

In a best case scenario, days will wax and wane, other posts appear to divert attention away from your masterpiece, and no one responds. Worst case, your clever post will attract one of the following three types of replies: 1) Grammar Nazis, 2) visitors looking for disagreement or something to attack, and 3) other intelligent people seeking conversation. Interestingly, upon further analysis, we’ll find that #1 and #2 share many of the same attributes and are actually subsets of the same classification of responses.

First, we’ll deal with the third, because it is the rarest of the three: Intelligent people seeking conversation. Although it’s exceptionally rare, depending on medium, other intelligent people will occasionally find themselves engaged enough in a particular thread that they feel the need to respond. Their replies are often the easiest to identify, because they take the same amount of time to cautiously articulate their reply. Further, any disagreement felt by other intelligent people is usually (but not always) toned down and grounded in established facts. This is because intelligent people are well aware that the best way to be read among an aggregate of mixed quality posts is to disagree politely. Although terse disagreements do happen with intelligent people (Linus Torvalds comes to mind), they’re often the exception rather than the rule, because smart people are also well aware that inciting emotional response is a waste of time. To wit, unleashing an emotional torrent of replies simply wastes valuable screen real estate and precious bandwidth that could otherwise be spent discussing more intellectually valuable subjects. Of course, the smart person will occasionally troll and do so precisely to accomplish the exact opposite of meaningful discussion, but those who find themselves in the crosshairs of such a response are usually targeted for a specific reason.

Second, we’ll discuss one of the most common responses given to smart posts: Grammar Nazis. Grammar Nazi posts are seldom worth a reply. In most cases, the Grammar Nazi is seeking validation because of a personality deficit, or they’re trolling. Regardless of what the Grammar Nazi states, very few commit to the activity with the intention of genuinely engaging others. Instead, corrective posts are done so on a whim as a knee-jerk reaction to a particular grammatical or spelling error, and the rationale provided (I’m only doing this to help!) surfaces as a secondary response whenever the Grammar Nazi is confronted with a need to justify their initial post. Good intentions are very infrequently the motivation for this sort of reply, and if in doubt, it’s usually possible to examine the poster’s past history to determine whether or not it’s a matter of habit. If you absolutely must reply to the Grammar Nazi, it sometimes helps to dig up a mistake they made in a recent post to help illustrate the absurdity of their behavior. After all, no one’s writing a dissertation if they’re partaking of something intended as a means of informal communication.

Finally, the last type of common response smart posts tend to accumulate (there are others, but for this post I’m only examining these three) is the one that’s essentially little more than disagreement for the sake of disagreement. It’s difficult to think of a specific example, because this type of response is that common. Nevertheless, the motivation is usually the same. Disagreement for the sake of disagreement is usually perpetrated by community members who know just enough to be dangerous. They’re the sort who require constant self-validation and reassurance, and it brings a great deal of joy to their day whenever they can isolate an intelligently constructed post and, right or wrong, tear it to shreds with “logical” rebuttals. The hallmark of the disagreement for the sake of disagreement is often the strawman logical fallacy wherein the respondent intentionally restructures, rewords, or otherwise misrepresents statements made in the original post in effort to argue against it more easily. Unsurprisingly, the strawman is also a favorite of the troll, and disagreement for the sake of disagreement is a vehicle used by many novice trolls.

As I mentioned earlier, Grammar Nazis and those who perpetrate disagreement for the sake of disagreement (heretofore known as “disagreers,” to invent a word) do share a surprising number of traits. First and foremost, both groups demonstrate a disconcerting degree of hyper-corrective behavior; that is, they exhibit a strongly emotional need to correct other people, usually for the purpose of self-validation. Furthermore, Grammar Nazis and Disagreers sometimes make up for their hyper-corrective behavior what they lack in self-esteem. This pretentiousness, this inherent desire to constantly demonstrate to the world and to themselves (though usually more to themselves), motivates both far more than the desire to engage in meaningful discourse.

Where Grammar Nazis and Disagreers differ is sometimes, but not always, in terms of facts. Grammar Nazis, particularly established and experienced ones often have sufficient resources and expertise at their disposal that they can quickly provide citations for their particular pet peeves. Although it’s also likely that such citations are simply the result of practice and the accumulation of data related to a handful of external resources (or, optionally, the direct result of Google). Put another way, if you’re especially bothered by a very specific mistake, you’ve probably linked to an authoritative source at least once or twice before, and subsequent interactions are relegated to “more of the same.” Disagreers, on the other hand, generally have more legwork to accomplish if they wish to rely on facts. Although it’s rare, it’s not unheard of for someone who wishes to validate their own intellectual superiority through disagreement by searching for and supplying sources supporting their claims. However, because such an affair requires a great deal of effort, most Disagreers find it easier to resort to the strawman. Therefore, Grammar Nazis tend to rely on citation boilerplate (think canned response), and Disagreers usually rely on the strawman, changing the premise or altering the context of the argument in such a manner that it’s easier for them to dispute.

You may have noticed that I haven’t yet answered the question “why smart posts start arguments?” Don’t worry–I haven’t forgotten. Before I can even begin to answer why this happens, it’s necessary to illustrate a little bit more about the people who usually start the arguments in the first place. The more time you spend understanding their motives, the more effectively you’ll be able to respond (or not) to the onslaught.

First off, while memes and other oft-repeated statements are excellent fodder for people looking for a jovial but shallow interaction, smart posts are fodder for those who seek to conflate their own feeling of superiority, particularly if they first go unnoticed by other smart people who appreciate friendly, intellectual discourse. It has taken me a while to figure out why this might occur, but I think I finally have it pinned down.

Intermission: It’s somewhat ironic, but in the rare circumstance that another smart person notices your post, it reduces the likelihood that disagreement for the sake of disagreement will occur; it might be that this then becomes a matter of safety in numbers. Disagreers, Grammar Nazis, and trolls will then fear being washed out to sea–leastwise, the ones who remain and haven’t gotten bored by trawling through pages of intellectual discussion looking for an opening.

In the midst of interpersonal communication (that is, face-to-face), we have access to a whole side channel of additional out of band communication. There’s body language, verbal cues, inflections, distractions, and a distinct absence of anonymity and the Internet. You may be surprised about that last bit, but I can assure you: It’s there for a reason (I’ll touch on that in a minute). First, Grammar Nazis are automatically excluded due in part to the distinct lack of chat bubbles in real world communications, and second because their timidness is often a prohibitive cost to the awkwardness of interruption conversational flow just to point out that one particular word shouldn’t be used over another. Colloquialisms are the Grammar Nazi’s bane, and so most informal discussions aren’t something they find inclusive. Second, the advantages Disagreers have whenever they’re tucked away behind a screen suddenly evaporate when faced directly with those they’d accuse of being wrong. Certainly the lack of anonymity is important, but so too is the lack of Internet access.

If you recall in my discussion about disagreement for the sake of disagreement, I mentioned that Disagreers will often spend an inordinate amount of time looking up facts with which to slam their targets. While they don’t always do this (the strawman is easier), devout Disagreers will take the time to search for facts–no matter how dubious–supporting their claims. After all, to them, the appearance of sourcing authoritative information is more important than the information itself. Unfortunately, without Internet access and the asynchronous medium of message boards, the synchronous nature of in-person communication usually eliminates any chance to look up factoids on the nearest smart phone (and most people in a conversational tone will simply blow off anything of the sort). Think of it this way: In a conversation with a university professor, facts and figures offered up by the professor will most likely be devoured by those present since they have an active interest in the conversation (“Wow! That’s interesting!”), whereas an uncomfortable pause by another 20-something so he can look down at his smart phone met shortly thereafter with “actually, that’s not true!” is unlikely to go well noticed. For one, the professor is an authoritative source. In contrast, facts offered up by the smart phone reader cannot be independently confirmed as authoritative, and the interruption of conversation (not to mention the trains of thought) is usually seen as pretentiousness if not outright annoying.

I understand that the previous examples are somewhat contrived. There will always be groups of friends with a “fact-o-phile” in the group who likes to look up the weird and unusual for the sake of sharing (sharing is caring) and for the sake of starting new conversation. There will always be a few students who, even in one-on-one conversation with their professors, will always second guess everything stated as fact (channeling the Disagreer mentality–perhaps in some strange twist, the encouragement of “always second guess everything” in taught to students in some fields of study is responsible for this). Generally, though, my assumptions in these cases are that 1) students following around a professor to talk with him or her usually do so because they have an interest in what the professor says and 2) in sufficiently large groups of people, there will invariable be at least one person who has an innate, almost borderline-manic need to disagree with and correct everyone nearby. Fortunately, the latter type of person is far rarer in person than they are online. (N.B.: Do not confuse this type with the pessimistic contrarian who largely disagrees because of their exceptional pessimism and not through any mechanism of self-validation which they wouldn’t care about anyway!)

I believe that anonymity brings out the worst in us at times, and that’s partly why I believe that Disagreers are the most likely to seek out smart posts and respond. It isn’t necessarily that smart posts are arrogantly asking for dispute. It’s that some people just can’t help themselves online. Call it pretentiousness, call it arrogance, call it self-esteem issues, egotism, megalomania, or any number of personality disorders. Smart posts often have a lot of material that can be easily taken out of context, and Disagreers love nothing more than a good disagreement. So what can you do? Ignore them. It’s been said before on numerous forums and mailing lists: Don’t feed the trolls. Disagreers could easily be labeled as such, but the difference is that their trolling tendencies aren’t always premeditated. This may make the Disagreer more benign than an honest-to-goodness troll, but it doesn’t make their disagreement any less annoying–or dangerous.

Think of it this way: In matters of medical issues, if a dispute comes up as to whether or not someone should seek treatment for a specific condition, a true Disagreer might suggest alternative approaches that could potentially worsen the condition. A troll would do so with malicious intent; a Disagreer might do it simply because they are forcing their belief system on others, dislike doctors and pharmaceuticals, or want to demonstrate superior intellect over the original poster. Thus, the net result is the same, but the motivations are entirely different.

Of course, there are many other reasons smart posts start arguments, and in spite of the rather titan word count in this post, I’ve only begun to graze the surface. So, I’ll leave you to consider other circumstances, other personality types, and consider other reasons why such a thing might happen. Feel free to share your own experiences, and I may revisit this post at some point in the future!

No comments.
***