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

Date: Fri, 16 May 2008 04:43:21 -0700 (PDT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2453





--- Comment #27 from Balint Reczey <balint.reczey@xxxxxxxxxxxx>  2008-05-16 04:43:19 PDT ---
(In reply to comment #26)
> (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
> 

Hi,

I was not careful enough, i found that thread and thought that overloading
assignment became reality:
http://thread.gmane.org/gmane.comp.lang.lua.general/40927
:-(


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