Access violation when allocating memory

See attached pic.

Sorry, couldn't reproduce a problem here on Win7 / VS2013. 

Like I said above, this really sounds like a compiler bug. If the behaviour changes when you remove some code which is never executed (i.e. code inside one of those disabled for loops) then things really must be getting weird.

Can anyone who has a stack trace of the crash get any clues from the stack/memory/disassembly?

Use Win10 64bit with VS2015 and compile as 32bit to reproduce!

I tried with 2 other developers looking at memory and disassembly but did not get any clue besides the things that I wrote in this thread before. Admittedly, we did this some weeks ago when the problem has not been as well isolated as it is now. But I think it would be good if you can take over here now, you know your code much better.

I'm unclear about what you think we could do to "fix" this..?

The only thing your code does is to create some empty Strings, and I can say for sure that there's no bug in that code, otherwise no juce apps at all would ever even launch!

It's a fascinating problem and I'll pass it to our team in case anyone here wants to have a quick look, but if the problem goes away when you change any bit of the code, then surely the fix is to just modify your code to avoid what is almost certainly a compiler bug?

Hmm, can't you say with the same reasoning that there will surely be no bug in the compiler, otherwise no apps would ever launch..?

Of course, maybe there is a bug in the compiler. But I find it interesting, that it crashes with both the initial release of VS2015 and with the latest updates of VS2015. If there would be a fundamental compiler bug, I'd likeley guess that it would have been fixed since the initial VS2015 release.

Changing the code so that it does not crash is only an option if you know of the crash. I was just lucky that it crashed in an area that was covered by unit tests.

Hmm, can't you say with the same reasoning that there will surely be no bug in the compiler, otherwise no apps would ever launch..?

No, that's entirely different!

All compilers have bugs, which often go undetected for a long time because they only get triggered by very specific and unusual bits of code. I could be wrong, but I've seen a lot of bugs in my career, and this one smells like a compiler bug to me. I'd need to see some strong evidence that points to some other cause before I'd want to commit any more time to investigating.

All compilers have bugs, which often go undetected for a long time because they only get triggered by very specific and unusual bits of code.

Ha! So you're doing something very specific or unusual? How can you! But anyway, I've just filed a bug report with the VS2015 team.