Leaking under the gutter

Can someone help me diagnosis what kind of problem this is? It seems that there is gap between the gutter and the roof…

Does those dark spots means the wood is rotten? What is the proper fix?

Thanks for the help.

It is not possible to tell from this photo.

clean the gutter trough interior
check for pinhole leak points
seal any holes
clean leaf tannin/dirt stains off the gutter trough exterior
wood rot would be finger pressure or slight probe/awl/icepick apparent at the fascia/decking
all damaged material should be replaced as once wetted to a stage of rot dry rot often follows

Roof water between the pan and fascia.

See if the gutter pans are clean.
Roof drip edge should extend over the pan back.
Selvage should be over the drip edge.

Hope that helps