[Bug 235158] lang/lua53 no longer linked against pthread

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jan 25 05:52:47 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235158

--- Comment #9 from Russell Haley <russ.haley at gmail.com> ---
>>! In D18939#404544, @andrew_tao173.riddles.org.uk wrote:
> Russ, did you check whether that test actually failed without the patch? Because it works fine for me without changing a thing.

Well this is fun. I have an 11.1 jail that has only ever had lua53 installed
from pkg (on my server, where I tested the bug initially). The test fails in
that jail every time. 

The VirtualBox VM on my laptop is 11.1 as well; it's my dev computer. The test
failed when I ran Lua53 from ports prior to building with this patch. I noted
after installing the patched version, the test *failed* the first time I ran
lua with the test script but *succeeded* every time after that. I assumed that
since "running a script is deterministic" I had clearly done something weird.
Now check the two different shell outputs:


```
russellh at g1 ~/P/n/b/lua> lua53
fish: Unknown command 'lua53'
russellh at g1 ~/P/n/b/lua> sudo pkg install lua53
Updating GhostBSD repository catalogue...
GhostBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        lua53: 5.3.5

Number of packages to be installed: 1

The process will require 1 MiB more space.

Proceed with this action? [y/N]: y
[1/1] Installing lua53-5.3.5...
[1/1] Extracting lua53-5.3.5: 100%
russellh at g1 ~/P/n/b/lua> lua53
Lua 5.3.5  Copyright (C) 1994-2018 Lua.org, PUC-Rio
>russellh at g1 ~/P/n/b/lua> cd /tmp
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
data
russellh at g1 /tmp> lua53 pth-test.lua 
data
russellh at g1 /tmp> 
```

I (naturally) expected this to fail every time because the installation is from
pkg (with no -pthread)? I then removed the pkg installation and built using the
patched make file, but without -pthread. Here is my link step for proof:


```
> --- liblua-5.3.so ---
> cc -o liblua-5.3.so -Wall -Wextra -DLUA_COMPAT_5_2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN -DLUA_USE_READLINE_DL -isystem /usr/local/include -O2 -pipe  -fPIC -fstack-protector -isystem /usr/local/include  -fstack-protector -fstack-protector -shared -Wl,-soname=liblua-5.3.so lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o -lm
> --- liblua-5.3.a ---
> ar -crD liblua-5.3.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o  lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o  ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o  lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o 
> ranlib liblua-5.3.a
> --- lua53 ---
> cc -o lua53  -fstack-protector lua.o liblua-5.3.a -lm -Wl,-E -L/usr/local/lib
> --- luac53 ---
> cc -o luac53  -fstack-protector luac.o liblua-5.3.a -lm -Wl,-E -L/usr/local/lib
> 

```


Now look at the following tests: 


```
russellh at g1 /tmp> lua53 pth-test.lua 
data
russellh at g1 /tmp> lua53 pth-test.lua 
data
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
data
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
russellh at g1 /tmp> lua53 pth-test.lua 
data


``` 

uuuh, what? For counterpoint, here's my server that has only had lua from pkg
and has never linked to -pthread:


```
russellh at freebird:~/lua_bug$ uname -a
FreeBSD freebird 11.1-RELEASE FreeBSD 11.1-RELEASE #0: Sat Jun  2 22:49:42 PDT
2018     russellh at sylvester:/usr/obj/usr/src/sys/GENERIC  amd64
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$ lua53 bugtest.lua
russellh at freebird:~/lua_bug$

```

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-ports-bugs mailing list