Boost logo

Boost-Build :

Subject: [Boost-build] build engine crashes when GLOBing paths with forward slashes on windows
From: Marc Dürner (marc.duerner_at_[hidden])
Date: 2012-02-16 09:02:03


Hello,

I get a crash on windows when a path with forward slashes such as
/usr/include is passed to GLOB. I believe is has to do with the
implementation of ShortPathToLongPath in pathunix.c. There has been
special handling of short paths added recently for paths that only
contain the drive letter such as c:\. I can add special handling for
paths with forward slashes in a similar manner at the begin on
ShortPathToLongPath:

    if ( (short_path[0] == '\\') && (short_path[1] == '\0') )
    {
        string_push_back( out, '\\' );
        return;
    }

This fixes it, but seems only to hide a deeper problem.
ShortPathToLongPath() and path_write_key() call each other recursively
and we run into a situation in path_write_key() where a element was
added to the hashmap, but not completely initialized, A following
recursive call finds the element in the hashmap and tries to use the
elements uninitialized value.

regards,
Marc


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk