So, as promised, I've been playing that album again, and it's again leaking memory. I tried a few things to get it to free the memory. Putting tracks from a different album in the middle didn't do it. Neither did deleting the rest of the album from the playlist and playing something else (in fact, it continued to leak — just <1MB at a time, presumably due to the new album having a single smaller picture). Maybe it's also really noticeable because there are 29 large pictures attached to each track.

I got a better backtrack from gdb:

Thread 23 "task116" hit Breakpoint 1, 0x00007f89dd9fe320 in 
gst_tag_list_add_id3_image () from /usr/lib/x86_64-linux-gnu/libgsttag-1.0.so.0
(gdb) bt
#0  0x00007f89dd9fe320 in gst_tag_list_add_id3_image () at 
/usr/lib/x86_64-linux-gnu/libgsttag-1.0.so.0
#1  0x00007f8998013b00 in gst_flac_parse_handle_picture (buffer=0x7f88d814bce0, 
flacparse=0x7f891e1c3690 [GstFlacParse])
    at /usr/include/gstreamer-1.0/gst/base/gstbytereader.h:651
#2  0x00007f8998013b00 in gst_flac_parse_handle_block_type 
(sbuffer=0x7f88d814bce0, type=6, flacparse=0x7f891e1c3690 [GstFlacParse])
    at gstflacparse.c:1520
#3  0x00007f8998013b00 in gst_flac_parse_parse_frame (frame=0x7f89250505e0, 
frame=0x7f89250505e0, size=301495, parse=0x7f891e1c3690 [GstFlacParse]) at 
gstflacparse.c:1574
#4  0x00007f8998013b00 in gst_flac_parse_handle_frame (parse=0x7f891e1c3690 
[GstFlacParse], frame=0x7f89250505e0, skipsize=<optimized out>)
    at gstflacparse.c:870
#5  0x00007f89dcce46b2 in gst_base_parse_handle_buffer 
(parse=parse@entry=0x7f891e1c3690 [GstFlacParse], buffer=<optimized out>, 
skip=skip@entry=0x7f895fffe75c, flushed=flushed@entry=0x7f895fffe758) at 
gstbaseparse.c:2160
#6  0x00007f89dcce4d8f in gst_base_parse_scan_frame (parse=parse@entry=0x7f891e1c3690 
[GstFlacParse], klass=<optimized out>)
    at gstbaseparse.c:3464
#7  0x00007f89dcce8302 in gst_base_parse_loop (pad=<optimized out>) at 
gstbaseparse.c:3543
#8  0x00007f89dcc30f41 in gst_task_func (task=0x7f897c237050 [GstTask]) at 
gsttask.c:332
#9  0x00007f89dcdb0ad3 in g_thread_pool_thread_proxy (data=<optimized out>) at 
../../../../glib/gthreadpool.c:307
#10 0x00007f89dcdb0135 in g_thread_proxy (data=0x7f8924ffb0f0) at 
../../../../glib/gthread.c:784
#11 0x00007f89dd154f2a in start_thread (arg=0x7f895ffff700) at 
pthread_create.c:463
#12 0x00007f89db094edf in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb) c
Continuing.

Looks like its some threaded workpool... I later added a breakpoint on pthread_create to try and see where the thread is coming from, and it looks like the threads are creating more threads and maybe never exiting? This appears to happen every track (the task number goes up by two each time; I didn't add the breakpoint on pthread_create in time to catch 116 creating 118, probably. Here is 118 creating 120, which then goes on to cal gst_tag_list_add_id3_image):

Thread 26 "task118" hit Breakpoint 2, __pthread_create_2_1 
(newthread=newthread@entry=0x7f89004337a0, attr=attr@entry=0x7f89717f5610,
    start_routine=start_routine@entry=0x7f89dcdb00e0 <g_thread_proxy>, 
arg=arg@entry=0x7f8900433770) at pthread_create.c:610
610     in pthread_create.c
(gdb) bt
#0  0x00007f89dd155210 in __pthread_create_2_1 
(newthread=newthread@entry=0x7f89004337a0, attr=attr@entry=0x7f89717f5610, 
start_routine=start_routine@entry=0x7f89dcdb00e0 <g_thread_proxy>, 
arg=arg@entry=0x7f8900433770) at pthread_create.c:610
#1  0x00007f89dcdce2e0 in g_system_thread_new 
(thread_func=thread_func@entry=0x7f89dcdb00e0 <g_thread_proxy>, 
stack_size=stack_size@entry=0, error=error@entry=0x7f89717f56e0) at 
../../../../glib/gthread-posix.c:1177
#2  0x00007f89dcdb043f in g_thread_new_internal (name=0x7f89dcde27c2 "pool", 
proxy=0x7f89dcdb00e0 <g_thread_proxy>, func=0x7f89dcdb0a60 <g_thread_pool_thread_proxy>, 
data=0x7f89b0050780, stack_size=0, error=0x7f89717f56e0) at ../../../../glib/gthread.c:874
#3  0x00007f89dcdb07ad in g_thread_pool_start_thread 
(pool=pool@entry=0x7f89b0050780, error=error@entry=0x7f89717f56e0)
    at ../../../../glib/gthreadpool.c:407
#4  0x00007f89dcdb0da3 in g_thread_pool_start_thread (error=0x7f89717f56e0, 
pool=0x7f89b0050780) at ../../../../glib/gthreadpool.c:552
#5  0x00007f89dcdb0da3 in g_thread_pool_push (pool=0x7f89b0050780, 
data=data@entry=0x7f8959f45f20, error=error@entry=0x7f89717f5750)
    at ../../../../glib/gthreadpool.c:563
#6  0x00007f89dcc31f6a in default_push (pool=0x7f89b0043920 [GstTaskPool], 
func=0x7f89dcc30dc0 <gst_task_func>, user_data=<optimized out>, 
error=0x7f89717f5750) at gsttaskpool.c:106
#7  0x00007f89dcc31b26 in start_task (task=0x7f88e1746710 [GstTask]) at 
gsttask.c:652
#8  0x00007f89dcc31b26 in gst_task_set_state (task=task@entry=0x7f88e1746710 
[GstTask], state=state@entry=GST_TASK_STARTED) at gsttask.c:704
#9  0x00007f89dcc061bb in gst_pad_start_task (pad=0x7f890f81ac90 [GstPad], 
func=0x7f897056cd80 <gst_type_find_element_loop>, user_data=0x7f890f81ac90, 
notify=0x0) at gstpad.c:6169
#10 0x00007f89dcc003e6 in gst_pad_set_active (pad=pad@entry=0x7f890f81ac90 
[GstPad], active=1) at gstpad.c:1107
#11 0x00007f89dcbde0ad in activate_pads (vpad=<optimized out>, 
ret=0x7f89717f58a0, active=0x7f89717f58fc) at gstelement.c:3040
#12 0x00007f89dcbf0acc in gst_iterator_fold (it=it@entry=0x7f8910003330, 
func=func@entry=0x7f89dcbde090 <activate_pads>, ret=ret@entry=0x7f89717f58a0, 
user_data=user_data@entry=0x7f89717f58fc) at gstiterator.c:617
#13 0x00007f89dcbdeb96 in iterator_activate_fold_with_resync 
(iter=iter@entry=0x7f8910003330, user_data=user_data@entry=0x7f89717f58fc, 
func=0x7f89dcbde090 <activate_pads>) at gstelement.c:3064
#14 0x00007f89dcbe0aee in gst_element_pads_activate 
(element=element@entry=0x7f89500620a0 [GstTypeFindElement], active=<optimized 
out>,
    active@entry=1) at gstelement.c:3108
#15 0x00007f89dcbe0cab in gst_element_change_state_func (element=0x7f89500620a0 
[GstTypeFindElement], transition=GST_STATE_CHANGE_READY_TO_PAUSED) at 
gstelement.c:3160
#16 0x00007f897056f076 in gst_type_find_element_change_state 
(element=0x7f89500620a0 [GstTypeFindElement], 
transition=GST_STATE_CHANGE_READY_TO_PAUSED) at gsttypefindelement.c:1326
#17 0x00007f89dcbe2eee in gst_element_change_state 
(element=element@entry=0x7f89500620a0 [GstTypeFindElement], 
transition=transition@entry=GST_STATE_CHANGE_READY_TO_PAUSED) at 
gstelement.c:2952
#18 0x00007f89dcbe360e in gst_element_set_state_func (element=0x7f89500620a0 
[GstTypeFindElement], state=GST_STATE_PAUSED)
    at gstelement.c:2906
#19 0x00007f89dcbc0b27 in gst_bin_element_set_state (next=GST_STATE_PAUSED, 
current=GST_STATE_READY, start_time=14052392286000, base_time=0, 
element=0x7f89500620a0 [GstTypeFindElement], bin=0x7f891eb7a0a0 [GstDecodeBin]) 
at gstbin.c:2604
#20 0x00007f89dcbc0b27 in gst_bin_change_state_func (element=0x7f891eb7a0a0 
[GstDecodeBin], transition=GST_STATE_CHANGE_READY_TO_PAUSED)
    at gstbin.c:2946
#21 0x00007f8998038ac2 in  () at 
/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstplayback.so
#22 0x00007f89dcbe2eee in gst_element_change_state 
(element=element@entry=0x7f891eb7a0a0 [GstDecodeBin], 
transition=GST_STATE_CHANGE_READY_TO_PAUSED) at gstelement.c:2952
#23 0x00007f89dcbe38ee in gst_element_continue_state 
(element=element@entry=0x7f891eb7a0a0 [GstDecodeBin], 
ret=ret@entry=GST_STATE_CHANGE_SUCCESS) at gstelement.c:2660
#24 0x00007f89dcbe30d5 in gst_element_change_state 
(element=element@entry=0x7f891eb7a0a0 [GstDecodeBin], 
transition=transition@entry=GST_STATE_CHANGE_NULL_TO_READY) at gstelement.c:2991
#25 0x00007f89dcbe360e in gst_element_set_state_func (element=0x7f891eb7a0a0 
[GstDecodeBin], state=GST_STATE_PLAYING) at gstelement.c:2906
#26 0x00007f89dcbe2dd7 in gst_element_sync_state_with_parent 
(element=0x7f891eb7a0a0 [GstDecodeBin]) at gstelement.c:2332
#27 0x00007f89dcda6d8d in g_slist_foreach (list=<optimized out>, func=0x7f89dcbe2ca0 
<gst_element_sync_state_with_parent>, user_data=0x0)
    at ../../../../glib/gslist.c:864
#28 0x00007f899804e7e5 in  () at 
/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstplayback.so
#29 0x00007f89dcbe2eee in gst_element_change_state 
(element=element@entry=0x7f89520a47c0 [GstURIDecodeBin], 
transition=GST_STATE_CHANGE_READY_TO_PAUSED) at gstelement.c:2952
#30 0x00007f89dcbe38ee in gst_element_continue_state 
(element=element@entry=0x7f89520a47c0 [GstURIDecodeBin], 
ret=ret@entry=GST_STATE_CHANGE_SUCCESS) at gstelement.c:2660
#31 0x00007f89dcbe30d5 in gst_element_change_state 
(element=element@entry=0x7f89520a47c0 [GstURIDecodeBin], 
transition=transition@entry=GST_STATE_CHANGE_NULL_TO_READY) at gstelement.c:2991
#32 0x00007f89dcbe360e in gst_element_set_state_func (element=0x7f89520a47c0 
[GstURIDecodeBin], state=GST_STATE_PLAYING)
    at gstelement.c:2906
---Type <return> to continue, or q <return> to quit---
#33 0x0000561b8928d999 in GstEnginePipeline::TransitionToNext() 
(this=this@entry=0x561b8f1cb3b0) at ./src/engines/gstenginepipeline.cpp:1007
#34 0x0000561b8928daf3 in GstEnginePipeline::SourceDrainedCallback(GstURIDecodeBin*, 
void*) (bin=<optimized out>, self=0x561b8f1cb3b0)
    at ./src/engines/gstenginepipeline.cpp:962
#35 0x00007f89d8f6ffce in ffi_call_unix64 () at 
/usr/lib/x86_64-linux-gnu/libffi.so.6
#36 0x00007f89d8f6f93f in ffi_call () at /usr/lib/x86_64-linux-gnu/libffi.so.6
#41 0x00007f89dce83ecf in <emit signal ??? on instance 0x7f899692c080 [GstURIDecodeBin]> 
(instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at 
../../../../gobject/gsignal.c:3447
    #37 0x00007f89dce68362 in g_cclosure_marshal_generic (closure=0x7f89968d6020, return_gvalue=0x0, 
n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized 
out>, marshal_data=<optimized out>) at ../../../../gobject/gclosure.c:1496
    #38 0x00007f89dce67b6d in g_closure_invoke (closure=0x7f89968d6020, 
return_value=0x0, n_param_values=1, param_values=0x7f89717f62b0, 
invocation_hint=0x7f89717f6230) at ../../../../gobject/gclosure.c:810
    #39 0x00007f89dce7a8f3 in signal_emit_unlocked_R 
(node=node@entry=0x561b8f228d20, detail=detail@entry=0, 
instance=instance@entry=0x7f899692c080, 
emission_return=emission_return@entry=0x0, 
instance_and_params=instance_and_params@entry=0x7f89717f62b0)
    at ../../../../gobject/gsignal.c:3635
    #40 0x00007f89dce83882 in g_signal_emit_valist (instance=<optimized out>, 
signal_id=<optimized out>, detail=<optimized out>, 
var_args=var_args@entry=0x7f89717f6460) at ../../../../gobject/gsignal.c:3391
#42 0x00007f89d8f6ffce in ffi_call_unix64 () at 
/usr/lib/x86_64-linux-gnu/libffi.so.6
#43 0x00007f89d8f6f93f in ffi_call () at /usr/lib/x86_64-linux-gnu/libffi.so.6
#48 0x00007f89dce83ecf in <emit signal ??? on instance 0x7f890fb117f0 [GstDecodeBin]> 
(instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at 
../../../../gobject/gsignal.c:3447
    #44 0x00007f89dce68362 in g_cclosure_marshal_generic (closure=0x7f899663ec20, return_gvalue=0x0, 
n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized 
out>, marshal_data=<optimized out>) at ../../../../gobject/gclosure.c:1496
    #45 0x00007f89dce67b6d in g_closure_invoke (closure=0x7f899663ec20, 
return_value=0x0, n_param_values=1, param_values=0x7f89717f6920, 
invocation_hint=0x7f89717f68a0) at ../../../../gobject/gclosure.c:810
    #46 0x00007f89dce7a8f3 in signal_emit_unlocked_R 
(node=node@entry=0x7f893c03ef70, detail=detail@entry=0, 
instance=instance@entry=0x7f890fb117f0, 
emission_return=emission_return@entry=0x0, 
instance_and_params=instance_and_params@entry=0x7f89717f6920)
    at ../../../../gobject/gsignal.c:3635
    #47 0x00007f89dce83882 in g_signal_emit_valist (instance=<optimized out>, 
signal_id=<optimized out>, detail=<optimized out>, 
var_args=var_args@entry=0x7f89717f6ad0) at ../../../../gobject/gsignal.c:3391
#49 0x00007f8998039340 in  () at 
/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstplayback.so
#50 0x00007f899803c183 in  () at 
/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstplayback.so
#51 0x00007f89dcbf849e in probe_hook_marshal (hook=0x7f89121a5740, 
data=0x7f89717f6d40) at gstpad.c:3561
#52 0x00007f89dcd77f54 in g_hook_list_marshal 
(hook_list=hook_list@entry=0x7f891c072128, may_recurse=may_recurse@entry=1, 
marshaller=marshaller@entry=0x7f89dcbf8080 <probe_hook_marshal>, 
data=data@entry=0x7f89717f6d40) at ../../../../glib/ghook.c:672
#53 0x00007f89dcbf7b77 in do_probe_callbacks (pad=pad@entry=0x7f891c072090 
[GstDecodePad], info=<optimized out>, defaultval=defaultval@entry=GST_FLOW_OK) 
at gstpad.c:3723
#54 0x00007f89dcbfaa48 in gst_pad_push_event_unchecked 
(pad=pad@entry=0x7f891c072090 [GstDecodePad], event=0x7f891212a8a0, 
type=type@entry=GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM) at gstpad.c:5371
#55 0x00007f89dcbfaff4 in push_sticky (pad=pad@entry=0x7f891c072090 
[GstDecodePad], ev=ev@entry=0x7f89717f6f50, 
user_data=user_data@entry=0x7f89717f6fc0) at ../gst/gstevent.h:436
#56 0x00007f89dcbf9138 in events_foreach (pad=pad@entry=0x7f891c072090 
[GstDecodePad], func=func@entry=0x7f89dcbfafa0 <push_sticky>, 
user_data=user_data@entry=0x7f89717f6fc0) at gstpad.c:612
#57 0x00007f89dcc04eb1 in check_sticky (event=0x7f891212a8a0, 
pad=0x7f891c072090 [GstDecodePad]) at gstpad.c:3981
#58 0x00007f89dcc04eb1 in gst_pad_push_event (pad=pad@entry=0x7f891c072090 
[GstDecodePad], event=0x7f891212a8a0) at gstpad.c:5537
#59 0x00007f89dcc05434 in event_forward_func (pad=pad@entry=0x7f891c072090 
[GstDecodePad], data=data@entry=0x7f89717f70c0)
    at ../gst/gstevent.h:436
#60 0x00007f89dcc00cbe in gst_pad_forward (pad=pad@entry=0x7f899692c570 
[GstProxyPad], forward=forward@entry=0x7f89dcc05370 <event_forward_func>, 
user_data=user_data@entry=0x7f89717f70c0) at gstpad.c:3008
#61 0x00007f89dcc00e05 in gst_pad_event_default (pad=0x7f899692c570 [GstProxyPad], 
parent=<optimized out>, event=0x7f891212a8a0)
    at gstpad.c:3105
#62 0x00007f89dcbfa637 in gst_pad_send_event_unchecked (pad=pad@entry=0x7f899692c570 
[GstProxyPad], event=event@entry=0x7f891212a8a0, type=<optimized out>, 
type@entry=GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM) at gstpad.c:5761
#63 0x00007f89dcbfab84 in gst_pad_push_event_unchecked 
(pad=pad@entry=0x7f89940b13a0 [GstPad], event=0x7f891212a8a0, 
type=type@entry=GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM) at gstpad.c:5406
#64 0x00007f89dcbfaff4 in push_sticky (pad=pad@entry=0x7f89940b13a0 [GstPad], 
ev=ev@entry=0x7f89717f72c0, user_data=user_data@entry=0x7f89717f7330) at 
../gst/gstevent.h:436
#65 0x00007f89dcbf9138 in events_foreach (pad=pad@entry=0x7f89940b13a0 [GstPad], 
func=func@entry=0x7f89dcbfafa0 <push_sticky>, user_data=user---Type <return> to 
continue, or q <return> to quit---
_data@entry=0x7f89717f7330) at gstpad.c:612
#66 0x00007f89dcc04eb1 in check_sticky (event=0x7f891212a8a0, 
pad=0x7f89940b13a0 [GstPad]) at gstpad.c:3981
#67 0x00007f89dcc04eb1 in gst_pad_push_event (pad=0x7f89940b13a0 [GstPad], 
event=0x7f891212a8a0) at gstpad.c:5537
#68 0x00007f89dced94ca in  () at /usr/lib/x86_64-linux-gnu/libgstaudio-1.0.so.0
#69 0x00007f89dcede2cd in  () at /usr/lib/x86_64-linux-gnu/libgstaudio-1.0.so.0
#70 0x00007f89dcbfa637 in gst_pad_send_event_unchecked (pad=pad@entry=0x7f89940b1150 
[GstPad], event=event@entry=0x7f891212a8a0, type=<optimized out>, 
type@entry=GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM) at gstpad.c:5761
#71 0x00007f89dcbfab84 in gst_pad_push_event_unchecked 
(pad=pad@entry=0x7f890f81a100 [GstPad], event=0x7f891212a8a0, 
type=type@entry=GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM) at gstpad.c:5406
#72 0x00007f89dcbfaff4 in push_sticky (pad=pad@entry=0x7f890f81a100 [GstPad], 
ev=ev@entry=0x7f89717f76e0, user_data=user_data@entry=0x7f89717f7750) at 
../gst/gstevent.h:436
#73 0x00007f89dcbf9138 in events_foreach (pad=pad@entry=0x7f890f81a100 [GstPad], 
func=func@entry=0x7f89dcbfafa0 <push_sticky>, 
user_data=user_data@entry=0x7f89717f7750) at gstpad.c:612
#74 0x00007f89dcc04eb1 in check_sticky (event=0x7f891212a8a0, 
pad=0x7f890f81a100 [GstPad]) at gstpad.c:3981
#75 0x00007f89dcc04eb1 in gst_pad_push_event (pad=0x7f890f81a100 [GstPad], 
event=0x7f891212a8a0) at gstpad.c:5537
#76 0x00007f89dcce84e7 in gst_base_parse_loop (pad=<optimized out>) at 
gstbaseparse.c:3621
#77 0x00007f89dcc30f41 in gst_task_func (task=0x7f88e17463b0 [GstTask]) at 
gsttask.c:332
#78 0x00007f89dcdb0ad3 in g_thread_pool_thread_proxy (data=<optimized out>) at 
../../../../glib/gthreadpool.c:307
#79 0x00007f89dcdb0135 in g_thread_proxy (data=0x7f88fb607400) at 
../../../../glib/gthread.c:784
#80 0x00007f89dd154f2a in start_thread (arg=0x7f89717f8700) at 
pthread_create.c:463
#81 0x00007f89db094edf in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:95
(gdb) c

... but then the thread does exit later, so it's not leaking threads. But this looks increasingly like a gstreamer bug.

Reply via email to