[ZeroBrane Studio] Re: Getting basics working

  • From: Paul K <paul@xxxxxxxxxxxxx>
  • To: "zerobrane@xxxxxxxxxxxxx" <zerobrane@xxxxxxxxxxxxx>
  • Date: Thu, 18 Sep 2014 21:18:30 -0700

Hi Tim,

> Afraid not, still get exception..

ok, let's try step by step.

(1) make a script with just one line "require 'socket'"; does it work?

(2) two lines:

local socket = require 'socket'
print(socket.connect("localhost", 8172))

(3) two lines with mobdebug:

require('mobdebug').start()
print "hello"

Do you get a (lua) error or do you get an exception (application
crash)? Do steps 1 and 2 work? If one of them doesn't work, then the
issue is not with the debugger or ZBS. If 2 works, but 3 doesn't work,
I'll need to find a machine with similar configuration to yours and
try myself.

> Head scratching time.

What version of luasocket are you running? Are you using your own
luasocket or the one that comes with ZBS? Is it statically compiled
into your application? Do you run this script from ZBS or outside of
it? When you run from ZBS, ZBS will reference its own libraries, which
may cause its socket dll to load, which is linked against lua51.dll,
which may cause two interpreters to be loaded if your application
includes statically linked lua interpreter. This could easily lead to
a crash. There are ways to deal with it, but we need to figure out if
that's the case.

> Is the OS bright enough to not share the luasocket dll?

No, this should not be a problem.

Paul.

Other related posts: