Older blog entries for redi (starting at number 271)

I've often joked that instead of picking up Djikstra's cute acronym we should have called the basic synchronization object "the bottleneck". Bottlenecks are useful at times, sometimes indispensible -- but they're never GOOD.

David Butenhof on mutexes, from the illuminating Re: recursive mutexes
12 Nov 2012 (updated 30 Jan 2013 at 13:44 UTC) »

Gold linker + CentOS5 NFS client + Solaris 10 NFSd = ballache

I've spent a day and a half being completely bewildered by a weird NFS bug where ELF binaries (but not other files) written to an NFS mount show up on remote hosts with the correct file size but consisting entirely of nul zero bytes, but only when written from CentOS5 hosts, not from Solaris, Fedora or RHEL6 hosts.

I eventually narrowed it down to the Gold linker, which writes files using mmap, and the CentOS5 2.6.18 kernel has a bug when writing files with mmap to NFS mounts.

There was a very similar RHEL4 bug that should be fixed in my kernel, but for some reason the kernel-2.6.18-redhat.patch file in the SRPM comments out the fix. I don't know why.

Maybe this post will show up for anyone else searching for the symptoms, because I didn't have much luck searching the web for it.

My solution is to avoid Gold on CentOS5 (since we can't easily stop using NFS, unfortunately) but I wish I could get that day of my life back.

Update: The distcc FAQ (search for Files written to NFS filesystems are corrupt) mentions this problem and refers to a post to the distcc list and a post to the linux-nfs list where a workaround using the no_subtree_check option for nfsd is given, but that assumes the NFS server is linux, and mine isn't

Wishbone and the Illustrated Classics series have gotten me through every conversation I've ever had about Dickens, Treasure Island, The Anarchist's Cookbook, and Our Bodies, Ourselves.
-- Randall Munroe

Similarly, XKCD and The Daily Mash get me through every conversation I ever have about ... pretty much anything really.


We seem to have a new type of syndicated blog that breaks advogato's recentlog, Firefox doesn't render anything after the Gist embedded in oubiwann's post. Maybe the <script> tag is the problem.
"Well, the feature was in the language so I figured I
should use it.". It is our belief that this is not a
sufficient criteria for using a feature of C++. A feature
should be used only when it can be demonstrated to be
of benefit. A mountain is climbed "because it is there".
The same should not hold true for C++ features. Their
mere existence is not justification for use.

-- Evan Adams, The Old Man and the C
The Future of C++: Live broadcast this Friday by Herb Sutter.

If you are interested in C++, on any platform, you’ll want to tune in.
26 Oct 2012 (updated 26 Oct 2012 at 13:16 UTC) »
"Don't put all your information on websites you don't trust." that's Andy Smith, a very sensible govt. official on internet security, stating the obvious.

On the other hand, Helen Goodman, MP for Bishop-Auckland, is a moron.

Andy Smith, an internet security chief at the Cabinet Office, said people should only give accurate details to trusted sites such as government ones.

He said names and addresses posted on social networking sites "can be used against you" by criminals.

His advice was described by Labour MP Helen Goodman as "totally outrageous".

Ms Goodman, shadow culture minister, told BBC News: "This is the kind of behaviour that, in the end, promotes crime.

"It is exactly what we don't want. We want more security online. It's anonymity which facilitates cyber-bullying, the abuse of children."


What a fucking idiot.

Giving a fake date of birth to some e-commerce site that has no valid need for my identifying details and just wants to send me marketing mail no more promotes crime than buying a pair of tights for my wife promotes bank robbery.

(Aside: this image comes from armedrobberyadvice.com ... WTF?)

If Helen Goodman, shadow cabinet minister for talking crap about subjects she doesn't understand, has her way I'll be forced to show my passport to get a Facebook account ... oh wait, they already think they're entitled to that.

Thankfully until the day I can't open a bank account without a validated faecesbook account I can continue being a facebook-refusenik and give fake DOBs to marketers, and can call Helen Goodman MP a fucking moron (and I don't even need the benefit of anonymity to facilitate doing that.) Moron.
25 Oct 2012 (updated 6 Feb 2013 at 10:55 UTC) »

Recently I've had time to work on some C++11 library additions for libstdc++ which had been brewing in my Git tree for months. std::forward_list meets the C++11 allocator container requirements now. std::scoped_allocator_adaptor is 99% complete now. I'm trying to provide std::this_thread::yield(), std::this_thread::sleep_*() and a high-resolution std::system_clock even when GCC isn't built with --enable-libstdcxx-time (with huge thanks to Roland McGrath for help from glibc.) I need to write tests for my implementations of std::wstring_convert and std::wbuffer_convert so I can commit them.

Some stuff I've looked at today:

Mirage, a good reason to learn OCaml.

Parallela, a supercomputer for everyone.

From a few entries down on Advogato's recentlog: the Ada Initiative is running a fundraising campaign, you should donate.

6 Sep 2012 (updated 6 Sep 2012 at 11:40 UTC) »

I hate Istanbul airport.

The GCC checkin policy requires a ChangeLog entry for each change, and that entry is usually also used as the commit message. I used to use a fairly crappy, homemade vim plugin to extract the first entry from a ChangeLog file into the editor buffer to use as the svn commit message. I decided to replace that vim plugin with a Git prepate-commit-msg hook that automatically prepares the commit message for me by extracting the first entry from each ChangeLog that is part of the commit.

As a cursory web search didn't find anything similar, I'm posting it here in case it's useful to anyone else.


$ cat .git/hooks/prepare-commit-msg
#!/bin/bash
#
# Hook script to prepare the commit log message from the first
# entry in each modified ChangeLog being committed.

set -e

[[ "$2,$3" == 'merge,' ]] && exit

tmpf=$(mktemp)
awk -f $0.awk $(git status -s | awk '/^M .*ChangeLog/{print $NF}') > $tmpf
sed 1d $1 >> $tmpf
mv $tmpf $1



$ cat .git/hooks/prepare-commit-msg.awk
# When there is more than one ChangeLog in the commit, precede
# the entry by the directory name.
FNR == 1 && ARGC > 2 {
printf "%s:\n\n", gensub("/ChangeLog$", "", "", FILENAME)
}

# Save the first line until we know if we want to print it.
FNR == 1 {
line1=$0
}

# If second line is blank there is only one patch author, omit it.
FNR == 2 && /^$/ {
}

# If second line is not blank there are multiple authors, print them.
FNR == 2 && /^./ {
print line1
print
}

# Stop processing the file at the next entry.
FNR > 3 && /^20[1-9][0-9]-[0-1][1-9]-[0-3][0-9] / {
nextfile
}

# Otherwise, just print the line.
FNR > 2 {
print
}
12 Apr 2012 (updated 12 Apr 2012 at 20:37 UTC) »

In response to repeated claims that Clang has far better diagnostics than GCC I decided to re-run some of the tests on the Clang Expressive Diagnostics page (which uses the ancient GCC 4.2 release that Apple still use) to show how much GCC has improved. The results are at Clang Diagnostics Comparison in the GCC wiki. Enjoy.

262 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!