[ZeroBrane Studio] Re: Getting basics working

  • From: Tim Channon <tc@xxxxxxxx>
  • To: zerobrane@xxxxxxxxxxxxx
  • Date: Sun, 21 Sep 2014 16:37:35 +0100

No difference.
The only script line is
require('socket')

Lua as I assume you know is a disaster on path operations. Had a lot of grief over this.

The client, in this case "system lua" (client, guest, whatever) must know nothing about zbs, it maintains a it's own standard environment. Evidence here points to zbs invoking system lua with a zbs environment. Looks like some kind of thread.

Goes like this

zbs runs and uses os resources.

On Run of the script in question it seems to try and load system lua into a thread.

System lua then initialises but when it comes to require socket, oops, it can't find it, after much looking around windows it eventually finds the zbs socket.

Now zbs socket is linked against lualib51.dll so it goes looking for that, doesn't have a copy itself so off it goes looking.

On the version of windows path it has it finds gnuplot and in there a lualib51.dll

Want to know the rest :-)

Maybe a clue is that it looks here
C:\compiles\zerobrane\bin\clibs\socket\core.dll

The system lua should not know about zerobrane path.

I don't know if there is an inherited environment, perhaps this can be overridden. Long time since I was doing system and low level work.

You asked for this. Zerobrane is on a temporary path for test purposes.

lualibs/?.lua;lualibs/?/?.lua;lualibs/?/init.lua;lualibs/?/?/?.lua;lualibs/?/?/init.lua;.\?.lua;C:\compiles\zerobrane\lua\?.lua;C:\compiles\zerobrane\lua\?\init.lua; bin/?.dll;bin/clibs/?.dll;.\?.dll;C:\compiles\zerobrane\?.dll;C:\compiles\zerobrane\loadall.dll

Is there a way to discover what the system lua sees as a path?

Regard
Tim

On 21/09/2014 06:56, Paul K wrote:
Hi Tim,

lsock 2.0.2
System lua will use system sock.
The lua and published libraries are completely standard.
lualib.dll

What I think happens is this:

Your Lua executable loads Lua interpreter from lualib.dll; the script
then starts debugging, which loads luasocket from ZBS, which is
compiled against lua51.dll, so lua51.dll is loaded into memory, which
causes two interpreters to be loaded into the same process, which
leads to the crash.

I made several changes that may help with this particular
configuration (if I'm correct in my assessment of the issue).

Please try with the latest version of ZBS from github; you can clone
the repository or download the archive of this version from
https://github.com/pkulchenko/ZeroBraneStudio/archive/master.zip
(simply unzip the archive into a folder and run .\zbstudio.exe). Make
sure you copy cfg\user.lua to transfer your current configuration. If
you still have issue, please include the output of
"print(package.path, package.cpath)" when you Run (not Debug) the
script. You can email it to me directly if the output has some
sensitive information. Thank you.

Paul.




Other related posts: