[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Python plugin update [get_prefs bug?]
On Wed, 15 Oct 2003 12:11:31 -0300
Gustavo Niemeyer <niemeyer@conectiva.com> wrote:
> > http://cvs.sourceforge.net/viewcvs.py/xchat/xchat2/plugins/python/
>
> Ok, I've had a look, and the changes introduced were mainly
> related to the reentrancy bug, and code style changes. The
> reentrancy fix is already included in the update. The style
> changes were dropped. Besides these, I've merged the
> lock-unlock reordering, which seems like a good idea, and
> wasn't being done yet, and the retobj check in Plugin_Delete.
>
> Notice that the patched plugin introduced a bug in BEGIN_PLUGIN,
> since an xchat call is done without holding the lock.
>
> I belive you can safely drop the attached file in. It will be a
> pleasure to discuss this if someone disagrees.
>
> Thanks!
Ok, I've commited this version to cvs.
I think this could be a bug:
type = xchat_get_prefs(ph, name, (const char**)&info, (int*)info);
It looks like "info" is passed uninitialized (4th arg). It should be called
something like:
int integer;
char *string;
type = xchat_get_prefs(ph, name, &string, &integer);
So the function 'fills in the data' into your variables (give it a pointer to 4bytes).
Here's a valgrind trace:
==1084== Use of uninitialised value of size 4
==1084== at 0x8086A13: xchat_get_prefs (plugin.c:925)
==1084== by 0x445DA539: Module_xchat_get_prefs (python.c:1412)
==1084== by 0x445F4B63: PyCFunction_Call (in /home/zed/cvs/xchat2/plugins/python/.libs/python.so)
==1084== by 0x4461A95D: eval_frame (in /home/zed/cvs/xchat2/plugins/python/.libs/python.so)
==1084==
==1084== Use of uninitialised value of size 4
==1084== at 0x445DA57B: Module_xchat_get_prefs (python.c:1424)
==1084== by 0x445F4B63: PyCFunction_Call (in /home/zed/cvs/xchat2/plugins/python/.libs/python.so)
==1084== by 0x4461A95D: eval_frame (in /home/zed/cvs/xchat2/plugins/python/.libs/python.so)
==1084== by 0x4461B3CD: PyEval_EvalCodeEx (in /home/zed/cvs/xchat2/plugins/python/.libs/python.so)
==1084==
==1084== Conditional jump or move depends on uninitialised value(s)
==1084== at 0x445D9172: XChatOut_write (python.c:654)
==1084== by 0x445F4B63: PyCFunction_Call (in /home/zed/cvs/xchat2/plugins/python/.libs/python.so)
==1084== by 0x445DF266: PyObject_Call (in /home/zed/cvs/xchat2/plugins/python/.libs/python.so)
==1084== by 0x4461C5CF: PyEval_CallObjectWithKeywords (in /home/zed/cvs/xchat2/plugins/python/.libs/python.so)
P.S If you have a SF.net account, I can give you write access to the cvs.
--
Peter Zelezny.
--
XChat-discuss: mailing list for XChat users
Archive: http://mail.nl.linux.org/xchat-discuss/