DNS matters

Spent way too much time repairing networking after a VPN update…

WordPress warnings

Yesterday, the Wordpress window I use to write this blog began behaving really strangely, occasionally failing to save my window content. And then some scripts I had written started failing. And then ssh muse stopped working. Time to figure out what was happening.

It turns out the problem is a semi-silent update to my VPN software, which caused some VPN configurations files to be reset to their default value. One of the settings that matters is which DNS server I’m using… I have a local DNS here for all my local machines, and that was no longer in the DNS search. But because of caching, this is not something that causes a problem right away. Instead, it begins failing as DNS responses slowly become stale…

Solution: update the DNS configuration again, and try to remember for next time the VPN is updated.

Mac Spice build

I decided I would figure out what the problem was with Mac Spice builds. Remember, it begins with:

Use of uninitialized value $msg in concatenation (.) or string at /usr/local/Cellar/autoconf/2.69/bin/autom4te line 1032.
Use of uninitialized value $stacktrace in pattern match (m//) at /usr/local/Cellar/autoconf/2.69/bin/autom4te line 1032.
unknown channel m4trace: -1- AS_VAR_APPEND(ac_configure_args, " '$ac_arg'")
 at /usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/Channels.pm line 638.
    Autom4te::Channels::msg('m4trace: -1- AS_VAR_APPEND(ac_configure_args, " \'$ac_arg\'")\x{a}', undef, 'warning: ', 'partial', 0) called at /usr/local/Cellar/autoconf/2.69/bin/autom4te line 1032

Not very helpful. And a Google search on this turns up all sorts of entirely unhelpful entries. Usually, Google gives you a good hint when you run into some kind of message like this, but in this case, nada. It just seems that there is a situation where aclocal begins barfing stuff at random. But whatever that situation is, it’s not obvious from the message.

The errors are from this code:

# Swallow excessive newlines.
for (split (/\n*$separator\n*/o, contents ("$tmp/warnings")))
{
  # The message looks like:
  # | syntax::input.as:5::ouch
  # | ::input.as:4: baz is expanded from...
  # | input.as:2: bar is expanded from...
  # | input.as:3: foo is expanded from...
  # | input.as:5: the top level
  # In particular, m4_warn guarantees that either $stackdump is empty, or
  # it consists of lines where only the last line ends in "top level".
  my ($cat, $loc, $msg, $stacktrace) = split ('::', $_, 4);
  msg $cat, $loc, "warning: $msg",
    partial => ($stacktrace =~ /top level$/) + 0;
  for (split /\n/, $stacktrace)
    {
      my ($loc, $trace) = split (': ', $_, 2);
      msg $cat, $loc, $trace, partial => ($trace !~ /top level$/) + 0;
    }
}

Swallowing excessive newlines, eh? It’s that hard? And it has to be so complicated, and so not ready for malformed input? Added some instrumentation just above that code:

open (my $fh, '>', '/tmp/perldebug');
print $fh "-- Begin warnings --\n";
print $fh contents ("$tmp/warnings");
print $fh "-- End warnings --\n";
close($fh);

It takes instrumentation like this to get what aclocal is trying toi tell me:

 -- Begin warnings --obsolete::configure.ac:34::'AM_CONFIG_HEADER': this macro is obsolete.
You should use the 'AC_CONFIG_HEADERS' macro instead.::/usr/local/Cellar/automake/1.15/share/aclocal-1.15/obsolete.m4:15: AM_CONFIG_HEADER is expanded from...
configure.ac:34: the top level
------------------------- END OF WARNING -------------------------


obsolete::configure.ac:189::The macro `AC_TRY_CPP' is obsolete.
You should run autoupdate.::../../lib/autoconf/general.m4:2530: AC_TRY_CPP is expanded from...
configure.ac:189: the top level
------------------------- END OF WARNING -------------------------


obsolete::configure.ac:286::AC_OUTPUT should be used without arguments.
You should run autoupdate.::
------------------------- END OF WARNING -------------------------


m4trace: -1- AS_VAR_APPEND(ac_configure_args, " '$ac_arg'")
-- End warnings --

That’s it? Spice is using obsolete macros? Remember that we are talking about version 2.69 of a package that is used by practically every single open-source package on the planet… Well, except my own projects, I’ve always tried to stay clear from autoconf, which I consider a extraordinarily complex non-solution for an obsolete problem.

After a bit of fixing in autconf.ac (what  a pleasant syntax!), I got the next round:

obsolete::configure.ac:288::AC_C_BIGENDIAN should be used with AC_CONFIG_HEADERS::

OK. I thought that release-to-release compatibility was a problem for LLVM. Apparently, autoconf decided to give them a run for their money.

But then, I still get the same failure, this time without any warning emitted. Hmm. Time to fix the root cause? More instrumentation shows that the original problem comes from:

  confess "unknown channel $channel" unless exists $channels{$channel};
 

Apparently, there is no channel called fatal at this stage. Checked that the problem is not with the Perl installation itself, or with backtracking. A simple program using confess works OK:

use Carp qw/croak confess/;
sub zoo ()
{
    confess "Boo, I'm dead";
}
sub bar () { zoo(); }
sub foo () { bar(); }
foo();

results in the expected output:

Boo, I'm dead at /tmp/truc.pl line 4.
    main::zoo() called at /tmp/truc.pl line 6
    main::bar() called at /tmp/truc.pl line 7
    main::foo() called at /tmp/truc.pl line 8
Advertisements

Author: Christophe de Dinechin

I try to change the world, but that's work in progress. If you want to know me, google "Christophe de Dinechin". Keywords: concept programming, virtualization, OS design, programming languages, video games, 3D, modern physics. Some stuff I did that I'm proud of: the first "true" 3D game for the PC, HP's big iron virtualization, real-time test systems for car electronics, some of the best games for the HP48 calculator, a theory of physics that makes sense (at least to me).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s