Thanks, Tim! I never though of running strace on an interpreted program as I was trusting the underlying infrastructure - interpreter, shared libraries, kernel - will work flawlessly. Anyway, if I remove "ldap" from the shadow database setting in /etc/nsswitch.conf, it works. No need to remove any packages. There are some dated reports regarding a similar issue both on this list (
https://www.mail-archive.com/backuppc-users AT lists.sourceforge DOT net/msg05864.html) and here:
http://grokbase.com/t/centos/centos/08739v6e2j/backuppc-wont-fork-after-centos-5-2-upgrade. The second one seems to be related to a bug in the nss-ldap library, but this has long been fixed. Besides, the bug related to that last report also caused other issues that are not present in my case. Maybe it's a new incarnation of the old bug? I'll look through the diffs of the fix back then and the current code to try and make sense of it. It is weird that I can't reproduce the problem with sample code taken out of the context.