Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-601

Memory leaks from valgrind

    • Type: Icon: Task Task
    • Resolution: Done
    • WT1.6.4
    • Affects Version/s: None
    • Component/s: None

      I've been debugging the logging valgrind issues this morning and it seems to be a more general issue than just the logging code. The leak comes from *log_openfile's use of *wt_scr_alloc when called from *wt_logmgr_create. That code correctly calls *wt_scr_free, but __wt_scr_discard is never called.

      The underlying issue is that the server threads are handled in *wt_connection_open, and that is called before the connection's session is opened, and conn->session is, at that time, set to dummy_session. The leak happens because the scratch buffers are allocated in the dummy session, and the *wt_connection_close code does not call session->close on the dummy_session. So resources allocated in the context of the dummy session are not closed/discarded/freed.

      Logging is not the only startup code that could be affected by this. __ckpt_server_config also uses a scratch buffer but none of the sample programs that valgrind runs configures checkpoints in a way to trigger it. But if they did, that should show up too.

      I'm going to mull over various solutions.

      -

            Assignee:
            sue.loverso@mongodb.com Susan LoVerso
            Reporter:
            sue.loverso@mongodb.com Susan LoVerso
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: