I have intuition.library 40.85.
When I create some gadgets and then open a window with the gadgets I have no problem.
When I open a window, create some gadgets, and then AddGList them to the window, I get stack trashing.
I spent the last four days trying to figure out what I'm doing wrong, and I just now compiled a demo program that came with the compiler (FPC) and it has the same problem. As far as I can tell, the source code (all the way down to the MOVEA.L _IntuitionBase,A6
JSR -438(A6)
is all correct!