the method comprises the steps of providing a semiconductor body or substrate with a recess or trench in a main surface , applying a mask on the main surface , the mask covering the recess or trench , so that the walls and bottom of the recess or trench and the mask together enclose a cavity , which is filled with a gas , and forming at least one opening in the mask at a distance from the recess or trench , the distance being adapted to allow the gas to escape from the cavity via the opening when the gas pressure exceeds an external pressure .