I asked, "Messenger of Allah, which sin is the greatest?"He replied, "That you set up a rival to Allah, when it is He who created you."I said, "Then what?"He said, "That you kill your child out of fear that he will eat with you."I said, "Then what?"He said, "That you commit adultery with your neighbor's wife."He said, this is a hasan gharib hadith. Muhammad bin Bashshar narrated to us, Abdul-Rahman bin Mahdi narrated to us, Sufyan narrated to us from Mansur and Amash, from Abu Waail, from Amr bin Shurahbil, from Abdullah, from the Prophet ﷺ, something similar.
حدثنا محمد بن بشار حدثنا عبد الرحمن بن مهدي حدثنا سفيان عن واصل عن أبي وائل عن عمرو بن شرحبيل
قلت يا رسول الله أي الذنب أعظم قال أن تجعل لله ندا وهو خلقك قال قلت ثم ماذا قال أن تقتل ولدك خشية أن يطعم معك قال قلت ثم ماذا قال أن تزني بحليلة جارك قال هذا حديث حسن غريب حدثنا محمد بن بشار حدثنا عبد الرحمن بن مهدي حدثنا سفيان عن منصور والأعمش عن أبي وائل عن عمرو بن شرحبيل عن عبد الله عن النبي ﷺ بمثله
Agreed upon [by Bukhari and Muslim]. Bukhari reported it in the tafsir [chapter], the chapter on His saying, "And those who do not call upon another god besides Allah, nor kill the soul", h: 4761, from the hadith of Sufyan Thawri, and Muslim, h: 86, from the hadith of Abu Waail, with this wording.