[swift-dev] Validating ABI consistency between runtime C++ and standard library Swift code

2016-10-11 Thread Joe Groff via swift-dev
I just tracked down a bug due to C++ code in the Swift runtime code trying to interface with standard library code written in Swift, but getting the ABI slightly wrong and leading to some nasty hard-to-reproduce heisenbugs. While I've narrowed down the bug in this specific case, it seems like th

Re: [swift-dev] Validating ABI consistency between runtime C++ and standard library Swift code

2016-10-11 Thread Daniel Dunbar via swift-dev
Can you directly pass arguments to the function crossing the ABI boundary, and can you directly access them on the other side? If so, what you can do is simply synthesize arguments that cross the full range of the bit-representation of the argument types, and validate that you see the same range

Re: [swift-dev] Validating ABI consistency between runtime C++ and standard library Swift code

2016-10-12 Thread Kevin Choi via swift-dev
> getting the ABI slightly wrong Does this call for something like a validation pass? It would seem appropriate to apply it to SIL and not LLVM IR since it's inter-language ABI specific to Swift frontend. On Tue, Oct 11, 2016 at 8:17 PM, Daniel Dunbar via swift-dev < swift-dev@swift.org> wrote:

Re: [swift-dev] Validating ABI consistency between runtime C++ and standard library Swift code

2016-10-12 Thread John McCall via swift-dev
> On Oct 11, 2016, at 8:10 PM, Joe Groff via swift-dev > wrote: > I just tracked down a bug due to C++ code in the Swift runtime code trying to > interface with standard library code written in Swift, but getting the ABI > slightly wrong and leading to some nasty hard-to-reproduce heisenbugs. W

Re: [swift-dev] Validating ABI consistency between runtime C++ and standard library Swift code

2016-10-12 Thread Greg Parker via swift-dev
> On Oct 12, 2016, at 11:11 AM, John McCall via swift-dev > wrote: > >> On Oct 11, 2016, at 8:10 PM, Joe Groff via swift-dev >> wrote: >> I just tracked down a bug due to C++ code in the Swift runtime code trying >> to interface with standard library code written in Swift, but getting the >

Re: [swift-dev] Validating ABI consistency between runtime C++ and standard library Swift code

2016-10-12 Thread John McCall via swift-dev
> On Oct 12, 2016, at 3:46 PM, Greg Parker wrote: >> On Oct 12, 2016, at 11:11 AM, John McCall via swift-dev > > wrote: >> >>> On Oct 11, 2016, at 8:10 PM, Joe Groff via swift-dev >> > wrote: >>> I just tracked down a bug due to C++ code in

Re: [swift-dev] Validating ABI consistency between runtime C++ and standard library Swift code

2016-10-13 Thread Michael Gottesman via swift-dev
> On Oct 12, 2016, at 4:36 PM, John McCall via swift-dev > wrote: > >> On Oct 12, 2016, at 3:46 PM, Greg Parker > > wrote: >>> On Oct 12, 2016, at 11:11 AM, John McCall via swift-dev >>> mailto:swift-dev@swift.org>> wrote: >>> On Oct 11, 2016, at 8:10 PM, Joe Gr

Re: [swift-dev] Validating ABI consistency between runtime C++ and standard library Swift code

2016-10-13 Thread John McCall via swift-dev
> On Oct 13, 2016, at 9:30 AM, Michael Gottesman wrote: >> On Oct 12, 2016, at 4:36 PM, John McCall via swift-dev > > wrote: >> >>> On Oct 12, 2016, at 3:46 PM, Greg Parker >> > wrote: On Oct 12, 2016, at 11:11 AM, John McCall via swift-d

Re: [swift-dev] Validating ABI consistency between runtime C++ and standard library Swift code

2016-10-16 Thread Dave Abrahams via swift-dev
on Tue Oct 11 2016, Joe Groff wrote: > I just tracked down a bug due to C++ code in the Swift runtime code > trying to interface with standard library code written in Swift, but > getting the ABI slightly wrong and leading to some nasty > hard-to-reproduce heisenbugs. While I've narrowed down th