importing posix in Lua 5.2 on bionic fails to load posix.ctype

Bug #1752082 reported by Lars Viklund
124
This bug affects 26 people
Affects Status Importance Assigned to Milestone
lua-posix (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The following was originally noticed while trying to use Lmod, but can be reproduced with the standalone Lua interpreter. Lmod has worked fine earlier in the alpha, this behaviour is new within the last bunch of days.

lars@mononoke:~$ lsb_release -rd
Description: Ubuntu Bionic Beaver (development branch)
Release: 18.04

lars@mononoke:~$ lua5.2 <<< 'require("posix")'
lua5.2: /usr/share/lua/5.2/posix/init.lua:29: module 'posix.ctype' not found:
 no field package.preload['posix.ctype']
 no file '/usr/local/share/lua/5.2/posix/ctype.lua'
 no file '/usr/local/share/lua/5.2/posix/ctype/init.lua'
 no file '/usr/local/lib/lua/5.2/posix/ctype.lua'
 no file '/usr/local/lib/lua/5.2/posix/ctype/init.lua'
 no file '/usr/share/lua/5.2/posix/ctype.lua'
 no file '/usr/share/lua/5.2/posix/ctype/init.lua'
 no file './posix/ctype.lua'
 no file '/usr/local/lib/lua/5.2/posix/ctype.so'
 no file '/usr/lib/x86_64-linux-gnu/lua/5.2/posix/ctype.so'
 no file '/usr/lib/lua/5.2/posix/ctype.so'
 no file '/usr/local/lib/lua/5.2/loadall.so'
 no file './posix/ctype.so'
 no file '/usr/local/lib/lua/5.2/posix.so'
 no file '/usr/lib/x86_64-linux-gnu/lua/5.2/posix.so'
 no file '/usr/lib/lua/5.2/posix.so'
 no file '/usr/local/lib/lua/5.2/loadall.so'
 no file './posix.so'
stack traceback:
 [C]: in function 'require'
 /usr/share/lua/5.2/posix/init.lua:29: in main chunk
 [C]: in function 'require'
 stdin:1: in main chunk
 [C]: in ?

lars@mononoke:~$ dpkg -l lua-posix
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===========================-==================-==================-============================================================
ii lua-posix:amd64 33.4.0-2 amd64 posix library for the Lua language
ii lua5.2 5.2.4-1.1build1 amd64 Simple, extensible, embeddable programming language

lars@mononoke:~$ dpkg -L lua-posix
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/liblua5.1-posix.so.1.0.0
/usr/lib/x86_64-linux-gnu/liblua5.2-posix.so.1.0.0
/usr/lib/x86_64-linux-gnu/liblua5.3-posix.so.1.0.0
/usr/lib/x86_64-linux-gnu/lua
/usr/lib/x86_64-linux-gnu/lua/5.1
/usr/lib/x86_64-linux-gnu/lua/5.2
/usr/lib/x86_64-linux-gnu/lua/5.3
/usr/share
/usr/share/doc
/usr/share/doc/lua-posix
/usr/share/doc/lua-posix/changelog.Debian.gz
/usr/share/doc/lua-posix/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/lua-posix
/usr/share/lua
/usr/share/lua/5.1
/usr/share/lua/5.1/posix
/usr/share/lua/5.1/posix/_argcheck.lua
/usr/share/lua/5.1/posix/compat.lua
/usr/share/lua/5.1/posix/deprecated.lua
/usr/share/lua/5.1/posix/init.lua
/usr/share/lua/5.1/posix/sys.lua
/usr/share/lua/5.1/posix/util.lua
/usr/share/lua/5.2
/usr/share/lua/5.2/posix
/usr/share/lua/5.3
/usr/share/lua/5.3/posix
/usr/lib/x86_64-linux-gnu/liblua5.1-posix.so.1
/usr/lib/x86_64-linux-gnu/liblua5.2-posix.so.1
/usr/lib/x86_64-linux-gnu/liblua5.3-posix.so.1
/usr/lib/x86_64-linux-gnu/lua/5.1/posix_c.so
/usr/lib/x86_64-linux-gnu/lua/5.2/posix_c.so
/usr/lib/x86_64-linux-gnu/lua/5.3/posix_c.so
/usr/share/lua/5.2/posix/_argcheck.lua
/usr/share/lua/5.2/posix/compat.lua
/usr/share/lua/5.2/posix/deprecated.lua
/usr/share/lua/5.2/posix/init.lua
/usr/share/lua/5.2/posix/sys.lua
/usr/share/lua/5.2/posix/util.lua
/usr/share/lua/5.3/posix/_argcheck.lua
/usr/share/lua/5.3/posix/compat.lua
/usr/share/lua/5.3/posix/deprecated.lua
/usr/share/lua/5.3/posix/init.lua
/usr/share/lua/5.3/posix/sys.lua
/usr/share/lua/5.3/posix/util.lua

Revision history for this message
Peter Heywood (peethwd) wrote :

This also effects Lmod on my system.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in lua-posix (Ubuntu):
status: New → Confirmed
Revision history for this message
Alex G (flamefire) wrote :

The reason for this happening is that lua-posix changed its main module name from posix_c to posix. The maintainers of the debian package missed that and still install a symlink from /usr/lib/x86_64-linux-gnu/lua/5.1/posix_c.so.

This can be seen in the output above (no file '/usr/lib/x86_64-linux-gnu/lua/5.1/posix.so') which shows that a posix.so is searched for.

The solution for the users is to create a symlink to that file: sudo ln -s /usr/lib/x86_64-linux-gnu/lua/5.1/posix_c.so /usr/lib/x86_64-linux-gnu/lua/5.1/posix.so
Or simply rename the posix_c.so to posix.so
WARNING: This has to be undone before upgrading after a fix from the package maintainers gets released or the upgrade might fail.

The maintainers should fix that in the packages ASAP.

Revision history for this message
Thomas (tvk7) wrote :

The link, at least for me, brings up the next error:

module avail
/usr/bin/lua: error loading module 'posix.ctype' from file '/usr/lib/x86_64-linux-gnu/lua/5.2/posix.so':
 /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so: undefined symbol: lua_tointeger
stack traceback:
 [C]: in ?
 [C]: in function 'require'
 /usr/share/lua/5.2/posix/init.lua:29: in main chunk
 [C]: in function 'require'
 /usr/share/lmod/lmod/libexec/lmod:64: in main chunk
 [C]: in ?

Any clue?

Revision history for this message
OliFre (freyermuth) wrote :

Debian has just released a fixed package version, lua-posix 33.4.0-3:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891541#34

It would be best if this could be synced before Bionic Beaver LTS is released with the currently broken version.

Revision history for this message
Peter Heywood (peethwd) wrote :

@Thomas (Tvk7) it looks like you are using lua 5.2, where as Alex G's symlink solution is for lua 5.1.

The relevant symlink for 5.2 would be:
sudo ln -s /usr/lib/x86_64-linux-gnu/lua/5.2/posix_c.so /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so

Revision history for this message
Egil Hjelmeland (hjelmis) wrote :

We need lua-posix 33.4.0-3 on Bionic

Revision history for this message
Egil Hjelmeland (hjelmis) wrote :

Works for me: Grab lua-posix 33.4.0-3 binary deb from https://packages.ubuntu.com/cosmic/lua-posix and install on bionic.

Revision history for this message
Psychotron (redm) wrote :

Could you pleeeease roll out the simple fix for the simple problem? This breaks all 3rd party software with dependency to lua 5.2 (and probably also 5.3?). It's a PITA to tell all users how to manually fix this problem.

Revision history for this message
Sebastian Potthoff (sebpo) wrote :

Can confirm and agree with the previous comments. This should have been fixed in the LTS .1 release, but it's not. It breaks my Lmod installation and fixing it manually on a couple of workstations is annoying to say the least. Please roll out 33.4.03!

tags: added: bionic packaging
Revision history for this message
Nathan (g-nathan) wrote :

Hmm, this is still not fixed! :(
Without the fix you get a window, after logging in, with a stack trace saying "posix.ctype not found".

Revision history for this message
Erik Lönroth (erik-lonroth) wrote :

This is still not fixed.

Broken. Need to revert to "environment-modules" legacy.

Revision history for this message
Alex Chekholko (alex-chekholko) wrote :

Yes, it looks like we need to go from lua-posix package version 33.4.0-2 to something slightly newer. This is on Ubuntu 18.04.x

Revision history for this message
Esko Järnfors (esko-jarnfors) wrote :

Please fix this, we are getting the same error with lmod.

This has been fixed in debian at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891541 but it is still broken in Bionic.

Revision history for this message
Esko Järnfors (esko-jarnfors) wrote :

Here's the packaging patch from debian, please fix this issue in bionic.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "lua-posix-debbug-891541.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.