Gmsh for 2D and 3D meshes, multi domains


I need to make mesh including 2D and 3D structures. I have defined my geometry by points and lines, but when I import the 2D simple mesh in freefem, I see the bad orientation error, it is being fixed when I do a recombine in gmsh and report it in freefem again.
But when I want to import 2D and 3D meshes at the same time ( like a cylinder in a cube shell) after recombining, I see the segmentation fault error!

So how can I import such a mesh in freefem? what can be used to solve bad orientation error in 2D surfaces ? or segmentation fault in 3D?