#1519 broken socket.smtp support

Reporter Anton
Owner Nobody
Created
Updated
Stars ★ (1)
Tags
  • Priority-Medium
  • Type-Defect
  • Status-Invalid
  1. Anton on

    Hi! Thanks for the useful software, much appreciated! I've wanted to use socket.smtp in one of the modules and after adding: local smtp = require "socket.smtp"; Prosody httpserver stops serving the page related to module, nothing in the logs even with debug level. Issue is simply reproducible, just add directive to any of the modules. Configuration: 67-Ubuntu bionic SMP Mon Mar 2 07:24:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux Prosody 0.11.5 # Prosody directories Data directory: /var/lib/prosody Config directory: /etc/prosody Source directory: /usr/lib/prosody Plugin directories: /usr/share/jitsi-meet/prosody-plugins/ /usr/lib/prosody/modules/ # Lua environment Lua version: Lua 5.2 Lua module search paths: /usr/lib/prosody/?.lua /usr/local/share/lua/5.2/?.lua /usr/local/share/lua/5.2/?/init.lua /usr/local/lib/lua/5.2/?.lua /usr/local/lib/lua/5.2/?/init.lua /usr/share/lua/5.2/?.lua /usr/share/lua/5.2/?/init.lua Lua C module search paths: /usr/lib/prosody/?.so /usr/local/lib/lua/5.2/?.so /usr/lib/x86_64-linux-gnu/lua/5.2/?.so /usr/lib/lua/5.2/?.so /usr/local/lib/lua/5.2/loadall.so LuaRocks: Not installed # Network Backend: select # Lua module versions DBI: 0.7 lfs: LuaFileSystem 1.6.3 lxp: LuaExpat 1.3.0 socket: LuaSocket 3.0-rc1 ssl: 0.6 root@ip:/usr/share/lua/5.2/socket# ls -latr total 8 lrwxrwxrwx 1 root root 24 Feb 23 2018 url.lua -> ../../5.1/socket/url.lua lrwxrwxrwx 1 root root 23 Feb 23 2018 tp.lua -> ../../5.1/socket/tp.lua lrwxrwxrwx 1 root root 25 Feb 23 2018 smtp.lua -> ../../5.1/socket/smtp.lua lrwxrwxrwx 1 root root 25 Feb 23 2018 mbox.lua -> ../../5.1/socket/mbox.lua lrwxrwxrwx 1 root root 25 Feb 23 2018 http.lua -> ../../5.1/socket/http.lua lrwxrwxrwx 1 root root 28 Feb 23 2018 headers.lua -> ../../5.1/socket/headers.lua lrwxrwxrwx 1 root root 24 Feb 23 2018 ftp.lua -> ../../5.1/socket/ftp.lua

  2. Anton on

    Got the trace: modulemanager error Error initializing module 'password_reset' on: /usr/share/lua/5.2/ltn12.lua:16: Attempt to set a global: ltn12 = table: 0x557a399f4cf0 stack traceback: [C]: in function 'error' /usr/lib/prosody/util/startup.lua:400: in function '__newindex' /usr/share/lua/5.2/ltn12.lua:16: in main chunk [C]: in function '_real_require' /usr/lib/prosody/util/startup.lua:199: in function 'require' /usr/share/lua/5.2/socket/tp.lua:13: in main chunk [C]: in function '_real_require' /usr/lib/prosody/util/startup.lua:199: in function 'require' /usr/share/lua/5.2/socket/smtp.lua:16: in main chunk [C]: in function '_real_require' ... /usr/lib/prosody/core/modulemanager.lua:183: in function 'do_load_module' /usr/lib/prosody/core/modulemanager.lua:261: in function 'load' /usr/lib/prosody/core/modulemanager.lua:83: in function '?' /usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75> (...tail calls...) /usr/lib/prosody/core/hostmanager.lua:108: in function 'activate' /usr/lib/prosody/core/hostmanager.lua:58: in function '?' /usr/lib/prosody/util/events.lua:79: in function </usr/lib/prosody/util/events.lua:75> (...tail calls...) /usr/lib/prosody/util/startup.lua:391: in function 'prepare_to_start' /usr/lib/prosody/util/startup.lua:613: in function 'f' /usr/lib/prosody/util/async.lua:139: in function 'func' /usr/lib/prosody/util/async.lua:127: in function </usr/lib/prosody/util/async.lua:125>

  3. Anton on

    solution: prosody.unlock_globals() Issue can be closed, sorry

  4. Zash on

    The real fix is for LuaSocket not to pollute the global table, like this: https://github.com/diegonehab/luasocket/commit/920bc9762954454468d056a61391635cbd849406#diff-dbf52d7c1928cd4d1b73010cfecd175bL20-R22

    Changes
    • tags Status-Invalid
  5. Zash on

    Looks like the 'ltn12' module still messes with globals.

New comment

Not published. Used for spam prevention and optional update notifications.