How to debug Gstreamer memory issue?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to debug Gstreamer memory issue?

Bing Song

Hi,

 

I met one issue when develop camera application based on camerabin.

 

Issue:

 

Below two parameters in gstvideoencoder.c will set to NULL after camerabin: capture image->video recorder->capture image.

 

  GstVideoCodecState *input_state;

  GstVideoCodecState *output_state;

 

The issue will gone after put those two parameters at the bottom of struct _GstVideoEncoderPrivate.

 

I tried GDB watch. But camera application can’t work normally under GDB environment.

 

Valgrind is very slow, I think can’t used to debug this kind of issue.

 

Can efence works on Gstreamer 1.x? Electric Fence can used to debug memory corruption.

 

Regards,

Song Bing.


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

RE: How to debug Gstreamer memory issue?

Bing Song

Hi,

 

I found the root cause of my issue. It is invalid memory write in our hardware accelerate video encoder plugin. But it is easy to debug this kind of issue with efence (I used it in other project). Do Gstreamer has this kind of debug method?

 

Regards,

Song Bing.

 

From: gstreamer-devel [mailto:[hidden email]] On Behalf Of Bing Song
Sent: Monday, March 30, 2015 11:45 AM
To: Discussion of the development of and with GStreamer
Subject: How to debug Gstreamer memory issue?

 

Hi,

 

I met one issue when develop camera application based on camerabin.

 

Issue:

 

Below two parameters in gstvideoencoder.c will set to NULL after camerabin: capture image->video recorder->capture image.

 

  GstVideoCodecState *input_state;

  GstVideoCodecState *output_state;

 

The issue will gone after put those two parameters at the bottom of struct _GstVideoEncoderPrivate.

 

I tried GDB watch. But camera application can’t work normally under GDB environment.

 

Valgrind is very slow, I think can’t used to debug this kind of issue.

 

Can efence works on Gstreamer 1.x? Electric Fence can used to debug memory corruption.

 

Regards,

Song Bing.


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to debug Gstreamer memory issue?

Nicolas Dufresne-3
Le mercredi 01 avril 2015 à 01:52 +0000, Bing Song a écrit :
> Hi,
>
>  
>
> I found the root cause of my issue. It is invalid memory write in our
> hardware accelerate video encoder plugin. But it is easy to debug this
> kind of issue with efence (I used it in other project). Do Gstreamer
> has this kind of debug method?

I never tried, we all use valgrind in general. It looks like it's
independent of the project, so you can try:

G_SLICE=always_malloc LD_PRELOAD=libefence.so.0.0 gst-launch-1.0 ...

This is well documented in the Efence man page. The G_SLICE addition is
to avoid using GLib optimized heap for small objects. It is not seen as
alloc/free calls by these tools otherwise.

Nicolas


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel