From a sample of 84 local barred , moderately inclined disc galaxies , we determine the fraction which host boxy or peanut-shaped ( B/P ) bulges ( the vertically thickened inner parts of bars ) . We find that the frequency of B/P bulges in barred galaxies is a very strong function of stellar mass : 79 % of the bars in galaxies with \log ( M _ { \star } / M _ { \sun } ) \ga 10.4 have B/P bulges , while only 12 % of those in lower-mass galaxies do . ( We find a similar dependence in data published by \citealt yoshino15 for edge-on galaxies . ) There are also strong trends with other galaxy parameters – e.g. , Hubble type : 77 % of S0–Sbc bars , but only 15 % of Sc–Sd bars , have B/P bulges – but these appear to be side effects of the correlations of these parameters with stellar mass . In particular , despite indications from models that a high gas content can suppress bar buckling , we find no evidence that the ( atomic ) gas mass ratio M _ { \mathrm { H } \textsc { i } + \mathrm { He } } / M _ { \star } affects the presence of B/P bulges , once the stellar-mass dependence is controlled for . The semi-major axes of B/P bulges range from one-quarter to three-quarters of the full bar size , with a mean of R _ { \mathrm { box } } / L _ { \mathrm { bar } } = 0.42 \pm 0.09 and R _ { \mathrm { box } } / a _ { \epsilon } = 0.53 \pm 0.12 ( where R _ { \mathrm { box } } is the size of the B/P bulge and a _ { \epsilon } and L _ { \mathrm { bar } } are lower and upper limits on the size of the bar ) .