Welcome! Log In Create A New Profile

Advanced

[PATCH] optional setproctitle functionality

Dirk Feytons
October 09, 2012 03:56AM
Hi,

I bumped into an interesting issue. On a Linux-based embedded platform
(using a rather old uClibc toolchain) the setproctitle code interferes
with the dynamic linker when LD_LIBRARY_PATH is used and the code
tries to dlopen() a library. Apparently the linker doesn't refetch the
LD_LIBRARY_PATH variable but uses a cached pointer. However, the
setproctitle code has messed with the string data leading to a
LD_LIBRARY_PATH that has become invalid or empty.

Exact scenario:
- nginx with ngx_lua module
- My Lua code loads a Lua C module.
- The Lua VM uses dlopen() to load that module.
- The dynamic linker tries to load the dependencies.
- For those dependencies to be found I've set LD_LIBRARY_PATH but it
gets lost as described above.
- The dynamic linker fails to find a dependency and the Lua VM reports
that the module could not be loaded with the error "File not found".

So I've created a patch (against 1.3.7) to add a configure option
--without-setproctitle that allows you to disable the setproctitle
functionality. It might be considered overkill to add a configure
option for this but I'll leave that up to you to decide. I've also
only tested on Linux; I'm not sure everything still works for BSD.


Regards,

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

[PATCH] optional setproctitle functionality Attachments

Dirk Feytons 1317 October 09, 2012 03:56AM



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

Online Users

Guests: 203
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready