Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 2453] segmentation fault with wslua script

Date: Thu, 15 May 2008 14:16:13 -0700 (PDT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2453





--- Comment #26 from Márton Németh <nm127@xxxxxxxxxxx>  2008-05-15 14:16:13 PDT ---
(In reply to comment #25)
> > I think you found the problem:
> > 
> > As you said We are NULLifying already removed objects for which if there was a
> > __gc it would have being called.
> I think that NULLifying the stored C pointers does not work, since the Lua code
> may store pointers to the freed tvb in Lua objects.
> We can't use _gc, either, because those Lua object may be accessed before any
> gc run.
> I think it'd be better to use __assign to prohibit Lua assignment for the
> problematic objects.

Is there any "__assign" in Lua? I only found a thread on a mailing list (
http://lua-users.lua.org/lists/lua-l/2004-06/msg00294.html ) which speaks about
that two tables should be used and "__newindex for assignments and __index for
reads."

In the Lua 5.1.3 source code ( http://www.lua.org/ftp/lua-5.1.3.tar.gz ) there
are only the following events (src/ltm.c):
 * __index
 * __newindex
 * __gc
 * __mode
 * __eq
 * __add
 * __sub
 * __mul
 * __div
 * __mod
 * __pow
 * __unm
 * __len
 * __lt
 * __le
 * __concat
 * __call

See also: http://www.lua.org/manual/5.1/manual.html#2.8


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.