Re: [libmicrohttpd] SEGFAULT after upgrading from 0.9.77 to 1.0.1

2024-02-27 Thread silvioprog
The problem was in my test cases, because it tries to mock MHD. Basically I just had to create fake instances like "struct MHD_Connection *con = sg_alloc(256)" and fixed the tests: https://github.com/risoflora/libsagui/commit/bd8304ebe439095312d7232aec5f88ad36a20157 On Tue, Feb 27, 2024 at 1:58 PM

Re: [libmicrohttpd] SEGFAULT after upgrading from 0.9.77 to 1.0.1

2024-02-27 Thread Markus Doppelbauer via libmicrohttpd
Hi Evgeny, unsigned int daemon_flags = MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_POLL | MHD_ALLOW_SUSPEND_RESUME | MHD_USE_ERROR_LOGResponse is generated in a dedicated thread.I will try to write a testcase. Best wishes Am Dienstag, dem 27.02.2024 um 18:19 +0100 schrieb Evgeny Grin: > Hi Markus,

Re: [libmicrohttpd] SEGFAULT after upgrading from 0.9.77 to 1.0.1

2024-02-27 Thread Evgeny Grin
Hi Markus, Can you share a larger piece of code or give more details, like used mode (internal polling or external polling), polling function, other relevant information? -- Evgeny 27-Feb-2024 17:58 (UTC+0100), Markus Doppelbauer via libmicrohttpd wrote: What was your issue? How did you fix

Re: [libmicrohttpd] SEGFAULT after upgrading from 0.9.77 to 1.0.1

2024-02-27 Thread Markus Doppelbauer via libmicrohttpd
What was your issue? How did you fix it? I am getting "Assertion failed" from "connection.c:6864": case MHD_CONNECTION_CHUNKED_BODY_UNREADY: mhd_assert (0); This happens if I create a response from callback, e.g.: struct MHD_Response *response = MHD_create_response_from_callback( MHD_SIZE

Re: [libmicrohttpd] SEGFAULT after upgrading from 0.9.77 to 1.0.1

2024-02-26 Thread silvioprog
Problem fixed! \o/ I have a couple of test cases that call some MHD functions internally, but after creating fake MHD_Connections to pass to the functions instead of NULL the problem was fixed. Thanks a lot guys! On Mon, Feb 26, 2024 at 5:41 PM silvioprog wrote: > Seems like it will be hard to

Re: [libmicrohttpd] SEGFAULT after upgrading from 0.9.77 to 1.0.1

2024-02-26 Thread silvioprog
Hey Christian. =) Yes sure, I'll try to reproduce the problem and provide all the logs. On Mon, Feb 26, 2024 at 4:23 PM Christian Grothoff wrote: > Hi Silvio, > > Well, we didn't try to break anything with the update, so you shouldn't > have to change anything on your side either. Can you send

Re: [libmicrohttpd] SEGFAULT after upgrading from 0.9.77 to 1.0.1

2024-02-26 Thread Christian Grothoff
Hi Silvio, Well, we didn't try to break anything with the update, so you shouldn't have to change anything on your side either. Can you send us a stack trace/valgrind output and/or test code to reproduce? That'll expedite a fix... Happy hacking! -Christian On 2/26/24 19:44, silvioprog wrot

Re: [libmicrohttpd] Segfault

2023-03-03 Thread Christian Grothoff
Remove MHD_OPTION_NOTIFY_COMPLETED --- or pass two extra arguments with the function and closure you want MHD to call upon completion. Right now, you're telling MHD to jump to a bad address upon connection completion. On 3/3/23 15:02, klemens wrote: Hi all, I have an issue with a segfault I

Re: [libmicrohttpd] SEGFAULT in digest_calc_ha1_from_user()

2019-04-14 Thread Christian Grothoff
Hi Tim, Technically this cannot happen, the 'digest != NULL' check before correlates with password == NULL and vice versa. But, I'm happy to add an additional assertion to make static analysis happier... I've applied your realloc() patch as well. Happy hacking! Christian On 4/14/19 9:08 PM, Ti

Re: [libmicrohttpd] Segfault after MHD_quiesce_daemon()

2015-07-19 Thread Christian Grothoff
Hi! We need to understand the issue better before updating the documentation on this kind of speculative fix -- especially as the fix may work for your application, but may not be general. -Christian On 07/19/2015 08:16 PM, Markus Doppelbauer wrote: > Hello, > > Since I have moved the callM

Re: [libmicrohttpd] Segfault after MHD_quiesce_daemon()

2015-07-19 Thread Markus Doppelbauer
Hello, Since I have moved the call MHD_get_daemon_info( MHD_DAEMON_INFO_CURRENT_CONNECTIONS ) toMHD_NotifyConnectionCallback() no segfaults did occur. Could this be true? Maybe update the documentation? Thanks a lot Markus Am Samstag, den 18.07.2015, 17:25 +0200 schrieb Markus Doppelbaue

Re: [libmicrohttpd] Segfault after MHD_quiesce_daemon()

2015-07-18 Thread Markus Doppelbauer
Hi, Maybe it is not allowed to call MHD_get_daemon_info( MHD_DAEMON_INFO_CURRENT_CONNECTIONS ) at any time from any thread? Maybe only from MHD_NotifyConnectionCallback() ? Thanks a lot Markus Am Samstag, den 18.07.2015, 17:18 +0200 schrieb Markus Doppelbauer: > Hi, > > Sorry - I can't prov

Re: [libmicrohttpd] Segfault after MHD_quiesce_daemon()

2015-07-18 Thread Markus Doppelbauer
Hi, Sorry - I can't provide a testcase - I only have the coredumps. IMHO the problem is, that two threads work in the same critical section MHD_cleanup_connections() #1 MHD-Thread from microhttpd/daemon.c:2937 from MHD_select_thread() #2 Worker-thread from microhttpd/daemon.c:4630from MHD

Re: [libmicrohttpd] Segfault after MHD_quiesce_daemon()

2015-07-18 Thread Christian Grothoff
Hi! I'm sorry, but I still don't even see how the race could happen. I checked all calls to MHD_pool_destroy, and the respective connection is always in 1 of 3 disjoint ownership states: 1) never aliased, about to be freed (failures during connection setup) 2) 'active' connection, going down with

Re: [libmicrohttpd] Segfault after MHD_quiesce_daemon()

2015-07-17 Thread Markus Doppelbauer
Sorry the NULL patch is the wrong fix - it makes it only more unlikely to double-free() the pool. The scheduler could interrupt right before "pos->pool = NULL". Maybe the only solution is either to protect "MHD_cleanup_connections()" with a mutex or to remove the call to "MHD_cleanup_connections()

Re: [libmicrohttpd] Segfault after MHD_quiesce_daemon()

2015-07-16 Thread Markus Doppelbauer
Hello, Maybe simply nullify "pos->pool" after free()? Thanks a lot Markus } } MHD_pool_destroy (pos->pool); + pos->pool = NULL; #if HTTPS_SUPPORT if (NULL != pos->tls_session) gnutls_deinit (pos->tls_session);

Re: [libmicrohttpd] Segfault after MHD_quiesce_daemon()

2015-07-16 Thread Markus Doppelbauer
Hello, Maybe simply nullify "pos->pool" after MHD_pool_destroy()"? Should avoid this double-free(). Or is there a chance to get the number of open connections without calling "MHD_cleanup_connections()"? Thanks a lot Markus } } MHD_pool_destroy (pos->pool); +