GithubHelp home page GithubHelp logo

Comments (5)

wtarreau avatar wtarreau commented on May 19, 2024 3

just merged Olivier's fix.

from haproxy.

TimWolla avatar TimWolla commented on May 19, 2024

I can confirm the issue. It appears that the unique ID is related to this. I made this change:

diff --git i/src/memory.c w/src/memory.c
index 4290c4b3..1888020e 100644
--- i/src/memory.c
+++ w/src/memory.c
@@ -107,6 +107,9 @@ struct pool_head *create_pool(char *name, unsigned int size, unsigned int flags)
  */
 void *__pool_refill_alloc(struct pool_head *pool, unsigned int avail)
 {
+       if (memcmp(pool->name, "spoe_appctx", 6) == 0) {
+               abort();
+       }
        void *ptr = NULL;
        int failed = 0;

and received the following abort:

==31060==
==31060== Process terminating with default action of signal 6 (SIGABRT)
==31060==    at 0x5B8C428: raise (raise.c:54)
==31060==    by 0x5B8E029: abort (abort.c:89)
==31060==    by 0x4E71E5: __pool_refill_alloc (memory.c:111)
==31060==    by 0x42C6D9: pool_alloc_dirty (memory.h:154)
==31060==    by 0x42C6D9: pool_alloc (memory.h:229)
==31060==    by 0x42C6D9: http_process_request (proto_http.c:3770)
==31060==    by 0x45F736: process_stream (stream.c:1909)
==31060==    by 0x4DFAD2: process_runnable_tasks (task.c:229)
==31060==    by 0x48EC9A: run_poll_loop (haproxy.c:2415)
==31060==    by 0x48EC9A: run_thread_poll_loop (haproxy.c:2481)
==31060==    by 0x409929: main (haproxy.c:3084)
==31060==

from haproxy.

cognet avatar cognet commented on May 19, 2024

Hi,

I confirm it is likely related to the unique-id pool. I can't yet reproduce it, though, I'm still investigating.

from haproxy.

cognet avatar cognet commented on May 19, 2024

If you can, please apply the attached patch, adapted for 1.8.

From 2981fd47770ca1b64d14e7562abf2e7eab2d2108 Mon Sep 17 00:00:00 2001
From: Olivier Houchard <[email protected]>
Date: Fri, 1 Feb 2019 18:10:46 +0100
Subject: [PATCH] BUG/MEDIUM: stream: Don't forget to free s->unique_id in
 stream_free().

In stream_free(), free s->unique_id. We may still have one, because it's
allocated in log.c::strm_log() no matter what, even if it's a TCP connection
and thus it won't get free'd by http_end_txn().
Failure to do so leads to a memory leak.

This should probably be backported to all maintained branches.
---
 src/stream.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/stream.c b/src/stream.c
index 507cd2f4..b40a1bca 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -339,6 +339,8 @@ static void stream_free(struct stream *s)
 		offer_buffers(NULL, tasks_run_queue + applets_active_queue);
 	}
 
+	pool_free(pool_head_uniqueid, s->unique_id);
+
 	hlua_ctx_destroy(s->hlua);
 	s->hlua = NULL;
 	if (s->txn)
-- 
2.20.1

If not, a workaround would be to move unique-id-format and unique-id-header from defaults to each HTTP frontends.

Olivier

from haproxy.

vdombrovski avatar vdombrovski commented on May 19, 2024

Moving the unique-id options to each frontend does seem to work-around the issue. Thank you!

from haproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.