Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
gst-editing-services
gst-editing-services
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 77
    • Issues 77
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 10
    • Merge Requests 10
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GStreamer
  • gst-editing-servicesgst-editing-services
  • Issues
  • #95

Closed
Open
Opened Mar 07, 2020 by Raphaël Bentégeac@Ralayax

Memory leak when unrefing GESTimeline

Hello,

I accidentally found out that a GESTimeline doesn't get properly destroyed even when all the references disappear. I have randomly searched for other structs that don't get cleaned up properly, both in GES and in Gst, so far it seems pretty specific to GESTimeline.

I'm using ubuntu 19.10 (eoan), so libgstreamer and libges 1.16.1.

I'm not sure if this can be used to perform DOS since a LOT of timelines have to be created, but I'm putting this as confidential just to be sure.

Here is a little piece of C code that tests the memory leak.

#include <stdio.h>

#include <ges/ges.h>

int test_ges() {
  GESTimeline* timeline = ges_timeline_new();
  gst_object_unref(timeline);

  return 0;
}

int main(int argc, char** argv) {
  gst_init(&argc, &argv);
  ges_init();

  for(int i = 0; i < 150000; ++i) {
    if(i%100 == 0) {
      printf("%i\n", i);
    }
    test_ges();
  }

  printf("Press Any Key to Continue\n");
  getchar(); 
}

Here is the evidence of the memory leak.

26629:   bin/gestest
000055cf6c490000      4K r---- gestest
000055cf6c491000      4K r-x-- gestest
000055cf6c492000      4K r---- gestest
000055cf6c493000      4K r---- gestest
000055cf6c494000      4K rw--- gestest
000055cf6c7d1000 159284K rw---   [ anon ]
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: gstreamer/gst-editing-services#95