Package: lua-5.1
Version: 5.1.5-7.1
Severity: normal

Dear Maintainer,

A multithreaded server where each thread uses its own lua state to run lua code 
crashes during socket IO/http calls via lua-socket version 3.0~rc1-3.  Crashes 
do not occur if I use my own lua compilation with -pthread flag. There seems to 
be some discussion about this topic in the internet, for example: 
https://lwn.net/Articles/654762/  .

Therefore I request that lua would be built with the -pthread flag in upcoming 
package versions.

Several other well known scripting languages such as Python, Perl and Ruby  are 
compiled with -pthread to allow safe multithreading.

A suggested pacth from diff: 
---
 debian/rules | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/debian/rules b/debian/rules
index 6b17acb..f800c54 100755
--- a/debian/rules
+++ b/debian/rules
@@ -20,9 +20,8 @@ DOC_DIR = debian/$(LUA)-doc/usr/share/doc/$(LUA)-doc
 LUA_MULTIARCH_INCLUDE = $(DEB_DESTDIR)/include/$(DEB_HOST_MULTIARCH)/
 LUA_MULTIARCH = lua5.1-deb-multiarch.h

-ifeq (hurd,$(shell dpkg-architecture -qDEB_HOST_ARCH_OS))
-       LDFLAGS=-lpthread
-endif
+CFLAGS += -pthread
+LDFLAGS += -pthread

 %:
        dh $*
--
2.1.4


Kind regards,
Vesa Meskanen

-- System Information:
Debian Release: 8.1
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Reply via email to