NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/52226 CVS commit: src/sys/modules/lua



The following reply was made to PR kern/52226; it has been noted by GNATS.

From: Marc Balmer <mhbalmer%gmail.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: PR/52226 CVS commit: src/sys/modules/lua
Date: Sun, 21 May 2017 02:29:34 -0700

 --f403043618b07feb4905500564ce
 Content-Type: text/plain; charset="UTF-8"
 
 That has been fixed in a subsequent commit.  luaL_requiref is called in all
 cases.  Please update you source tree again and it will work.
 
 
 Am 21. Mai 2017 um 10:58:11, Alexander Mihalicyn (alexander%mihalicyn.com@localhost)
 schrieb:
 
 The following reply was made to PR kern/52226; it has been noted by GNATS.
 
 From: Alexander Mihalicyn <alexander%mihalicyn.com@localhost>
 To: gnats-bugs%netbsd.org@localhost
 Cc:
 Subject: Re: PR/52226 CVS commit: src/sys/modules/lua
 Date: Sat, 20 May 2017 17:27:00 +0300
 
 Hello, Dear Marc Balmer,
 
 I checked out variant of fix from CVS. Sorry, but it is fully correct?
 I would like to point that it's very important that in our original
 fix checking of module already loaded in state was between
 luaL_requiref call and md->refcount++. But in our last fix (from CVS)
 we have that check before luaL_requiref. It seems that this may cause
 a problem:
 consider the following example:
 
 ----
 luactl create s1
 luactl load s1 /root/test.lua
 luactl load s1 /root/test.lua
 luactl destroy s1
 
 test.lua:
 systm = require 'systm'
 
 systm.print("hello, kernel world!\n")
 ----
 
 We got a problem because module in second call of luactl load won't
 loaded into lua context. And we got messages:
 hello, kernel world!
 ...and after that error, that print is undefined (or something similar ;)).
 
 Thank you in advance.
 
 Regards, Alex.
 
 On Sat, May 20, 2017 at 11:35 AM, Marc Balmer <mbalmer%netbsd.org@localhost> wrote:
 > The following reply was made to PR kern/52226; it has been noted by
 GNATS.
 >
 > From: "Marc Balmer" <mbalmer%netbsd.org@localhost>
 > To: gnats-bugs%gnats.NetBSD.org@localhost
 > Cc:
 > Subject: PR/52226 CVS commit: src/sys/modules/lua
 > Date: Sat, 20 May 2017 08:31:13 +0000
 >
 > Module Name: src
 > Committed By: mbalmer
 > Date: Sat May 20 08:31:13 UTC 2017
 >
 > Modified Files:
 > src/sys/modules/lua: lua.c
 >
 > Log Message:
 > Only load a module if it is not already loaded in a state (much like
 userland
 > Lua handles require).
 > Fixes PR kern/52226.
 >
 >
 > To generate a diff of this commit:
 > cvs rdiff -u -r1.21 -r1.22 src/sys/modules/lua/lua.c
 >
 > Please note that diffs are not public domain; they are subject to the
 > copyright notices on the relevant files.
 >
 
 --f403043618b07feb4905500564ce
 Content-Type: text/html; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable
 
 <html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style>=
 </head><body style=3D"word-wrap:break-word"><div id=3D"bloop_customfont" st=
 yle=3D"font-family:Helvetica,Arial;font-size:13px;color:rgba(0,0,0,1.0);mar=
 gin:0px;line-height:auto">That has been fixed in a subsequent commit. =C2=
 =A0luaL_requiref is called in all cases.=C2=A0 Please update you source tre=
 e again and it will work.</div> <br> <div id=3D"bloop_sign_1495358917791358=
 976" class=3D"bloop_sign"></div> <br><p class=3D"airmail_on">Am 21. Mai 201=
 7 um 10:58:11, Alexander Mihalicyn (<a href=3D"mailto:alexander@mihalicyn.c=
 om">alexander%mihalicyn.com@localhost</a>) schrieb:</p> <blockquote type=3D"cite" cla=
 ss=3D"clean_bq"><span><div><div></div><div>The following reply was made to =
 PR kern/52226; it has been noted by GNATS.
 <br>
 <br>From: Alexander Mihalicyn &lt;<a href=3D"mailto:alexander%mihalicyn.com@localhost=
 ">alexander%mihalicyn.com@localhost</a>&gt;
 <br>To: <a href=3D"mailto:gnats-bugs%netbsd.org@localhost";>gnats-bugs%netbsd.org@localhost</a>
 <br>Cc: =20
 <br>Subject: Re: PR/52226 CVS commit: src/sys/modules/lua
 <br>Date: Sat, 20 May 2017 17:27:00 +0300
 <br>
 <br> Hello, Dear Marc Balmer,
 <br> =20
 <br> I checked out variant of fix from CVS. Sorry, but it is fully correct?
 <br> I would like to point that it&#39;s very important that in our origina=
 l
 <br> fix checking of module already loaded in state was between
 <br> luaL_requiref call and md-&gt;refcount++. But in our last fix (from CV=
 S)
 <br> we have that check before luaL_requiref. It seems that this may cause
 <br> a problem:
 <br> consider the following example:
 <br> =20
 <br> ----
 <br> luactl create s1
 <br> luactl load s1 /root/test.lua
 <br> luactl load s1 /root/test.lua
 <br> luactl destroy s1
 <br> =20
 <br> test.lua:
 <br> systm =3D require &#39;systm&#39;
 <br> =20
 <br> systm.print(&quot;hello, kernel world!\n&quot;)
 <br> ----
 <br> =20
 <br> We got a problem because module in second call of luactl load won&#39;=
 t
 <br> loaded into lua context. And we got messages:
 <br> hello, kernel world!
 <br> ...and after that error, that print is undefined (or something similar=
  ;)).
 <br> =20
 <br> Thank you in advance.
 <br> =20
 <br> Regards, Alex.
 <br> =20
 <br> On Sat, May 20, 2017 at 11:35 AM, Marc Balmer &lt;<a href=3D"mailto:mb=
 almer%netbsd.org@localhost">mbalmer%netbsd.org@localhost</a>&gt; wrote:
 <br> &gt; The following reply was made to PR kern/52226; it has been noted =
 by GNATS.
 <br> &gt;
 <br> &gt; From: &quot;Marc Balmer&quot; &lt;<a href=3D"mailto:mbalmer@netbs=
 d.org">mbalmer%netbsd.org@localhost</a>&gt;
 <br> &gt; To: <a href=3D"mailto:gnats-bugs%gnats.NetBSD.org@localhost";>gnats-bugs@gna=
 ts.NetBSD.org</a>
 <br> &gt; Cc:
 <br> &gt; Subject: PR/52226 CVS commit: src/sys/modules/lua
 <br> &gt; Date: Sat, 20 May 2017 08:31:13 +0000
 <br> &gt;
 <br> &gt;  Module Name:   src
 <br> &gt;  Committed By:  mbalmer
 <br> &gt;  Date:          Sat May 20 08:31:13 UTC 2017
 <br> &gt;
 <br> &gt;  Modified Files:
 <br> &gt;         src/sys/modules/lua: lua.c
 <br> &gt;
 <br> &gt;  Log Message:
 <br> &gt;  Only load a module if it is not already loaded in a state (much =
 like userland
 <br> &gt;  Lua handles require).
 <br> &gt;  Fixes PR kern/52226.
 <br> &gt;
 <br> &gt;
 <br> &gt;  To generate a diff of this commit:
 <br> &gt;  cvs rdiff -u -r1.21 -r1.22 src/sys/modules/lua/lua.c
 <br> &gt;
 <br> &gt;  Please note that diffs are not public domain; they are subject t=
 o the
 <br> &gt;  copyright notices on the relevant files.
 <br> &gt;
 <br> =20
 <br>
 <br></div></div></span></blockquote></body></html>
 
 --f403043618b07feb4905500564ce--
 


Home | Main Index | Thread Index | Old Index