Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataStorm/events: Unhandled exception thrown: read access violation. #2926

Closed
pepone opened this issue Oct 18, 2024 · 4 comments · Fixed by #3278
Closed

DataStorm/events: Unhandled exception thrown: read access violation. #2926

pepone opened this issue Oct 18, 2024 · 4 comments · Fixed by #3278
Assignees
Milestone

Comments

@pepone
Copy link
Member

pepone commented Oct 18, 2024

I got this on Windows while running DataStorm/events test in a loop:

*** [1/1 loop=23850] Running cpp/DataStorm/events tests ***
[ running client/server test - 10/17/24 20:58:21 ]
- Config: Debug,x64
(C:\Users\jose\source\repos\3.8\ice\cpp\test\DataStorm\events\msbuild\reader\x64\Debug\reader.exe --Ice.Default.Host=127.0.0.1 --Ice.Warn.Connections=1 --Ice.Default.Protocol=tcp --Ice.IPv6=0 --Ice.PrintStackTraces=1 --Ice.ThreadPool.Server.Size=1 --Ice.ThreadPool.Server.SizeMax=3 --Ice.ThreadPool.Server.SizeWarn=0 --Ice.PrintAdapterReady=1 --DataStorm.Node.Server.Endpoints="tcp -p 12020" --DataStorm.Trace.Topic=1 --DataStorm.Trace.Session=3 --DataStorm.Trace.Data=2 --Ice.Trace.Protocol=2 --Ice.Trace.Network=2 --Ice.LogFile=C:\Users\jose\source\repos\3.8\ice\cpp\test\DataStorm\events\server-101724-2058.log env={'PATH': 'C:\\Users\\jose\\source\\repos\\3.8\\ice\\cpp\\test\\Common\\msbuild\\x64\\Debug;C:\\Users\\jose\\source\\repos\\3.8\\ice\\cpp\\bin\\x64\\Debug'})
(C:\Users\jose\source\repos\3.8\ice\cpp\test\DataStorm\events\msbuild\writer\x64\Debug\writer.exe --Ice.Default.Host=127.0.0.1 --Ice.Warn.Connections=1 --Ice.Default.Protocol=tcp --Ice.IPv6=0 --Ice.PrintStackTraces=1 --DataStorm.Node.Server.Enabled=0 --DataStorm.Node.ConnectTo="tcp -p 12020" --DataStorm.Trace.Topic=1 --DataStorm.Trace.Session=3 --DataStorm.Trace.Data=2 --Ice.Trace.Protocol=2 --Ice.Trace.Network=2 --Ice.LogFile=C:\Users\jose\source\repos\3.8\ice\cpp\test\DataStorm\events\client-101724-2058.log env={'PATH': 'C:\\Users\\jose\\source\\repos\\3.8\\ice\\cpp\\test\\Common\\msbuild\\x64\\Debug;C:\\Users\\jose\\source\\repos\\3.8\\ice\\cpp\\bin\\x64\\Debug'})
testing single key reader/writer... ok
testing multi-key reader/writer... ok
testing any-key reader/writer... ok
testing reader/multi-key writer... ok
testing reader/any-key writer... ok
testing multi-key reader/multi-key writer... ok
testing any-key reader/any-key writer... ok
testing filtered reader/writer... ok
testing filtered reader/multi-key writer... ok
testing filtered reader/any-key writer... ok
testing filtered sample reader... process C:\Users\jose\source\repos\3.8\ice\cpp\test\DataStorm\events\msbuild\writer\x64\Debug\writer.exe --Ice.Default.Host=127.0.0.1 --Ice.Warn.Connections=1 --Ice.Default.Protocol=tcp --Ice.IPv6=0 --Ice.PrintStackTraces=1 --DataStorm.Node.Server.Enabled=0 --DataStorm.Node.ConnectTo="tcp -p 12020" --DataStorm.Trace.Topic=1 --DataStorm.Trace.Session=3 --DataStorm.Trace.Data=2 --Ice.Trace.Protocol=2 --Ice.Trace.Network=2 --Ice.LogFile=C:\Users\jose\source\repos\3.8\ice\cpp\test\DataStorm\events\client-101724-2058.log pid=11108 is hanging - 10/17/24 20:59:51

Stack trace

>	reader.exe!std::_Matcher<char const *,char,std::regex_traits<char>,char const *>::_Match_pat(std::_Node_base * _Nx) Line 3501	C++
 	reader.exe!std::_Matcher<char const *,char,std::regex_traits<char>,char const *>::_Do_if(std::_Node_if * _Node) Line 3166	C++
 	reader.exe!std::_Matcher<char const *,char,std::regex_traits<char>,char const *>::_Match_pat(std::_Node_base * _Nx) Line 3625	C++
 	reader.exe!std::_Matcher<char const *,char,std::regex_traits<char>,char const *>::_Match<std::allocator<std::sub_match<char const *>>>(std::match_results<char const *,std::allocator<std::sub_match<char const *>>> * _Matches, bool _Full_match) Line 1628	C++
 	reader.exe!std::_Regex_match1<char const *,std::allocator<std::sub_match<char const *>>,char,std::regex_traits<char>,char const *>(const char * _First, const char * _Last, std::match_results<char const *,std::allocator<std::sub_match<char const *>>> * _Matches, const std::basic_regex<char,std::regex_traits<char>> & _Re, std::regex_constants::match_flag_type _Flgs, bool _Full) Line 2165	C++
 	reader.exe!std::regex_match<std::char_traits<char>,std::allocator<char>,char,std::regex_traits<char>>(const std::string & _Str, const std::basic_regex<char,std::regex_traits<char>> & _Re, std::regex_constants::match_flag_type _Flgs) Line 2222	C++
 	reader.exe!DataStorm::makeRegexFilter::__l2::<lambda_1>::()::__l2::<lambda_1>::operator()(const std::string & value) Line 1831	C++
 	reader.exe!std::invoke<``DataStorm::makeRegexFilter<std::string>'::`2'::<lambda_1>::operator()'::`2'::<lambda_1> &,std::string const &>(DataStorm::makeRegexFilter::__l2::<lambda_1>::()::__l2::<lambda_1> & _Obj, const std::string & _Arg1) Line 1734	C++
 	reader.exe!std::_Func_impl_no_alloc<``DataStorm::makeRegexFilter<std::string>'::`2'::<lambda_1>::operator()'::`2'::<lambda_1>,bool,std::string const &>::_Do_call(const std::string & <_Args_0>) Line 878	C++
 	reader.exe!std::_Func_class<bool,std::string const &>::operator()(const std::string & <_Args_0>) Line 921	C++
 	reader.exe!DataStormI::FilterT<std::string,DataStormI::KeyT<std::string>>::match(const std::shared_ptr<DataStormI::Filterable> & value) Line 428	C++
 	datastorm38a0d.dll!DataStormI::TopicI::getElementSpecs(__int64 topicId, const std::vector<DataStormContract::ElementInfo,std::allocator<DataStormContract::ElementInfo>> & infos, const std::shared_ptr<DataStormI::SessionI> & session) Line 185	C++
 	datastorm38a0d.dll!DataStormI::SessionI::announceElements::__l2::<lambda_1>::operator()(DataStormI::TopicI * topic, DataStormI::SessionI::TopicSubscriber & __formal, DataStormI::SessionI::TopicSubscribers & __formal) Line 291	C++
 	datastorm38a0d.dll!std::invoke<`DataStormI::SessionI::announceElements'::`2'::<lambda_1> &,DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &>(DataStormI::SessionI::announceElements::__l2::<lambda_1> & _Obj, DataStormI::TopicI * && _Arg1, DataStormI::SessionI::TopicSubscriber & <_Args2_0>, DataStormI::SessionI::TopicSubscribers & <_Args2_1>) Line 1714	C++
 	datastorm38a0d.dll!std::_Func_impl_no_alloc<`DataStormI::SessionI::announceElements'::`2'::<lambda_1>,void,DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &>::_Do_call(DataStormI::TopicI * && <_Args_0>, DataStormI::SessionI::TopicSubscriber & <_Args_1>, DataStormI::SessionI::TopicSubscribers & <_Args_2>) Line 874	C++
 	datastorm38a0d.dll!std::_Func_class<void,DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &>::operator()(DataStormI::TopicI * <_Args_0>, DataStormI::SessionI::TopicSubscriber & <_Args_1>, DataStormI::SessionI::TopicSubscribers & <_Args_2>) Line 920	C++
 	datastorm38a0d.dll!DataStormI::SessionI::runWithTopics(__int64 id, std::function<void __cdecl(DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &)> fn) Line 1210	C++
 	datastorm38a0d.dll!DataStormI::SessionI::announceElements(__int64 topicId, std::vector<DataStormContract::ElementInfo,std::allocator<DataStormContract::ElementInfo>> elements, const Ice::Current & __formal) Line 280	C++
 	datastorm38a0d.dll!DataStormContract::Session::_iceD_announceElements(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 808	C++
 	datastorm38a0d.dll!DataStormContract::SubscriberSession::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 1164	C++
 	datastorm38a0d.dll!`anonymous namespace'::DispatchInterceptorI::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 32	C++
 	ice38a0d.dll!IceInternal::ServantManager::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 486	C++
 	ice38a0d.dll!IceInternal::LoggerMiddleware::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 29	C++
 	ice38a0d.dll!Ice::ConnectionI::dispatchAll(Ice::InputStream & stream, int requestCount, int requestId, unsigned char compress, const std::shared_ptr<Ice::ObjectAdapterI> & adapter) Line 3454	C++
 	ice38a0d.dll!Ice::ConnectionI::parseMessage::__l26::<lambda_1>::operator()(Ice::InputStream & messageStream) Line 3253	C++
 	ice38a0d.dll!std::invoke<`Ice::ConnectionI::parseMessage'::`26'::<lambda_1> &,Ice::InputStream &>(Ice::ConnectionI::parseMessage::__l26::<lambda_1> & _Obj, Ice::InputStream & _Arg1) Line 1734	C++
 	ice38a0d.dll!std::_Func_impl_no_alloc<`Ice::ConnectionI::parseMessage'::`26'::<lambda_1>,bool,Ice::InputStream &>::_Do_call(Ice::InputStream & <_Args_0>) Line 878	C++
 	ice38a0d.dll!std::_Func_class<bool,Ice::InputStream &>::operator()(Ice::InputStream & <_Args_0>) Line 921	C++
 	ice38a0d.dll!Ice::ConnectionI::upcall(std::function<void __cdecl(std::shared_ptr<Ice::ConnectionI>)> connectionStartCompleted, const std::vector<Ice::ConnectionI::OutgoingMessage,std::allocator<Ice::ConnectionI::OutgoingMessage>> & sentCBs, std::function<bool __cdecl(Ice::InputStream &)> messageUpcall, Ice::InputStream & messageStream) Line 1532	C++
 	ice38a0d.dll!Ice::ConnectionI::message(IceInternal::ThreadPoolCurrent & current) Line 1461	C++
 	ice38a0d.dll!IceInternal::ThreadPool::run(const std::shared_ptr<IceInternal::ThreadPool::EventHandlerThread> & thread) Line 723	C++
 	ice38a0d.dll!IceInternal::ThreadPool::EventHandlerThread::run() Line 1080	C++
 	ice38a0d.dll!std::invoke<void (__cdecl IceInternal::ThreadPool::EventHandlerThread::*)(void),IceInternal::ThreadPool::EventHandlerThread *>(void(IceInternal::ThreadPool::EventHandlerThread::*)() && _Obj, IceInternal::ThreadPool::EventHandlerThread * && _Arg1) Line 1720	C++
 	ice38a0d.dll!std::thread::_Invoke<std::tuple<void (__cdecl IceInternal::ThreadPool::EventHandlerThread::*)(void),IceInternal::ThreadPool::EventHandlerThread *>,0,1>(void * _RawVals) Line 61	C++
 	ucrtbased.dll!00007ffa74543010()	Unknown
 	kernel32.dll!00007ffac3167374()	Unknown
 	ntdll.dll!00007ffac49dcc91()	Unknown
@pepone pepone added this to the 3.8.0 milestone Oct 18, 2024
@pepone
Copy link
Member Author

pepone commented Oct 21, 2024

Main thread stack:

 	ntdll.dll!00007ffac4a30f24()	Unknown
 	ntdll.dll!00007ffac49b9205()	Unknown
 	msvcp140d.dll!00007ffa83be2c63()	Unknown
 	msvcp140d.dll!00007ffa83be29d5()	Unknown
 	datastorm38a0d.dll!std::_Mutex_base::lock() Line 52	C++
 	datastorm38a0d.dll!std::lock_guard<std::mutex>::lock_guard<std::mutex>(std::mutex & _Mtx) Line 454	C++
 	datastorm38a0d.dll!DataStormI::TopicReaderI::createFiltered(const std::shared_ptr<DataStormI::Filter> & filter, const std::string & name, DataStorm::ReaderConfig config, const std::string & sampleFilterName, std::vector<enum std::byte,std::allocator<enum std::byte>> sampleFilterCriteria) Line 881	C++
 	reader.exe!DataStorm::FilteredKeyReader<std::string,std::string,std::string>::FilteredKeyReader<std::string,std::string,std::string><std::string,std::vector<enum DataStorm::SampleEvent,std::allocator<enum DataStorm::SampleEvent>>>(const DataStorm::Topic<std::string,std::string,std::string> & topic, const DataStorm::Filter<std::string> & keyFilter, const DataStorm::Filter<std::vector<enum DataStorm::SampleEvent,std::allocator<enum DataStorm::SampleEvent>>> & sampleFilter, const std::string & name, const DataStorm::ReaderConfig & config) Line 1546	C++
 	reader.exe!DataStorm::makeFilteredKeyReader<std::string,std::vector<enum DataStorm::SampleEvent,std::allocator<enum DataStorm::SampleEvent>>,std::string,std::string,std::string>(const DataStorm::Topic<std::string,std::string,std::string> & topic, const DataStorm::Filter<std::string> & keyFilter, const DataStorm::Filter<std::vector<enum DataStorm::SampleEvent,std::allocator<enum DataStorm::SampleEvent>>> & sampleFilter, const std::string & name, const DataStorm::ReaderConfig & config) Line 1023	C++
>	reader.exe!main(int argc, char * * argv) Line 341	C++
 	reader.exe!invoke_main() Line 79	C++
 	reader.exe!__scrt_common_main_seh() Line 288	C++
 	reader.exe!__scrt_common_main() Line 331	C++
 	reader.exe!mainCRTStartup(void * __formal) Line 17	C++
 	kernel32.dll!00007ffac3167374()	Unknown
 	ntdll.dll!00007ffac49dcc91()	Unknown

auto reader13 = makeFilteredKeyReader(
topic,
Filter<string>("_regex", "elem[1]"),
Filter<SampleEventSeq>("_event", SampleEventSeq{SampleEvent::Remove}),
"",
config);

Which correspond with

@pepone
Copy link
Member Author

pepone commented Oct 22, 2024

Got another similar crash with the same test, after 11625 iterations

Unhandled exception thrown: read access violation.
this->**_Rep** was 0xFFFFFFFFFFFFFFDF.
 	reader.exe!std::basic_regex<char,std::regex_traits<char>>::flags() Line 1980	C++
 	reader.exe!std::_Regex_match1<char const *,std::allocator<std::sub_match<char const *>>,char,std::regex_traits<char>,char const *>(const char * _First, const char * _Last, std::match_results<char const *,std::allocator<std::sub_match<char const *>>> * _Matches, const std::basic_regex<char,std::regex_traits<char>> & _Re, std::regex_constants::match_flag_type _Flgs, bool _Full) Line 2163	C++
 	reader.exe!std::regex_match<std::char_traits<char>,std::allocator<char>,char,std::regex_traits<char>>(const std::string & _Str, const std::basic_regex<char,std::regex_traits<char>> & _Re, std::regex_constants::match_flag_type _Flgs) Line 2222	C++
 	reader.exe!DataStorm::makeRegexFilter::__l2::<lambda_1>::()::__l2::<lambda_1>::operator()(const std::string & value) Line 1831	C++
 	reader.exe!std::invoke<``DataStorm::makeRegexFilter<std::string>'::`2'::<lambda_1>::operator()'::`2'::<lambda_1> &,std::string const &>(DataStorm::makeRegexFilter::__l2::<lambda_1>::()::__l2::<lambda_1> & _Obj, const std::string & _Arg1) Line 1734	C++
 	reader.exe!std::_Func_impl_no_alloc<``DataStorm::makeRegexFilter<std::string>'::`2'::<lambda_1>::operator()'::`2'::<lambda_1>,bool,std::string const &>::_Do_call(const std::string & <_Args_0>) Line 878	C++
 	reader.exe!std::_Func_class<bool,std::string const &>::operator()(const std::string & <_Args_0>) Line 921	C++
 	reader.exe!DataStormI::FilterT<std::string,DataStormI::KeyT<std::string>>::match(const std::shared_ptr<DataStormI::Filterable> & value) Line 428	C++
>	datastorm38a0d.dll!DataStormI::TopicI::attachElements(__int64 topicId, const std::vector<DataStormContract::ElementSpec,std::allocator<DataStormContract::ElementSpec>> & elements, const std::shared_ptr<DataStormI::SessionI> & session, DataStormContract::SessionPrx prx, const std::chrono::time_point<std::chrono::system_clock,std::chrono::duration<__int64,std::ratio<1,10000000>>> & now) Line 390	C++
 	datastorm38a0d.dll!DataStormI::SessionI::attachElements::__l2::<lambda_1>::operator()(DataStormI::TopicI * topic, DataStormI::SessionI::TopicSubscriber & subscriber, DataStormI::SessionI::TopicSubscribers & __formal) Line 330	C++
 	datastorm38a0d.dll!std::invoke<`DataStormI::SessionI::attachElements'::`2'::<lambda_1> &,DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &>(DataStormI::SessionI::attachElements::__l2::<lambda_1> & _Obj, DataStormI::TopicI * && _Arg1, DataStormI::SessionI::TopicSubscriber & <_Args2_0>, DataStormI::SessionI::TopicSubscribers & <_Args2_1>) Line 1714	C++
 	datastorm38a0d.dll!std::_Func_impl_no_alloc<`DataStormI::SessionI::attachElements'::`2'::<lambda_1>,void,DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &>::_Do_call(DataStormI::TopicI * && <_Args_0>, DataStormI::SessionI::TopicSubscriber & <_Args_1>, DataStormI::SessionI::TopicSubscribers & <_Args_2>) Line 874	C++
 	datastorm38a0d.dll!std::_Func_class<void,DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &>::operator()(DataStormI::TopicI * <_Args_0>, DataStormI::SessionI::TopicSubscriber & <_Args_1>, DataStormI::SessionI::TopicSubscribers & <_Args_2>) Line 920	C++
 	datastorm38a0d.dll!DataStormI::SessionI::runWithTopics(__int64 id, std::function<void __cdecl(DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &)> fn) Line 1210	C++
 	datastorm38a0d.dll!DataStormI::SessionI::attachElements(__int64 id, std::vector<DataStormContract::ElementSpec,std::allocator<DataStormContract::ElementSpec>> elements, bool initialize, const Ice::Current & __formal) Line 316	C++
 	datastorm38a0d.dll!DataStormContract::Session::_iceD_attachElements(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 826	C++
 	datastorm38a0d.dll!DataStormContract::SubscriberSession::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 1174	C++
 	datastorm38a0d.dll!`anonymous namespace'::DispatchInterceptorI::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 32	C++
 	ice38a0d.dll!IceInternal::ServantManager::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 486	C++
 	ice38a0d.dll!IceInternal::LoggerMiddleware::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 29	C++
 	ice38a0d.dll!Ice::ConnectionI::dispatchAll(Ice::InputStream & stream, int requestCount, int requestId, unsigned char compress, const std::shared_ptr<Ice::ObjectAdapterI> & adapter) Line 3454	C++
 	ice38a0d.dll!Ice::ConnectionI::parseMessage::__l26::<lambda_1>::operator()(Ice::InputStream & messageStream) Line 3253	C++
 	ice38a0d.dll!std::invoke<`Ice::ConnectionI::parseMessage'::`26'::<lambda_1> &,Ice::InputStream &>(Ice::ConnectionI::parseMessage::__l26::<lambda_1> & _Obj, Ice::InputStream & _Arg1) Line 1734	C++
 	ice38a0d.dll!std::_Func_impl_no_alloc<`Ice::ConnectionI::parseMessage'::`26'::<lambda_1>,bool,Ice::InputStream &>::_Do_call(Ice::InputStream & <_Args_0>) Line 878	C++
 	ice38a0d.dll!std::_Func_class<bool,Ice::InputStream &>::operator()(Ice::InputStream & <_Args_0>) Line 921	C++
 	ice38a0d.dll!Ice::ConnectionI::upcall(std::function<void __cdecl(std::shared_ptr<Ice::ConnectionI>)> connectionStartCompleted, const std::vector<Ice::ConnectionI::OutgoingMessage,std::allocator<Ice::ConnectionI::OutgoingMessage>> & sentCBs, std::function<bool __cdecl(Ice::InputStream &)> messageUpcall, Ice::InputStream & messageStream) Line 1532	C++
 	ice38a0d.dll!Ice::ConnectionI::message(IceInternal::ThreadPoolCurrent & current) Line 1461	C++
 	ice38a0d.dll!IceInternal::ThreadPool::run(const std::shared_ptr<IceInternal::ThreadPool::EventHandlerThread> & thread) Line 723	C++
 	ice38a0d.dll!IceInternal::ThreadPool::EventHandlerThread::run() Line 1080	C++
 	ice38a0d.dll!std::invoke<void (__cdecl IceInternal::ThreadPool::EventHandlerThread::*)(void),IceInternal::ThreadPool::EventHandlerThread *>(void(IceInternal::ThreadPool::EventHandlerThread::*)() && _Obj, IceInternal::ThreadPool::EventHandlerThread * && _Arg1) Line 1720	C++
 	ice38a0d.dll!std::thread::_Invoke<std::tuple<void (__cdecl IceInternal::ThreadPool::EventHandlerThread::*)(void),IceInternal::ThreadPool::EventHandlerThread *>,0,1>(void * _RawVals) Line 61	C++
 	ucrtbased.dll!00007ffa80d43010()	Unknown
 	kernel32.dll!00007ffac3167374()	Unknown
 	ntdll.dll!00007ffac49dcc91()	Unknown

@pepone
Copy link
Member Author

pepone commented Nov 5, 2024

I updated the filter to capture the criteria and create the regexp each time, like in:

/ std::regex's constructor accepts a const string&; it does not accept a string_view.
        return [](const std::string& criteria)
        {
            return [criteria](const Value& value)
            {
                std::regex expr(criteria); 
                std::ostringstream os;
                os << value;
                return std::regex_match(os.str(), expr);
            };
        };

but hit a different assert:

 	reader.exe!std::_Adl_verify_range<char const *,char const *>(const char * const & _First, const char * const & _Last) Line 1296	C++
 	reader.exe!std::string::assign<char const *,0>(const char * const _First, const char * const _Last) Line 1651	C++
 	reader.exe!std::basic_regex<char,std::regex_traits<char>>::_Reset<char const *>(const char * _First, const char * _Last, std::regex_constants::syntax_option_type _Flags) Line 2036	C++
 	reader.exe!std::basic_regex<char,std::regex_traits<char>>::basic_regex<char,std::regex_traits<char>><std::char_traits<char>,std::allocator<char>>(const std::string & _Str, std::regex_constants::syntax_option_type _Flags) Line 1853	C++
 	reader.exe!DataStorm::makeRegexFilter::__l2::<lambda_1>::()::__l2::<lambda_1>::operator()(const std::string & value) Line 1840	C++
 	reader.exe!std::invoke<``DataStorm::makeRegexFilter<std::string>'::`2'::<lambda_1>::operator()'::`2'::<lambda_1> &,std::string const &>(DataStorm::makeRegexFilter::__l2::<lambda_1>::()::__l2::<lambda_1> & _Obj, const std::string & _Arg1) Line 1734	C++
 	reader.exe!std::_Func_impl_no_alloc<``DataStorm::makeRegexFilter<std::string>'::`2'::<lambda_1>::operator()'::`2'::<lambda_1>,bool,std::string const &>::_Do_call(const std::string & <_Args_0>) Line 878	C++
 	reader.exe!std::_Func_class<bool,std::string const &>::operator()(const std::string & <_Args_0>) Line 921	C++
 	reader.exe!DataStormI::FilterT<std::string,DataStormI::KeyT<std::string>>::match(const std::shared_ptr<DataStormI::Filterable> & value) Line 437	C++
 	datastorm38a0d.dll!DataStormI::TopicI::attachElements(__int64 topicId, const std::vector<DataStormContract::ElementSpec,std::allocator<DataStormContract::ElementSpec>> & elements, const std::shared_ptr<DataStormI::SessionI> & session, DataStormContract::SessionPrx prx, const std::chrono::time_point<std::chrono::system_clock,std::chrono::duration<__int64,std::ratio<1,10000000>>> & now) Line 389	C++
 	datastorm38a0d.dll!DataStormI::SessionI::attachElements::__l2::<lambda_1>::operator()(DataStormI::TopicI * topic, DataStormI::SessionI::TopicSubscriber & subscriber, DataStormI::SessionI::TopicSubscribers & __formal) Line 325	C++
 	datastorm38a0d.dll!std::invoke<`DataStormI::SessionI::attachElements'::`2'::<lambda_1> &,DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &>(DataStormI::SessionI::attachElements::__l2::<lambda_1> & _Obj, DataStormI::TopicI * && _Arg1, DataStormI::SessionI::TopicSubscriber & <_Args2_0>, DataStormI::SessionI::TopicSubscribers & <_Args2_1>) Line 1714	C++
 	datastorm38a0d.dll!std::_Func_impl_no_alloc<`DataStormI::SessionI::attachElements'::`2'::<lambda_1>,void,DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &>::_Do_call(DataStormI::TopicI * && <_Args_0>, DataStormI::SessionI::TopicSubscriber & <_Args_1>, DataStormI::SessionI::TopicSubscribers & <_Args_2>) Line 874	C++
 	datastorm38a0d.dll!std::_Func_class<void,DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &>::operator()(DataStormI::TopicI * <_Args_0>, DataStormI::SessionI::TopicSubscriber & <_Args_1>, DataStormI::SessionI::TopicSubscribers & <_Args_2>) Line 920	C++
 	datastorm38a0d.dll!DataStormI::SessionI::runWithTopics(__int64 id, std::function<void __cdecl(DataStormI::TopicI *,DataStormI::SessionI::TopicSubscriber &,DataStormI::SessionI::TopicSubscribers &)> fn) Line 1210	C++
 	datastorm38a0d.dll!DataStormI::SessionI::attachElements(__int64 id, std::vector<DataStormContract::ElementSpec,std::allocator<DataStormContract::ElementSpec>> elements, bool initialize, const Ice::Current & __formal) Line 311	C++
>	datastorm38a0d.dll!DataStormContract::Session::_iceD_attachElements(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 826	C++
 	datastorm38a0d.dll!DataStormContract::SubscriberSession::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 1174	C++
 	datastorm38a0d.dll!`anonymous namespace'::DispatchInterceptorI::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 31	C++
 	ice38a0d.dll!IceInternal::ServantManager::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 488	C++
 	ice38a0d.dll!IceInternal::LoggerMiddleware::dispatch(Ice::IncomingRequest & request, std::function<void __cdecl(Ice::OutgoingResponse)> sendResponse) Line 29	C++
 	ice38a0d.dll!Ice::ConnectionI::dispatchAll(Ice::InputStream & stream, int requestCount, int requestId, unsigned char compress, const std::shared_ptr<Ice::ObjectAdapterI> & adapter) Line 3454	C++
 	ice38a0d.dll!Ice::ConnectionI::parseMessage::__l26::<lambda_1>::operator()(Ice::InputStream & messageStream) Line 3253	C++
 	ice38a0d.dll!std::invoke<`Ice::ConnectionI::parseMessage'::`26'::<lambda_1> &,Ice::InputStream &>(Ice::ConnectionI::parseMessage::__l26::<lambda_1> & _Obj, Ice::InputStream & _Arg1) Line 1734	C++
 	ice38a0d.dll!std::_Func_impl_no_alloc<`Ice::ConnectionI::parseMessage'::`26'::<lambda_1>,bool,Ice::InputStream &>::_Do_call(Ice::InputStream & <_Args_0>) Line 878	C++
 	ice38a0d.dll!std::_Func_class<bool,Ice::InputStream &>::operator()(Ice::InputStream & <_Args_0>) Line 921	C++
 	ice38a0d.dll!Ice::ConnectionI::upcall(std::function<void __cdecl(std::shared_ptr<Ice::ConnectionI>)> connectionStartCompleted, const std::vector<Ice::ConnectionI::OutgoingMessage,std::allocator<Ice::ConnectionI::OutgoingMessage>> & sentCBs, std::function<bool __cdecl(Ice::InputStream &)> messageUpcall, Ice::InputStream & messageStream) Line 1532	C++
 	ice38a0d.dll!Ice::ConnectionI::message(IceInternal::ThreadPoolCurrent & current) Line 1461	C++
 	ice38a0d.dll!IceInternal::ThreadPool::run(const std::shared_ptr<IceInternal::ThreadPool::EventHandlerThread> & thread) Line 723	C++
 	ice38a0d.dll!IceInternal::ThreadPool::EventHandlerThread::run() Line 1080	C++
 	ice38a0d.dll!std::invoke<void (__cdecl IceInternal::ThreadPool::EventHandlerThread::*)(void),IceInternal::ThreadPool::EventHandlerThread *>(void(IceInternal::ThreadPool::EventHandlerThread::*)() && _Obj, IceInternal::ThreadPool::EventHandlerThread * && _Arg1) Line 1720	C++
 	ice38a0d.dll!std::thread::_Invoke<std::tuple<void (__cdecl IceInternal::ThreadPool::EventHandlerThread::*)(void),IceInternal::ThreadPool::EventHandlerThread *>,0,1>(void * _RawVals) Line 61	C++
 	ucrtbased.dll!00007ffccec73010()	Unknown
 	kernel32.dll!00007ffd52547374()	Unknown
 	ntdll.dll!00007ffd53b1cc91()	Unknown

@pepone
Copy link
Member Author

pepone commented Dec 16, 2024

The test also crash on Ubuntu:

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000594fc16d0c5a in std::__detail::_State<char>::_M_opcode (this=0x11d0219d2569f0d0) at /usr/include/c++/13/bits/regex_automaton.h:166
166	      { return _State_base::_M_opcode; }
[Current thread is 1 (Thread 0x78eec90006c0 (LWP 495345))]
(gdb) bt
#0  0x0000594fc16d0c5a in std::__detail::_State<char>::_M_opcode (this=0x11d0219d2569f0d0) at /usr/include/c++/13/bits/regex_automaton.h:166
#1  0x0000594fc16e6dd5 in std::__detail::_Executor<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::regex_traits<char>, true>::_M_dfs (this=0x78eec8ff5600, 
    __match_mode=std::__detail::_Executor<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::regex_traits<char>, true>::_Match_mode::_Exact, __i=795353183352792401) at /usr/include/c++/13/bits/regex_executor.tcc:513
#2  0x0000594fc16edf28 in std::__detail::_Executor<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::regex_traits<char>, true>::_M_handle_subexpr_begin (this=0x78eec8ff5600, 
    __match_mode=std::__detail::_Executor<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::regex_traits<char>, true>::_Match_mode::_Exact, __i=0) at /usr/include/c++/13/bits/regex_executor.tcc:255
#3  0x0000594fc16e6e32 in std::__detail::_Executor<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::regex_traits<char>, true>::_M_dfs (this=0x78eec8ff5600, 
    __match_mode=std::__detail::_Executor<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::regex_traits<char>, true>::_Match_mode::_Exact, __i=0) at /usr/include/c++/13/bits/regex_executor.tcc:518
#4  0x0000594fc16dfbee in std::__detail::_Executor<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::regex_traits<char>, true>::_M_main_dispatch (this=0x78eec8ff5600, 
    __match_mode=std::__detail::_Executor<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::regex_traits<char>, true>::_Match_mode::_Exact) at /usr/include/c++/13/bits/regex_executor.tcc:87
#5  0x0000594fc16d8b91 in std::__detail::_Executor<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::regex_traits<char>, true>::_M_main (this=0x78eec8ff5600, 
    __match_mode=std::__detail::_Executor<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::regex_traits<char>, true>::_Match_mode::_Exact) at /usr/include/c++/13/bits/regex_executor.h:150
#6  0x0000594fc16d15dd in std::__detail::_Executor<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::__cxx11::regex_traits<char>, true>::_M_match (this=0x78eec8ff5600) at /usr/include/c++/13/bits/regex_executor.h:94
#7  0x0000594fc16c86fd in std::__detail::__regex_algo_impl<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, std::__cxx11::regex_traits<char> > (__s=101 'e', __e=0 '\000', __m=..., __re=..., __flags=std::regex_constants::_S_default, __policy=std::__detail::_RegexExecutorPolicy::_S_auto, 
    __match_mode=true) at /usr/include/c++/13/bits/regex.tcc:80
#8  0x0000594fc16bf8b8 in std::regex_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, char, std::__cxx11::regex_traits<char> > (__s=101 'e', __e=0 '\000', __m=..., __re=..., __flags=std::regex_constants::_S_default) at /usr/include/c++/13/bits/regex.h:2268
#9  0x0000594fc16b81ea in std::regex_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, char, std::__cxx1--Type <RET> for more, q to quit, c to continue without paging--
1::regex_traits<char> > (__first=101 'e', __last=0 '\000', __re=..., __flags=std::regex_constants::_S_default) at /usr/include/c++/13/bits/regex.h:2294
#10 0x0000594fc16b23b3 in std::regex_match<std::char_traits<char>, std::allocator<char>, char, std::__cxx11::regex_traits<char> > (__s="elem1", __re=..., 
    __flags=std::regex_constants::_S_default) at /usr/include/c++/13/bits/regex.h:2399
#11 0x0000594fc16ad23e in DataStorm::makeRegexFilter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >()::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const (
    __closure=0x594fc2e2a040, value="elem1") at ../cpp/include/DataStorm/DataStorm.h:1849
#12 0x0000594fc16dfd01 in std::__invoke_impl<bool, DataStorm::makeRegexFilter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >()::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(std::__invoke_other, DataStorm::makeRegexFilter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >()::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (__f=...)
    at /usr/include/c++/13/bits/invoke.h:61
#13 0x0000594fc16d8d6f in std::__invoke_r<bool, DataStorm::makeRegexFilter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >()::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&>(DataStorm::makeRegexFilter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >()::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (__fn=...)
    at /usr/include/c++/13/bits/invoke.h:114
#14 0x0000594fc16d1a35 in std::_Function_handler<bool (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&), DataStorm::makeRegexFilter<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >()::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const::{lambda(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)#1}>::_M_invoke(std::_Any_data const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (__functor=..., __args#0="elem1")
    at /usr/include/c++/13/bits/std_function.h:290
#15 0x0000594fc17104e7 in std::function<bool (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const (this=0x594fc2e2a3d8, __args#0="elem1") at /usr/include/c++/13/bits/std_function.h:591
#16 0x0000594fc170da48 in DataStormI::FilterT<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, DataStormI::KeyT<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::match (this=0x594fc2e2a380, value=warning: RTTI symbol not found for class 'std::_Sp_counted_deleter<DataStormI::KeyT<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >*, DataStormI::AbstractFactoryT<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, DataStormI::KeyT<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::Deleter, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>'
warning: RTTI symbol not found for class 'std::_Sp_counted_deleter<DataStormI::KeyT<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >*, DataStormI::AbstractFactoryT<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, DataStormI::KeyT<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::Deleter, std::allocator<void>, (__gnu_cxx::_Lock_policy)2>'
std::shared_ptr<DataStormI::Filterable> (use count 3, weak count 2) = {...})
    at ../cpp/include/DataStorm/InternalT.h:435
#17 0x000078eeccbb166b in DataStormI::TopicI::getElementSpecs (this=0x594fc2e29c38, topicId=13, infos=std::vector of length 1, capacity 1 = {...}, 
    session=std::shared_ptr<DataStormI::SessionI> (use count 7, weak count 1) = {...}) at src/DataStorm/TopicI.cpp:231
#18 0x000078eeccb7e4a3 in operator() (__closure=0x78eec00074c0, topic=0x594fc2e29c38) at src/DataStorm/SessionI.cpp:289

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant