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

Unhandled exception discovered in the Neon REPL. (Windows only) #454

Open
gitlarryf opened this issue May 31, 2024 · 0 comments
Open

Unhandled exception discovered in the Neon REPL. (Windows only) #454

gitlarryf opened this issue May 31, 2024 · 0 comments

Comments

@gitlarryf
Copy link
Contributor

Typing the following lines in the REPL:

VAR d: Dictionary<Number> := { "10": 10, "20": 20 }
print(d[100])

Will cause an unhandled exception in Windows vcruntime140.dll.
Unhandled exception at 0x00007FF819B41416 (vcruntime140d.dll) in neon.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF. occurred
The exception happens on line 26 of lexer.cpp, and appears to be some sort of uninitialized variable, resulting in a std::bad_alloc() attempting to be thrown.

Stack trace

 	ucrtbased.dll!issue_debug_notification(const wchar_t * const message) Line 28	C++
 	ucrtbased.dll!__acrt_report_runtime_error(const wchar_t * message) Line 154	C++
 	ucrtbased.dll!abort() Line 61	C++
 	ucrtbased.dll!terminate() Line 59	C++
 	neon.exe!__scrt_unhandled_exception_filter(_EXCEPTION_POINTERS * const pointers) Line 94	C++
 	KernelBase.dll!UnhandledExceptionFilter�()	Unknown
 	ntdll.dll!RtlUserThreadStart$filt$0()	Unknown
 	ntdll.dll!__C_specific_handler�()	Unknown
 	ntdll.dll!RtlpExecuteHandlerForException�()	Unknown
 	ntdll.dll!RtlDispatchException()	Unknown
 	ntdll.dll!RtlRaiseException�()	Unknown
 	KernelBase.dll!RaiseException�()	Unknown
 	vcruntime140d.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 75	C++
>	neon.exe!__scrt_throw_std_bad_alloc() Line 36	C++
 	neon.exe!operator new(unsigned __int64 size) Line 53	C++
 	neon.exe!std::_Default_allocate_traits::_Allocate(const unsigned __int64 _Bytes) Line 53	C++
 	neon.exe!std::_Allocate_manually_vector_aligned(const unsigned __int64 _Bytes) Line 100	C++
 	neon.exe!std::_Allocate<16,std::_Default_allocate_traits,0>(const unsigned __int64 _Bytes) Line 184	C++
 	neon.exe!std::allocator::allocate(const unsigned __int64 _Count) Line 998	C++
 	neon.exe!std::basic_string,std::allocator >::_Construct_lv_contents(const std::basic_string,std::allocator > & _Right) Line 2411	C++
 	neon.exe!std::basic_string,std::allocator >::basic_string,std::allocator >(const std::basic_string,std::allocator > & _Right) Line 2131	C++
 	neon.exe!Token::file() Line 26	C++
 	neon.exe!SourceErrorToken::SourceErrorToken(const Token & token) Line 30	C++
 	neon.exe!SourceError::SourceError(const std::basic_string,std::allocator > & compiler_file, int compiler_line, int number, const Token & token, const std::basic_string,std::allocator > & message, const Token & token2, const std::basic_string,std::allocator > & message2) Line 42	C++
 	neon.exe!abort_error(const char * compiler_file, int compiler_line, int number, const Token & token, const std::basic_string,std::allocator > & message, const Token & token2, const std::basic_string,std::allocator > & message2) Line 33	C++
 	neon.exe!Analyzer::analyze(const pt::SubscriptExpression * expr) Line 2618	C++
 	neon.exe!ExpressionAnalyzer::visit(const pt::SubscriptExpression * p) Line 304	C++
 	neon.exe!pt::SubscriptExpression::accept(pt::IParseTreeVisitor * visitor) Line 428	C++
 	neon.exe!Analyzer::analyze(const pt::Expression * expr) Line 2232	C++
 	neon.exe!Analyzer::analyze_function_call(const pt::FunctionCallExpression * expr, const ast::TypeFunction * ftype, const ast::Expression * self, const ast::Expression * dispatch, const std::vector > & initial_args, const ast::Expression * func, bool allow_ignore_result) Line 3038	C++
 	neon.exe!Analyzer::analyze(const pt::FunctionCallExpression * expr) Line 3298	C++
 	neon.exe!ExpressionAnalyzer::visit(const pt::FunctionCallExpression * p) Line 306	C++
 	neon.exe!pt::FunctionCallExpression::accept(pt::IParseTreeVisitor * visitor) Line 452	C++
 	neon.exe!Analyzer::analyze(const pt::Expression * expr) Line 2232	C++
 	neon.exe!Analyzer::analyze(const pt::FunctionCallExpression * expr) Line 3273	C++
 	neon.exe!ExpressionAnalyzer::visit(const pt::FunctionCallExpression * p) Line 306	C++
 	neon.exe!pt::FunctionCallExpression::accept(pt::IParseTreeVisitor * visitor) Line 452	C++
 	neon.exe!Analyzer::analyze(const pt::Expression * expr) Line 2232	C++
 	neon.exe!Analyzer::analyze_function_call(const pt::FunctionCallExpression * expr, const ast::TypeFunction * ftype, const ast::Expression * self, const ast::Expression * dispatch, const std::vector > & initial_args, const ast::Expression * func, bool allow_ignore_result) Line 3038	C++
 	neon.exe!Analyzer::analyze(const pt::FunctionCallExpression * expr) Line 3298	C++
 	neon.exe!ExpressionAnalyzer::visit(const pt::FunctionCallExpression * p) Line 306	C++
 	neon.exe!pt::FunctionCallExpression::accept(pt::IParseTreeVisitor * visitor) Line 452	C++
 	neon.exe!Analyzer::analyze(const pt::Expression * expr) Line 2232	C++
 	neon.exe!Analyzer::analyze(const pt::ExpressionStatement * statement) Line 6106	C++
 	neon.exe!StatementAnalyzer::visit(const pt::ExpressionStatement * p) Line 548	C++
 	neon.exe!pt::ExpressionStatement::accept(pt::IParseTreeVisitor * visitor) Line 910	C++
 	neon.exe!Analyzer::analyze(const std::vector >,std::allocator > > > & statement) Line 4918	C++
 	neon.exe!Analyzer::analyze() Line 7078	C++
 	neon.exe!analyze(ICompilerSupport * support, const pt::Program * program, std::map,std::allocator >,ast::ExternalGlobalInfo,std::less,std::allocator > >,std::allocator,std::allocator > const ,ast::ExternalGlobalInfo> > > * external_globals) Line 7597	C++
 	neon.exe!Repl::handle(const std::basic_string,std::allocator > & s) Line 91	C++
 	neon.exe!repl(int argc, char * * argv, const ExecOptions & options) Line 80	C++
 	neon.exe!main(int argc, char * * argv) Line 154	C++
 	[External Code]	

Note: This happens in both a release and a debug build.

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

No branches or pull requests

1 participant