Sahih Bukhari and Sahih Muslim are the two most revered Sunni books. The followers of these books claim that these are Sahih (all the traditions mentioned in these books are authentic and correct).

Let us see in short what these two books have mentioned regarding the conduct of the Prophet (s.a.w.a.) with respect to mourning over the dead.

Let us first see the tradition from Sahih-e-Muslim:

Umme Salamah reported, “When Abu Salamah died I said, “I am a stranger in a strange land; I shall weep for him in a manner that would be talked of. I made preparation for weeping for him when a woman from the upper side of the city came there who intended to help me (in weeping). She happened to come across the Messenger of Allah (s.a.w.a.) who said, “Do you intend to bring the devil into a house from which Allah has twice driven him out? I (Umme Salamah), therefore, refrained from weeping and I did not weep. (Book #004, Hadith #2007)

In the above tradition the Prophet (s.a.w.a.) has prohibited weeping over the dead for it brings the devil into the house.

Now let us see what is mentioned in Bukhari.

Narrated Anas bin Malik, “We were (in the funeral procession) of one of the daughters of the Prophet and he was sitting by the side of the grave. I saw his eyes shedding tears.” (Book #23, Hadith #374)

From the above tradition we see that the Prophet (s.a.w.a.) wept for his daughter.

Analysis
1. Both books are claimed to be Sahih and authentic.
2. There are contradictory traditions in each book.
3. As per one tradition the Prophet (s.a.w.a.) is prohibiting from crying over the dead while as per the other he himself is crying over his dead daughter.
4. So either one of the books is not Sahih or the Prophet (s.a.w.a.) is not practicing what he is preaching.
5. If only one of the books is Sahih, then the authenticity of the other is in doubt.
6. If both are Sahih, then the authenticity of the Prophet (s.a.w.a.) is in doubt.