Usually the freakiest problems have the simplest solutions...

The mistake was indeed caused by ^M, but not in the code (so it's not the fault of C macros like assert()) but in one of my data files (a text file with test cases).

It's the same problem I had with ESMS last week: when the last token on some line is numeric and is parsed with strtoul() or strtod(), a ^M screws up the parsing.

What happened in my code is that the parsing function correctly threw an exception, but in the place where it was caught I forgot to continue to the next test case, so an illegal object was passed on, which caused the assertion.