  We study the propagation of a strong, low frequency, linearly polarized fast
magnetosonic wave inside the magnetosphere of a neutron star. The relative
strength $\delta B/B$ of the wave grows as a function of radius before it
reaches the light cylinder, and what starts as a small perturbation can grow to
become nonlinear before it escapes the magnetosphere. Using first-principles
Particle-in-Cell (PIC) simulations, we study in detail the evolution of the
wave as it becomes nonlinear. We find that an initially sinusoidal wave becomes
strongly distorted as $\delta B/B$ approaches order unity. The wave steepens
into a shock in each wavelength. The plasma particles drift into the shock and
undergo coherent gyration in the rest of the wave, and subsequently become
thermalized. This process quickly dissipates the energy of an FRB emitted deep
within the magnetosphere of magnetar, effectively preventing GHz waves produced
in the closed field line zone from escaping. This mechanism may also provide an
effective way to launch shocks in the magnetosphere from kHz fast magnetosonic
waves without requiring a relativistic ejecta. The resulting shock can
propagate to large distances and may produce FRBs as a synchrotron maser.
