So don't use a unit test as your starting point for the "minimal
example". Something in some other part of your program is triggering
this problem, and none of your unit tests includes that "something". So
start with your entire program. Here's a process I've used several
times. It's a long, slow process, but it often helps located even weird
problems like this one:
Save a copy of your program as the "known failure". Don't do anything
with the original.
1. Make a copy of your "known failure" code, and choose some chunk of
that program to remove or replace with a simpler version. If necessary,
choose the chunk randomly, but favor large chunks, and parts of the code
that you suspect have nothing to do with the problem. Every part of your
program that should have executed after the point where it failed is a
good candidate for removal. If the symptoms don't occur inside the data
input routines, consider replacing those routines with code that
initializes your data structures directly. If you can't find anything
more to remove, you're done: you have your "minimal example". Hopefully,
it's small enough to post to the newsgroup.
Since you haven't identified the actual problem yet, feel free, if
necessary, to remove parts you do suspect to have something to do with
the problem - you might be wrong about that, and if so, that's useful
information.
Make sure to remove things cleanly. If part A of the code relies upon
part B having been executed, don't remove B until after you're removed
A; don't remove the '{' that starts a block of code, without also
removing the '}' that terminates it; etc..
2. Test to see if you can can still reproduce the symptoms of the
problem you're trying to solve with the simplified version of the code.
It's not uncommon for the symptoms to change while you're following this
process. That's not a problem - as long as the new symptoms are just as
much of a problem as the original symptoms, you can treat this as a
successful test. However, make sure that the new symptoms are not just
the result of what you removed, due to not removing it cleanly.
3. If the modified code still fails, save it as your new "known
failure". If not, choose a different part to remove the next time
around, possibly a subset of the code you removed this time.
4. Go back to step 1.
If you follow this process, you'll often find that the fact removing a
given part of the code does/doesn't remove the symptoms of your problem
will provide a vital clue as to what the cause of your problem is. You
might very well end up not needing to present your "minimal example" to
anyone else to figure out your problem.