Welcome! Log In Create A New Profile

Advanced

Re: Guidance developing dynamic modules which load shared libraries

Roman Arutyunyan
August 26, 2024 07:36AM
Hi Joshua,

> On 23 Aug 2024, at 1:48 PM, Joshua O'Sullivan <joshua@firetail.io> wrote:
>
> Hey everyone,
>
> We're currently developing a dynamic module which itself loads another shared library, which we've written in Golang. It seems to be a bit off the beaten track - I can't find any guidance in the documentation pertaining to loading shared libraries in dynamic modules, and there's only one example in the wild I can find of this being attempted before - https://github.com/robinmonjo/ngx_http_l?tab=readme-ov-file#issues-encountered.
>
> We've got a proof-of-concept, however we're struggling with where to store the shared library - keeping it in the main configuration seems to make sense, but calls to `dlopen` in our create or init main configuration functions seem to cause NGINX to hang when it handles requests. We're currently using version 1.24.0.

Indeed you can load a shared library in create_conf or init_conf and store its handle in the configuration. Also you need to register a cycle pool cleanup handler which would release the library.

Could you please provide a stack trace of nginx when it hangs?

----
Roman Arutyunyan
arut@nginx.com




_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Guidance developing dynamic modules which load shared libraries

Joshua O'Sullivan 156 August 23, 2024 05:50AM

Re: Guidance developing dynamic modules which load shared libraries

Roman Arutyunyan 27 August 26, 2024 07:36AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 118
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready