I'm able to reproduce using the latest emacs-26 branch (I don't have the point releases checked out at the moment), both lucid and gtk3 builds. It doesn't reproduce using master, there is a Lisp error (Symbol's definition is void: new-frame) that interferes. It actually crashes as soon as I close the *GNU Emacs* frame, no chance to type M-x. I modified the .emacs to this: