editor.getSelText might lead to crash npp when used in asynchronous callback
same method works in synchronous callback - threading issue? Needs investigation
Is this new to PS versions > 1.0.8.0 ? Since PS 1.0.8.0 was the one we had for a long time (~4 years!?), I'm surprised this hasn't come up before (that I recall)...
Do you have a (simple) example that reproduces it always or at least frequently?
From what I see it happenes with PS 1.0.8 as well and I didn't see this crash before either - to reproduce, use e.g. statusbar modification with selected text and then rapidly select text with the mouse (keeping the mouse button pressed and move the mouse fast to generate new selections all over).
@ClaudiaFrank
I had for a long(!) time a status bar modification script using an async callback that would use .getSelText to be able to report info about the selected text in the status bar. It worked great for a LONG time, as I said.
Recently, I updated the script to experiment with other additions to it (inspired by the converstations here: https://notepad-plus-plus.org/community/topic/15698/last-modified-date-in-status-bar and https://notepad-plus-plus.org/community/topic/15679/seeing-the-zoom-level-with-pythonscript). After those changes I noticed crashes when click-dragging selections with the mouse (don't recall it happening with shift+arrow selecting). Those mods required adding "notepad" object callbacks in (originally only had async "editor" callbacks)--maybe that's too ambitious to have both types call one function?!
I reverted by script to the earlier version, however, it seems I still saw crashes when selecting (which doesn't make sense) so right now I am running with native statusbar info until I can investigate further.
BTW all of this was with PS 1.0.8.0.
And I do remember we had some email conversation about this... :-)
That's, I guess, is the simplest test I found which crashes npp
from Npp import editor, SCINTILLANOTIFICATION
def callback_UPDATEUI(args):
len(editor.getSelText())
editor.clearCallbacks([SCINTILLANOTIFICATION.UPDATEUI])
editor.callback(callback_UPDATEUI, [SCINTILLANOTIFICATION.UPDATEUI])
'''Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
Some text some text Some text some text Some text some text Some text some text
'''
Now by rapidly selecting some text on and on it shouldn't take that long to see the behavior. As said, it happens with 1.0.8 as well so I assume it is nothing a newer version introduced but I agree, why does it happen now -> newer npp version ??? I guess I need to do some tests with older npp versions to see if this is the case.
@ClaudiaFrank , it (crash) happens for me with that script with my "daily use" version of N++ being 7.2.2 ... :-)
I'm more and more convinced that this issue is a concurrency problem as a single core PC with different npp versions and different PS versions don't has this issue, but using multicore PC, regardless if windows or linux and every npp version I tested and PS from 1.0.8 to 1.2, results in that crash. Investigation ongoing - concentrating on threads code area
I tried this out, and it still seems to be an issue, with N++ 8.4.7 and PS 2.0 and 3.10.4. For a lot of requested script solutions, it is nice to put some calculated data on the status bar (as described above). But this issue rather prevents that from being practical.
@chcg Do you have any thoughts on this? At a minimum, can you reproduce (and hopefully by trying that get some insight into root cause)?
Could be reproduced:
PY>10760 4627 3464693248 Consuming scintilla callbacks (beginning callback loop)
PY>10760 4628 3464713626 Scintilla callback, got GIL, calling callback
PY>10760 4629 3464713626 ScintillaWrapper::GetSelText
PY>10760 4630 3464713626 Temp GIL Release requested
PY>11300 4631 3464713626 GIL Acquired.
PY>11300 4632 3464713626 Waiting for mutex
PY>11300 4633 3464713626 Got mutex
PY>11300 4634 3464713626 Released mutex
PY>11300 4635 3464713626 Releasing GIL...
PY>11300 4636 3464713626 GIL Released.
PY>10760 4637 3464814544 Re-acquiring GIL after temporary release
PY>10760 4638 3464814544 GIL reacquired after temporary release
PY>10760 4639 3464814544 Temp GIL Release requested
PY>11300 4640 3464814544 Acquiring GIL...
PY>11300 4641 3464814544 GIL Acquired.
PY>11300 4642 3464814544 Waiting for mutex
PY>11300 4643 3464814544 Got mutex
PY>11300 4644 3464894929 Released mutex
PY>11300 4645 3464894929 Releasing GIL...
PY>11300 4646 3464894929 GIL Released.
PY>10760 4647 3464894929 Re-acquiring GIL after temporary release
PY>10760 4648 3464894929 GIL reacquired after temporary release
Debug Error!
Program: ...\npp.8.4.7.portable.x64\plugins\PythonScript\PythonScript.dll
HEAP CORRUPTION DETECTED: after Normal block (#96505) at 0x00000241C2EBC960.
CRT detected that the application wrote to memory after end of heap buffer.
(Press Retry to debug the application)
with callstack:
> PythonScript.dll!free_dbg_nolock(void * const block, const int block_use) Zeile 952 C++
PythonScript.dll!_free_dbg(void * block, int block_use) Zeile 1030 C++
[Externer Code]
PythonScript.dll!NppPythonScript::PythonCompatibleStrBuffer::~PythonCompatibleStrBuffer() Zeile 30 C++
PythonScript.dll!NppPythonScript::ScintillaWrapper::GetSelText() Zeile 2275 C++
PythonScript.dll!boost::python::detail::invoke<boost::python::to_python_value<boost::python::str const &>,boost::python::str (__cdecl NppPythonScript::ScintillaWrapper::*)(void),boost::python::arg_from_python<NppPythonScript::ScintillaWrapper &>>(boost::python::detail::invoke_tag_<0,1> __formal, const boost::python::to_python_value<boost::python::str const &> & rc, boost::python::str(NppPythonScript::ScintillaWrapper::*)() & f, boost::python::arg_from_python<NppPythonScript::ScintillaWrapper &> & tc) Zeile 86 C++
PythonScript.dll!boost::python::detail::caller_arity<1>::impl<boost::python::str (__cdecl NppPythonScript::ScintillaWrapper::*)(void),boost::python::default_call_policies,boost::mpl::vector2<boost::python::str,NppPythonScript::ScintillaWrapper &>>::operator()(_object * args_, _object * __formal) Zeile 233 C++
PythonScript.dll!boost::python::objects::caller_py_function_impl<boost::python::detail::caller<boost::python::str (__cdecl NppPythonScript::ScintillaWrapper::*)(void),boost::python::default_call_policies,boost::mpl::vector2<boost::python::str,NppPythonScript::ScintillaWrapper &>>>::operator()(_object * args, _object * kw) Zeile 39 C++
PythonScript.dll!boost::python::objects::py_function::operator()(_object * args, _object * kw) Zeile 148 C++
PythonScript.dll!boost::python::objects::function::call(_object * args, _object * keywords) Zeile 221 C++
PythonScript.dll!boost::python::objects::`anonymous namespace'::bind_return::operator()() Zeile 581 C++
PythonScript.dll!boost::detail::function::void_function_ref_invoker0<boost::python::objects::`anonymous namespace'::bind_return,void>::invoke(boost::detail::function::function_buffer & function_obj_ptr) Zeile 194 C++
PythonScript.dll!boost::function0<void>::operator()() Zeile 765 C++
PythonScript.dll!boost::python::detail::exception_handler::operator()(const boost::function0<void> & f) Zeile 75 C++
PythonScript.dll!boost::python::detail::translate_exception<NppPythonScript::NotSupportedException,void (__cdecl*)(NppPythonScript::NotSupportedException const &)>::operator()(const boost::python::detail::exception_handler & handler, const boost::function0<void> & f, void(*)(const NppPythonScript::NotSupportedException &) translate) Zeile 46 C++
PythonScript.dll!boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::NotSupportedException const &)>>::operator()<bool,boost::python::detail::translate_exception<NppPythonScript::NotSupportedException,void (__cdecl*)(NppPythonScript::NotSupportedException const &)>,boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &>>(boost::_bi::type<bool> __formal, boost::python::detail::translate_exception<NppPythonScript::NotSupportedException,void (__cdecl*)(NppPythonScript::NotSupportedException const &)> & f, boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &> & a, long __formal) Zeile 368 C++
PythonScript.dll!boost::_bi::bind_t<bool,boost::python::detail::translate_exception<NppPythonScript::NotSupportedException,void (__cdecl*)(NppPythonScript::NotSupportedException const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::NotSupportedException const &)>>>::operator()<boost::python::detail::exception_handler const &,boost::function0<void> const &>(const boost::python::detail::exception_handler & a1, const boost::function0<void> & a2) Zeile 1298 C++
PythonScript.dll!boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool,boost::python::detail::translate_exception<NppPythonScript::NotSupportedException,void (__cdecl*)(NppPythonScript::NotSupportedException const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::NotSupportedException const &)>>>,bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::invoke(boost::detail::function::function_buffer & function_obj_ptr, const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 138 C++
PythonScript.dll!boost::function2<bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::operator()(const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 765 C++
PythonScript.dll!boost::python::detail::exception_handler::handle(const boost::function0<void> & f) Zeile 42 C++
PythonScript.dll!boost::python::detail::exception_handler::operator()(const boost::function0<void> & f) Zeile 70 C++
PythonScript.dll!boost::python::detail::translate_exception<NppPythonScript::InvalidValueProvidedException,void (__cdecl*)(NppPythonScript::InvalidValueProvidedException const &)>::operator()(const boost::python::detail::exception_handler & handler, const boost::function0<void> & f, void(*)(const NppPythonScript::InvalidValueProvidedException &) translate) Zeile 46 C++
PythonScript.dll!boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::InvalidValueProvidedException const &)>>::operator()<bool,boost::python::detail::translate_exception<NppPythonScript::InvalidValueProvidedException,void (__cdecl*)(NppPythonScript::InvalidValueProvidedException const &)>,boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &>>(boost::_bi::type<bool> __formal, boost::python::detail::translate_exception<NppPythonScript::InvalidValueProvidedException,void (__cdecl*)(NppPythonScript::InvalidValueProvidedException const &)> & f, boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &> & a, long __formal) Zeile 368 C++
PythonScript.dll!boost::_bi::bind_t<bool,boost::python::detail::translate_exception<NppPythonScript::InvalidValueProvidedException,void (__cdecl*)(NppPythonScript::InvalidValueProvidedException const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::InvalidValueProvidedException const &)>>>::operator()<boost::python::detail::exception_handler const &,boost::function0<void> const &>(const boost::python::detail::exception_handler & a1, const boost::function0<void> & a2) Zeile 1298 C++
PythonScript.dll!boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool,boost::python::detail::translate_exception<NppPythonScript::InvalidValueProvidedException,void (__cdecl*)(NppPythonScript::InvalidValueProvidedException const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::InvalidValueProvidedException const &)>>>,bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::invoke(boost::detail::function::function_buffer & function_obj_ptr, const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 138 C++
PythonScript.dll!boost::function2<bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::operator()(const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 765 C++
PythonScript.dll!boost::python::detail::exception_handler::handle(const boost::function0<void> & f) Zeile 42 C++
PythonScript.dll!boost::python::detail::exception_handler::operator()(const boost::function0<void> & f) Zeile 70 C++
PythonScript.dll!boost::python::detail::translate_exception<process_start_exception,void (__cdecl*)(process_start_exception const &)>::operator()(const boost::python::detail::exception_handler & handler, const boost::function0<void> & f, void(*)(const process_start_exception &) translate) Zeile 46 C++
PythonScript.dll!boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(process_start_exception const &)>>::operator()<bool,boost::python::detail::translate_exception<process_start_exception,void (__cdecl*)(process_start_exception const &)>,boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &>>(boost::_bi::type<bool> __formal, boost::python::detail::translate_exception<process_start_exception,void (__cdecl*)(process_start_exception const &)> & f, boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &> & a, long __formal) Zeile 368 C++
PythonScript.dll!boost::_bi::bind_t<bool,boost::python::detail::translate_exception<process_start_exception,void (__cdecl*)(process_start_exception const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(process_start_exception const &)>>>::operator()<boost::python::detail::exception_handler const &,boost::function0<void> const &>(const boost::python::detail::exception_handler & a1, const boost::function0<void> & a2) Zeile 1298 C++
PythonScript.dll!boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool,boost::python::detail::translate_exception<process_start_exception,void (__cdecl*)(process_start_exception const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(process_start_exception const &)>>>,bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::invoke(boost::detail::function::function_buffer & function_obj_ptr, const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 138 C++
PythonScript.dll!boost::function2<bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::operator()(const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 765 C++
PythonScript.dll!boost::python::detail::exception_handler::handle(const boost::function0<void> & f) Zeile 42 C++
PythonScript.dll!boost::python::detail::exception_handler::operator()(const boost::function0<void> & f) Zeile 70 C++
PythonScript.dll!boost::python::detail::translate_exception<NppPythonScript::NotAllowedInCallbackException,void (__cdecl*)(NppPythonScript::NotAllowedInCallbackException const &)>::operator()(const boost::python::detail::exception_handler & handler, const boost::function0<void> & f, void(*)(const NppPythonScript::NotAllowedInCallbackException &) translate) Zeile 46 C++
PythonScript.dll!boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::NotAllowedInCallbackException const &)>>::operator()<bool,boost::python::detail::translate_exception<NppPythonScript::NotAllowedInCallbackException,void (__cdecl*)(NppPythonScript::NotAllowedInCallbackException const &)>,boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &>>(boost::_bi::type<bool> __formal, boost::python::detail::translate_exception<NppPythonScript::NotAllowedInCallbackException,void (__cdecl*)(NppPythonScript::NotAllowedInCallbackException const &)> & f, boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &> & a, long __formal) Zeile 368 C++
PythonScript.dll!boost::_bi::bind_t<bool,boost::python::detail::translate_exception<NppPythonScript::NotAllowedInCallbackException,void (__cdecl*)(NppPythonScript::NotAllowedInCallbackException const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::NotAllowedInCallbackException const &)>>>::operator()<boost::python::detail::exception_handler const &,boost::function0<void> const &>(const boost::python::detail::exception_handler & a1, const boost::function0<void> & a2) Zeile 1298 C++
PythonScript.dll!boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool,boost::python::detail::translate_exception<NppPythonScript::NotAllowedInCallbackException,void (__cdecl*)(NppPythonScript::NotAllowedInCallbackException const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::NotAllowedInCallbackException const &)>>>,bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::invoke(boost::detail::function::function_buffer & function_obj_ptr, const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 138 C++
PythonScript.dll!boost::function2<bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::operator()(const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 765 C++
PythonScript.dll!boost::python::detail::exception_handler::handle(const boost::function0<void> & f) Zeile 42 C++
PythonScript.dll!boost::python::detail::exception_handler::operator()(const boost::function0<void> & f) Zeile 70 C++
PythonScript.dll!boost::python::detail::translate_exception<NppPythonScript::GroupNotFoundException,void (__cdecl*)(NppPythonScript::GroupNotFoundException const &)>::operator()(const boost::python::detail::exception_handler & handler, const boost::function0<void> & f, void(*)(const NppPythonScript::GroupNotFoundException &) translate) Zeile 46 C++
PythonScript.dll!boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::GroupNotFoundException const &)>>::operator()<bool,boost::python::detail::translate_exception<NppPythonScript::GroupNotFoundException,void (__cdecl*)(NppPythonScript::GroupNotFoundException const &)>,boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &>>(boost::_bi::type<bool> __formal, boost::python::detail::translate_exception<NppPythonScript::GroupNotFoundException,void (__cdecl*)(NppPythonScript::GroupNotFoundException const &)> & f, boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &> & a, long __formal) Zeile 368 C++
PythonScript.dll!boost::_bi::bind_t<bool,boost::python::detail::translate_exception<NppPythonScript::GroupNotFoundException,void (__cdecl*)(NppPythonScript::GroupNotFoundException const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::GroupNotFoundException const &)>>>::operator()<boost::python::detail::exception_handler const &,boost::function0<void> const &>(const boost::python::detail::exception_handler & a1, const boost::function0<void> & a2) Zeile 1298 C++
PythonScript.dll!boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool,boost::python::detail::translate_exception<NppPythonScript::GroupNotFoundException,void (__cdecl*)(NppPythonScript::GroupNotFoundException const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::GroupNotFoundException const &)>>>,bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::invoke(boost::detail::function::function_buffer & function_obj_ptr, const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 138 C++
PythonScript.dll!boost::function2<bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::operator()(const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 765 C++
PythonScript.dll!boost::python::detail::exception_handler::handle(const boost::function0<void> & f) Zeile 42 C++
PythonScript.dll!boost::python::detail::exception_handler::operator()(const boost::function0<void> & f) Zeile 70 C++
PythonScript.dll!boost::python::detail::translate_exception<NppPythonScript::ArgumentException,void (__cdecl*)(NppPythonScript::ArgumentException const &)>::operator()(const boost::python::detail::exception_handler & handler, const boost::function0<void> & f, void(*)(const NppPythonScript::ArgumentException &) translate) Zeile 46 C++
PythonScript.dll!boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::ArgumentException const &)>>::operator()<bool,boost::python::detail::translate_exception<NppPythonScript::ArgumentException,void (__cdecl*)(NppPythonScript::ArgumentException const &)>,boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &>>(boost::_bi::type<bool> __formal, boost::python::detail::translate_exception<NppPythonScript::ArgumentException,void (__cdecl*)(NppPythonScript::ArgumentException const &)> & f, boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &> & a, long __formal) Zeile 368 C++
PythonScript.dll!boost::_bi::bind_t<bool,boost::python::detail::translate_exception<NppPythonScript::ArgumentException,void (__cdecl*)(NppPythonScript::ArgumentException const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::ArgumentException const &)>>>::operator()<boost::python::detail::exception_handler const &,boost::function0<void> const &>(const boost::python::detail::exception_handler & a1, const boost::function0<void> & a2) Zeile 1298 C++
PythonScript.dll!boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool,boost::python::detail::translate_exception<NppPythonScript::ArgumentException,void (__cdecl*)(NppPythonScript::ArgumentException const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(NppPythonScript::ArgumentException const &)>>>,bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::invoke(boost::detail::function::function_buffer & function_obj_ptr, const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 138 C++
PythonScript.dll!boost::function2<bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::operator()(const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 765 C++
PythonScript.dll!boost::python::detail::exception_handler::handle(const boost::function0<void> & f) Zeile 42 C++
PythonScript.dll!boost::python::detail::exception_handler::operator()(const boost::function0<void> & f) Zeile 70 C++
PythonScript.dll!boost::python::detail::translate_exception<out_of_bounds_exception,void (__cdecl*)(out_of_bounds_exception const &)>::operator()(const boost::python::detail::exception_handler & handler, const boost::function0<void> & f, void(*)(const out_of_bounds_exception &) translate) Zeile 46 C++
PythonScript.dll!boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(out_of_bounds_exception const &)>>::operator()<bool,boost::python::detail::translate_exception<out_of_bounds_exception,void (__cdecl*)(out_of_bounds_exception const &)>,boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &>>(boost::_bi::type<bool> __formal, boost::python::detail::translate_exception<out_of_bounds_exception,void (__cdecl*)(out_of_bounds_exception const &)> & f, boost::_bi::rrlist2<boost::python::detail::exception_handler const &,boost::function0<void> const &> & a, long __formal) Zeile 368 C++
PythonScript.dll!boost::_bi::bind_t<bool,boost::python::detail::translate_exception<out_of_bounds_exception,void (__cdecl*)(out_of_bounds_exception const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(out_of_bounds_exception const &)>>>::operator()<boost::python::detail::exception_handler const &,boost::function0<void> const &>(const boost::python::detail::exception_handler & a1, const boost::function0<void> & a2) Zeile 1298 C++
PythonScript.dll!boost::detail::function::function_obj_invoker2<boost::_bi::bind_t<bool,boost::python::detail::translate_exception<out_of_bounds_exception,void (__cdecl*)(out_of_bounds_exception const &)>,boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::_bi::value<void (__cdecl*)(out_of_bounds_exception const &)>>>,bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::invoke(boost::detail::function::function_buffer & function_obj_ptr, const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 138 C++
PythonScript.dll!boost::function2<bool,boost::python::detail::exception_handler const &,boost::function0<void> const &>::operator()(const boost::python::detail::exception_handler & a0, const boost::function0<void> & a1) Zeile 765 C++
PythonScript.dll!boost::python::detail::exception_handler::handle(const boost::function0<void> & f) Zeile 42 C++
PythonScript.dll!boost::python::handle_exception_impl(boost::function0<void> f) Zeile 24 C++
PythonScript.dll!boost::python::handle_exception<boost::python::objects::`anonymous namespace'::bind_return>(boost::python::objects::`anonymous-namespace'::bind_return f) Zeile 30 C++
PythonScript.dll!function_call(_object * func, _object * args, _object * kw) Zeile 623 C++
[Externer Code]
PythonScript.dll!boost::python::call<boost::python::api::object,boost::python::dict>(_object * callable, const boost::python::dict & a0, boost::type<boost::python::api::object> * __formal) Zeile 61 C++
PythonScript.dll!boost::python::api::object_operators<boost::python::api::object>::operator()<boost::python::dict>(const boost::python::dict & a0) Zeile 19 C++
PythonScript.dll!NppPythonScript::ScintillaWrapper::runCallbacks(std::shared_ptr<NppPythonScript::CallbackExecArgs> args) Zeile 343 C++
PythonScript.dll!NppPythonScript::ScintillaWrapper::consume(std::shared_ptr<NppPythonScript::CallbackExecArgs> args) Zeile 328 C++
PythonScript.dll!NppPythonScript::PyProducerConsumer<NppPythonScript::CallbackExecArgs>::consumer() Zeile 163 C++
PythonScript.dll!NppPythonScript::PyProducerConsumer<NppPythonScript::CallbackExecArgs>::threadStart(NppPythonScript::PyProducerConsumer<NppPythonScript::CallbackExecArgs> * instance) Zeile 189 C++
[Externer Code]
Seems there is a time gap between first call to
callScintilla(SCI_GETSELTEXT)
to get the size of the buffer and the real retrieval with
callScintilla(SCI_GETSELTEXT, 0, reinterpret_cast<LPARAM>(*result));
and the buffersize of PythonCompatibleStrBuffer result is not matching to the string size of the selection. Likely also due to the multiple GIL aquire/releases.