|
Boost : |
Subject: Re: [boost] [bootstrap/1.53] jam0.exe crashes when bootstrapping for VC2012 AMD64
From: Lars Viklund (zao_at_[hidden])
Date: 2013-05-10 04:56:03
On Fri, May 10, 2013 at 02:56:34AM -0400, Matt Weber wrote:
> I've been running into this for a while now in different environments
> and finally figured it out tonight. I think this might be specific to
> the x86_amd64 compiler, but I don't have a native amd64 version to test.
> The issue is kind of apparent from the callstack, as the call from
> file_dirscan to _findnext actually becomes a call to _findnext64i32.
> That takes a 64-bit handle, but we have a 32-bit handle that we got back
> from _findfirst. That's the problem -- the handle returned from
> _findfirst (_findfirst64i32) is actually 64-bit. In the best case, the
> lower 32-bits of that handle happen to represent a negative value and
> the function exits. More likely, you have a garbage value being passed
> along, and you crash soon thereafter.
>
> For my purposes, I simply changed the type of the handle variable from
> long to uint64_t, and I now finally have a bjam for x86_64. This change
> will break the x86 compile, however.
If you're going to change data types, consider a type like intptr_t,
which is what _findfirst seems to return according to MSDN.
> C:\src\boost_1_53_0\tools\build\v2\engine>diff -u2 filent.c.orig filent.c
> --- filent.c.orig 2013-05-10 02:45:01.156195300 -0400
> +++ filent.c 2013-05-10 02:19:57.535285000 -0400
> @@ -34,4 +34,5 @@
> # include <ctype.h>
> # include <direct.h>
> +# include <stdint.h>
>
> /*
> @@ -80,5 +81,5 @@
> string filespec[ 1 ];
> string filename[ 1 ];
> - long handle;
> + uint64_t handle;
> int ret;
> struct _finddata_t finfo[ 1 ];
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Lars Viklund | zao_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk