Uploaded image for project: 'OpenAM Agents'
  1. OpenAM Agents
  2. AMAGENTS-181

Memory leak in case of network connection failure

    Details

      Description

      This happens when there are connection issues between agent and AM because the connection is not closed, only freed in certain cases.
      Valgrind shows these:

      256 bytes in 4 blocks are definitely lost in loss record 560 of 653
      ==29881==    at 0x4A069EE: malloc (vg_replace_malloc.c:270)
      ==29881==    by 0x33792D03AA: gaih_inet (in /lib64/libc-2.12.so)
      ==29881==    by 0x33792D2F2F: getaddrinfo (in /lib64/libc-2.12.so)
      ==29881==    by 0x56CFA93: am_net_sync_connect (net_client.c:470)
      ==29881==    by 0x56D2816: do_net_connect (net_ops.c:911)
      ==29881==    by 0x56D549F: am_agent_login (net_ops.c:1040)
      ==29881==    by 0x56C116D: am_get_agent_config (config.c:1639)
      ==29881==    by 0x572B1C6: amagent_auth_handler (agent22.c:802)
      ==29881==    by 0x43505F: ap_run_access_checker (request.c:77)
      ==29881==    by 0x436FFD: ap_process_request_internal (request.c:185)
      ==29881==    by 0x45441F: ap_process_request (http_request.c:292)
      ==29881==    by 0x45138F: ap_process_http_connection (http_core.c:190)

      ==29882== 128 bytes in 4 blocks are definitely lost in loss record 548 of 653
      ==29882== at 0x4A0577B: calloc (vg_replace_malloc.c:593)
      ==29882== by 0x56CF8CD: am_net_sync_connect (net_client.c:646)
      ==29882== by 0x56D2816: do_net_connect (net_ops.c:911)
      ==29882== by 0x56D549F: am_agent_login (net_ops.c:1040)
      ==29882== by 0x56C116D: am_get_agent_config (config.c:1639)
      ==29882== by 0x572B1C6: amagent_auth_handler (agent22.c:802)
      ==29882== by 0x43505F: ap_run_access_checker (request.c:77)
      ==29882== by 0x436FFD: ap_process_request_internal (request.c:185)
      ==29882== by 0x45441F: ap_process_request (http_request.c:292)
      ==29882== by 0x45138F: ap_process_http_connection (http_core.c:190)
      ==29882== by 0x44136F: ap_run_process_connection (connection.c:43)
      ==29882== by 0x467F67: child_main (prefork.c:667)

      REPRODUCTION STEPS
      =====================
      Note this could happen in other connection failures to OpenAM. To detect this using valgrind -v --log-file=yourlog --trace-children=yes --leak-check=full ./httpd -k start
      1. Start httpd before AM
      2. try to access a protected url
      failed to get agent configuration instance / failed to locate instance configuration seen in logs
      [if using valgrind]
      3. stop httpd
      EXPECTED BEHAVIOUR
      ====================
      Memory will not leak

      ACTUAL BEHAVIOUR
      =================
      Memory leak observed.

        Attachments

          Activity

            People

            • Assignee:
              mareks Mareks Malnacs
              Reporter:
              alex.levin@forgerock.com Alex Levin
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: