SQL Prompt 5.3.4.1 Crashing SSMS on CTRL-K, CTRL-Y
blitzd
Posts: 40
Starting this morning SQL Prompt has started crashing every time I use the CTRL-K, CTRL-Y key combinations. When I debug this is what I see:
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
Source=RedGate.SqlPrompt.Engine
StackTrace:
at RedGate.SqlPrompt.Format.Layout.BackgroundDelegate.()
at RedGate.SqlPrompt.Format.Layout.BackgroundDelegate.()
at RedGate.SqlPrompt.Format.Refactoring.()
at RedGate.SqlPrompt.Format.Refactoring.()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
SSMS then closes.
I'm using the RTM version of SSMS 2012, and this feature had worked with it up until today. When the issue started occurring I did check for an update to SQL Prompt, and there was one - which I installed, but the issue persists.
System.NullReferenceException was unhandled
Message=Object reference not set to an instance of an object.
Source=RedGate.SqlPrompt.Engine
StackTrace:
at RedGate.SqlPrompt.Format.Layout.BackgroundDelegate.()
at RedGate.SqlPrompt.Format.Layout.BackgroundDelegate.()
at RedGate.SqlPrompt.Format.Refactoring.()
at RedGate.SqlPrompt.Format.Refactoring.()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
SSMS then closes.
I'm using the RTM version of SSMS 2012, and this feature had worked with it up until today. When the issue started occurring I did check for an update to SQL Prompt, and there was one - which I installed, but the issue persists.
Comments
If I make any other modifications to non-RedGate buttons, they persist just fine.
I'm doing a repair of the shared features install for SQL 2012 to see if this resolves the issue.
If anyone from RedGate has some insight into this, it would be great to hear from you.
The RedGate and SQL Search toolbars comes back every time I re-start SSMS, despite being unchecked in customize toolbar options, or even deleted. They don't remember the position they were placed in, and often times the buttons that show up on either one appear to be random. Sometimes the RedGate toolbare has SQL Search on it, sometimes it doesn't. Sometimes the SQL Search toolbare has SQL Source Control and SQL Test on it, sometimes it doesn't. The most annoying aspect of this particular issue though, is that I do NOT want the toolbar in it's default place - I use that space for the SQL Editor toolbar.
What is more than an annoyance though, is the crashing - it's causing me to lose productivity. I've been using SQL Prompt for so long now that it's not even a conscious thought to reformat anymore. I hit that key combination at the end of typing any statement reflexively - and now it's causing crashes and lost work.
Could you also take a look at the log file? This can be found in SQL Prompt 5 > Help > Show log
With regards to the problem with the toolbar, I think this is a known issue. I'll just confirm that and let you know if/when it's going to be fixed.
The log file shows only INFO messages when this crash occurs.
I believe I have identified the exact problem that causes the crash, it's when I go to format a statement like the below one:
The script I'm editing will be run in an SSIS Execute SQL Task, and the ? is how the parameters are passed to it. It does show in the editor as 'Incorrect Syntax' - but I wouldn't think that trying to format it should crash SSMS entirely.
I can confirm that if you supply ? as a value for a parameter, the 'Format SQL' causes SSMS to crash.
I've logged bug SP-4489 for our developers to take a look at.
Thanks for finding the cause of the problem for us.