No hands on experiance, but that was no
accident as pre-purchase
research of my boat model revealed this as a common age related issue. So after researching what it looked like, how to fix and how much I made sure I bought one that a PO had already sorted.
Obviously I don't know how your boat is constructed, but mine has solid GRP decks, except under the mast, which sits on a raised glassed in wooden pad above the forward main bulkhead / main cross beam. Underneath was a wooden mast support (approx 2 inches square) that also formed a part of the forward door frame. It was supported by a similar sized glassed in beam accross the
bilge.
The problem was simply due to age and being a tad underbuilt (underdesigned) over 30 odd years the glassed in mast step had compressed, then the GRP cracked, the wooden pad slowly rotted, then compressed even more - the side effect being to weaken the cabin top so it also started to compress, with the mast support not being man enuf to counter the long term process downward..........albeit on mine had not yet got to the stage of actually cracking the deck / cabin top. But that would have simply been a matter of time. Whatever, once the mast starts heading south it ain't gonna later change direction
The solution was to cut out the GRP mast step, replace the wooden pad (soft
wood 
- now
marine ply) and reglass (and very neatly done it was

), under decks the supporting deck beam was doubled up in hardwood, with an additional hardwood mast support built in. Going from around 2 inches sqaure to around 5 inches! A might fine piece of varnished woodwork it is

and supported by an additional sized piece of woodwork glassed in accross the
bilge. (unfortunately I have no photos on this computer). To be honest I think the fix was well OTT!, but I can understand why the PO went that far - indeed not only was the fix in place one of the reasons I bought, the fact it was done so clearly well was a big decider.
The cost? I didn't get the bill

but I
recall the PO said around a couple of thousand, which kinda tallied with my estimates.
DIY? not for me, but fundamently not impossible, although I would put it into the category of "if you've gotta ask............"
BTW one other thing I learnt along the way on the mast compression front is that some setups are designed for a wedge to be inserted either at the foot of the post or at the top - if not inserted the mast is of course then compressing into an air gap..........and easy for owners not to check the wedge is still good, or indeed not to know it is meant to be their at all........
Finally, although not having seen the boat in question I would not be entirely happy with the surveyors comments of seeing no problems, maybe before progressing with an offer bring in a professional to
price up the job?