How to debug stack overflow issue in gstreamer

I have a pipeline to decode RTSP streaming of a few cameras. Cameras need to be switched sometimes. When cameras are switched, pipelines are destroyed and recreated. After some number of switches, the app crashes because of stack overflow. How to debug this with gstreamer tools?