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: Alexander Mihalicyn <alexander%mihalicyn.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: PR/52226 CVS commit: src/sys/modules/lua
Date: Sun, 21 May 2017 19:24:06 +0300
--001a114170ac3021ec05500b307a
Content-Type: text/plain; charset="UTF-8"
Thank you very much. ;)
On Sun, May 21, 2017 at 12:30 PM, Marc Balmer <mhbalmer%gmail.com@localhost> wrote:
> 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 <<a href=3D"mailto:alexander@
> mihalicyn.com=
> ">alexander%mihalicyn.com@localhost</a>>
> <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'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->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 'systm'
> <br> =20
> <br> systm.print("hello, kernel world!\n")
> <br> ----
> <br> =20
> <br> We got a problem because module in second call of luactl load
> won'=
> 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 <<a href=3D"mailto:
> mb=
> almer%netbsd.org@localhost">mbalmer%netbsd.org@localhost</a>> wrote:
> <br> > The following reply was made to PR kern/52226; it has been
> noted =
> by GNATS.
> <br> >
> <br> > From: "Marc Balmer" <<a href=3D"mailto:
> mbalmer@netbs=
> d.org">mbalmer%netbsd.org@localhost</a>>
> <br> > To: <a href=3D"mailto:gnats-bugs%gnats.NetBSD.org@localhost">gnats-bugs@
> gna=
> ts.NetBSD.org</a>
> <br> > Cc:
> <br> > Subject: PR/52226 CVS commit: src/sys/modules/lua
> <br> > Date: Sat, 20 May 2017 08:31:13 +0000
> <br> >
> <br> > Module Name: src
> <br> > Committed By: mbalmer
> <br> > Date: Sat May 20 08:31:13 UTC 2017
> <br> >
> <br> > Modified Files:
> <br> > src/sys/modules/lua: lua.c
> <br> >
> <br> > Log Message:
> <br> > Only load a module if it is not already loaded in a state
> (much =
> like userland
> <br> > Lua handles require).
> <br> > Fixes PR kern/52226.
> <br> >
> <br> >
> <br> > To generate a diff of this commit:
> <br> > cvs rdiff -u -r1.21 -r1.22 src/sys/modules/lua/lua.c
> <br> >
> <br> > Please note that diffs are not public domain; they are subject
> t=
> o the
> <br> > copyright notices on the relevant files.
> <br> >
> <br> =20
> <br>
> <br></div></div></span></blockquote></body></html>
>
> --f403043618b07feb4905500564ce--
>
>
--001a114170ac3021ec05500b307a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Thank you very much. ;)<br></div><div class=3D"gmail_extra=
"><br><div class=3D"gmail_quote">On Sun, May 21, 2017 at 12:30 PM, Marc Bal=
mer <span dir=3D"ltr"><<a href=3D"mailto:mhbalmer%gmail.com@localhost" target=3D"_=
blank">mhbalmer%gmail.com@localhost</a>></span> wrote:<br><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex"><span class=3D"">The following reply was made to PR kern/52226; it h=
as been noted by GNATS.<br>
<br>
</span>From: Marc Balmer <<a href=3D"mailto:mhbalmer%gmail.com@localhost">mhbalmer=
@gmail.com</a>><br>
<span class=3D"">To: <a href=3D"mailto:gnats-bugs%netbsd.org@localhost">gnats-bugs@ne=
tbsd.org</a><br>
Cc:<br>
Subject: Re: PR/52226 CVS commit: src/sys/modules/lua<br>
</span>Date: Sun, 21 May 2017 02:29:34 -0700<br>
<br>
=C2=A0--f403043618b07feb4905500564ce<br>
=C2=A0Content-Type: text/plain; charset=3D"UTF-8"<br>
<br>
=C2=A0That has been fixed in a subsequent commit.=C2=A0 luaL_requiref is ca=
lled in all<br>
=C2=A0cases.=C2=A0 Please update you source tree again and it will work.<br=
>
<br>
<br>
=C2=A0Am 21. Mai 2017 um 10:58:11, Alexander Mihalicyn (<a href=3D"mailto:a=
lexander%mihalicyn.com@localhost">alexander%mihalicyn.com@localhost</a>)<br>
=C2=A0schrieb:<br>
<div><div class=3D"h5"><br>
=C2=A0The following reply was made to PR kern/52226; it has been noted by G=
NATS.<br>
<br>
=C2=A0From: Alexander Mihalicyn <<a href=3D"mailto:alexander@mihalicyn.c=
om">alexander%mihalicyn.com@localhost</a>><br>
=C2=A0To: <a href=3D"mailto:gnats-bugs%netbsd.org@localhost">gnats-bugs%netbsd.org@localhost</a=
><br>
=C2=A0Cc:<br>
=C2=A0Subject: Re: PR/52226 CVS commit: src/sys/modules/lua<br>
=C2=A0Date: Sat, 20 May 2017 17:27:00 +0300<br>
<br>
=C2=A0Hello, Dear Marc Balmer,<br>
<br>
=C2=A0I checked out variant of fix from CVS. Sorry, but it is fully correct=
?<br>
=C2=A0I would like to point that it's very important that in our origin=
al<br>
=C2=A0fix checking of module already loaded in state was between<br>
=C2=A0luaL_requiref call and md->refcount++. But in our last fix (from C=
VS)<br>
=C2=A0we have that check before luaL_requiref. It seems that this may cause=
<br>
=C2=A0a problem:<br>
=C2=A0consider the following example:<br>
<br>
=C2=A0----<br>
=C2=A0luactl create s1<br>
=C2=A0luactl load s1 /root/test.lua<br>
=C2=A0luactl load s1 /root/test.lua<br>
=C2=A0luactl destroy s1<br>
<br>
=C2=A0test.lua:<br>
=C2=A0systm =3D require 'systm'<br>
<br>
=C2=A0systm.print("hello, kernel world!\n")<br>
=C2=A0----<br>
<br>
=C2=A0We got a problem because module in second call of luactl load won'=
;t<br>
=C2=A0loaded into lua context. And we got messages:<br>
=C2=A0hello, kernel world!<br>
=C2=A0...and after that error, that print is undefined (or something simila=
r ;)).<br>
<br>
=C2=A0Thank you in advance.<br>
<br>
=C2=A0Regards, Alex.<br>
<br>
=C2=A0On Sat, May 20, 2017 at 11:35 AM, Marc Balmer <<a href=3D"mailto:m=
balmer%netbsd.org@localhost">mbalmer%netbsd.org@localhost</a>> wrote:<br>
=C2=A0> The following reply was made to PR kern/52226; it has been noted=
by<br>
=C2=A0GNATS.<br>
=C2=A0><br>
=C2=A0> From: "Marc Balmer" <<a href=3D"mailto:mbalmer@netb=
sd.org">mbalmer%netbsd.org@localhost</a>><br>
=C2=A0> To: <a href=3D"mailto:gnats-bugs%gnats.NetBSD.org@localhost">gnats-bugs@gn=
ats.NetBSD.org</a><br>
=C2=A0> Cc:<br>
=C2=A0> Subject: PR/52226 CVS commit: src/sys/modules/lua<br>
=C2=A0> Date: Sat, 20 May 2017 08:31:13 +0000<br>
=C2=A0><br>
=C2=A0> Module Name: src<br>
=C2=A0> Committed By: mbalmer<br>
=C2=A0> Date: Sat May 20 08:31:13 UTC 2017<br>
=C2=A0><br>
=C2=A0> Modified Files:<br>
=C2=A0> src/sys/modules/lua: lua.c<br>
=C2=A0><br>
=C2=A0> Log Message:<br>
=C2=A0> Only load a module if it is not already loaded in a state (much =
like<br>
=C2=A0userland<br>
=C2=A0> Lua handles require).<br>
=C2=A0> Fixes PR kern/52226.<br>
=C2=A0><br>
=C2=A0><br>
=C2=A0> To generate a diff of this commit:<br>
=C2=A0> cvs rdiff -u -r1.21 -r1.22 src/sys/modules/lua/lua.c<br>
=C2=A0><br>
=C2=A0> Please note that diffs are not public domain; they are subject t=
o the<br>
=C2=A0> copyright notices on the relevant files.<br>
=C2=A0><br>
<br>
</div></div>=C2=A0--f403043618b07feb4905500564ce<br>
=C2=A0Content-Type: text/html; charset=3D"UTF-8"<br>
=C2=A0Content-Transfer-Encoding: quoted-printable<br>
<br>
=C2=A0<html><head><style>body{font-<wbr>family:Helvetica,=
Arial;font-<wbr>size:13px}</style>=3D<br>
=C2=A0</head><body style=3D3D"word-wrap:break-word"<wbr>=
><div id=3D3D"bloop_customfont" st=3D<br>
=C2=A0yle=3D3D"font-family:Helvetica,<wbr>Arial;font-size:13px;color:<=
wbr>rgba(0,0,0,1.0);mar=3D<br>
=C2=A0gin:0px;line-height:auto">That has been fixed in a subsequent=
commit. =3DC2=3D<br>
=C2=A0=3DA0luaL_requiref is called in all cases.=3DC2=3DA0 Please update yo=
u source tre=3D<br>
=C2=A0e again and it will work.</div> <br> <div id=3D3D"=
;bloop_sign_<wbr>1495358917791358=3D<br>
=C2=A0976" class=3D3D"bloop_sign"></div> <br>=
<p class=3D3D"airmail_on">Am 21. Mai 201=3D<br>
=C2=A07 um 10:58:11, Alexander Mihalicyn (<a href=3D3D"mailto:<a hr=
ef=3D"mailto:alexander@mihalicyn.c">alexander@<wbr>mihalicyn.c</a>=3D<br>
=C2=A0om"><a href=3D"mailto:alexander%mihalicyn.com@localhost">alexander@miha=
licyn.com</a></<wbr>a>) schrieb:</p> <blockquote type=3D3D&q=
uot;cite" cla=3D<br>
=C2=A0ss=3D3D"clean_bq"><span><div><<wbr>div>=
;</div><div>The following reply was made to =3D<br>
<span class=3D"">=C2=A0PR kern/52226; it has been noted by GNATS.<br>
</span>=C2=A0<br><br>
=C2=A0<br>From: Alexander Mihalicyn &lt;<a href=3D3D"mail=
to:<a href=3D"mailto:alexander%mihalicyn.com@localhost">alexander@<wbr>mihalicyn.com<=
/a>=3D<br>
=C2=A0"><a href=3D"mailto:alexander%mihalicyn.com@localhost">alexander@mihali=
cyn.com</a></a>&<wbr>gt;<br>
=C2=A0<br>To: <a href=3D3D"mailto:<a href=3D"mailto:gnats-bug=
s%netbsd.org@localhost">gnats-bugs@<wbr>netbsd.org</a>"><a href=3D"mailto:gna=
ts-bugs%netbsd.org@localhost">gnats-bugs@netbsd.<wbr>org</a></a><br>
=C2=A0<br>Cc: =3D20<br>
=C2=A0<br>Subject: Re: PR/52226 CVS commit: src/sys/modules/lua<br>
=C2=A0<br>Date: Sat, 20 May 2017 17:27:00 +0300<br>
=C2=A0<br><br>
=C2=A0<br> Hello, Dear Marc Balmer,<br>
=C2=A0<br> =3D20<br>
=C2=A0<br> I checked out variant of fix from CVS. Sorry, but it is fu=
lly correct?<br>
=C2=A0<br> I would like to point that it&#39;s very important tha=
t in our origina=3D<br>
=C2=A0l<br>
=C2=A0<br> fix checking of module already loaded in state was between=
<br>
=C2=A0<br> luaL_requiref call and md-&gt;refcount++. But in our l=
ast fix (from CV=3D<br>
=C2=A0S)<br>
=C2=A0<br> we have that check before luaL_requiref. It seems that thi=
s may cause<br>
=C2=A0<br> a problem:<br>
=C2=A0<br> consider the following example:<br>
=C2=A0<br> =3D20<br>
=C2=A0<br> ----<br>
=C2=A0<br> luactl create s1<br>
=C2=A0<br> luactl load s1 /root/test.lua<br>
=C2=A0<br> luactl load s1 /root/test.lua<br>
=C2=A0<br> luactl destroy s1<br>
=C2=A0<br> =3D20<br>
=C2=A0<br> test.lua:<br>
=C2=A0<br> systm =3D3D require &#39;systm&#39;<br>
=C2=A0<br> =3D20<br>
=C2=A0<br> systm.print(&quot;hello, kernel world!\n&quot;)<br=
>
=C2=A0<br> ----<br>
=C2=A0<br> =3D20<br>
=C2=A0<br> We got a problem because module in second call of luactl l=
oad won&#39;=3D<br>
=C2=A0t<br>
=C2=A0<br> loaded into lua context. And we got messages:<br>
=C2=A0<br> hello, kernel world!<br>
=C2=A0<br> ...and after that error, that print is undefined (or somet=
hing similar=3D<br>
=C2=A0 ;)).<br>
=C2=A0<br> =3D20<br>
=C2=A0<br> Thank you in advance.<br>
=C2=A0<br> =3D20<br>
=C2=A0<br> Regards, Alex.<br>
=C2=A0<br> =3D20<br>
=C2=A0<br> On Sat, May 20, 2017 at 11:35 AM, Marc Balmer &lt;<=
a href=3D3D"mailto:<a href=3D"mailto:mb">mb</a>=3D<br>
=C2=A0<a href=3D"mailto:almer%netbsd.org@localhost">almer%netbsd.org@localhost</a>"><a =
href=3D"mailto:mbalmer%netbsd.org@localhost">mbalmer@<wbr>netbsd.org</a></a>&am=
p;gt; wrote:<br>
=C2=A0<br> &gt; The following reply was made to PR kern/52226; it=
has been noted =3D<br>
=C2=A0by GNATS.<br>
=C2=A0<br> &gt;<br>
=C2=A0<br> &gt; From: &quot;Marc Balmer&quot; &lt;<=
;a href=3D3D"mailto:<a href=3D"mailto:mbalmer@netbs">mbalmer@netbs</a>=
=3D<br>
=C2=A0<a href=3D"http://d.org" rel=3D"noreferrer" target=3D"_blank">d.org</=
a>"><a href=3D"mailto:mbalmer%netbsd.org@localhost">mbalmer%netbsd.org@localhost</a><=
;/a>&<wbr>gt;<br>
=C2=A0<br> &gt; To: <a href=3D3D"mailto:<a href=3D"mailto=
:gnats-bugs%gnats.NetBSD.org@localhost">gnats-bugs@<wbr>gnats.NetBSD.org</a>">=
;gnats-bugs@<wbr>gna=3D<br>
=C2=A0<a href=3D"http://ts.NetBSD.org" rel=3D"noreferrer" target=3D"_blank"=
>ts.NetBSD.org</a></a><br>
=C2=A0<br> &gt; Cc:<br>
=C2=A0<br> &gt; Subject: PR/52226 CVS commit: src/sys/modules/lua=
<br>
=C2=A0<br> &gt; Date: Sat, 20 May 2017 08:31:13 +0000<br>
=C2=A0<br> &gt;<br>
=C2=A0<br> &gt;=C2=A0 Module Name:=C2=A0 =C2=A0src<br>
=C2=A0<br> &gt;=C2=A0 Committed By:=C2=A0 mbalmer<br>
=C2=A0<br> &gt;=C2=A0 Date:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Sat=
May 20 08:31:13 UTC 2017<br>
=C2=A0<br> &gt;<br>
=C2=A0<br> &gt;=C2=A0 Modified Files:<br>
=C2=A0<br> &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0src/sys/modules/=
lua: lua.c<br>
=C2=A0<br> &gt;<br>
=C2=A0<br> &gt;=C2=A0 Log Message:<br>
=C2=A0<br> &gt;=C2=A0 Only load a module if it is not already loa=
ded in a state (much =3D<br>
=C2=A0like userland<br>
=C2=A0<br> &gt;=C2=A0 Lua handles require).<br>
=C2=A0<br> &gt;=C2=A0 Fixes PR kern/52226.<br>
=C2=A0<br> &gt;<br>
=C2=A0<br> &gt;<br>
=C2=A0<br> &gt;=C2=A0 To generate a diff of this commit:<br>
=C2=A0<br> &gt;=C2=A0 cvs rdiff -u -r1.21 -r1.22 src/sys/modules/=
lua/lua.c<br>
=C2=A0<br> &gt;<br>
=C2=A0<br> &gt;=C2=A0 Please note that diffs are not public domai=
n; they are subject t=3D<br>
=C2=A0o the<br>
=C2=A0<br> &gt;=C2=A0 copyright notices on the relevant files.<br=
>
=C2=A0<br> &gt;<br>
=C2=A0<br> =3D20<br>
=C2=A0<br><br>
=C2=A0<br></div></div></span></<wbr>blockquote&g=
t;</body></html><br>
<br>
=C2=A0--<wbr>f403043618b07feb4905500564ce--<br>
<br>
</blockquote></div><br></div>
--001a114170ac3021ec05500b307a--
Home |
Main Index |
Thread Index |
Old Index