Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I debug an EXCEPTION_ACCESS_VIOLATION on SQL Server 2008

An application that uses a database broke suddenly. I started to investigate and noticed that a simple count query

SELECT count(uberdataid) FROM [Alexander].[dbo].[UberData]

creates an error in SQL Server:

Msg 0, Level 11, State 0, Line 0 A severe error occurred on the current command. The results, if any, should be discard

A few thoughts:

  • When I check out the error's stack trace it says that there is an EXCEPTION_ACCESS_VIOLATION. The name of that exception makes me think that there might be a permissions issue in the query. But I get this exact same error on many different user accounts (which all were able to query the DB without issue before).

  • This discussion on SO ( Exception Access Violation in SQL) makes me think that the query might be hitting a lingering record lock, but I've rebooted the server so that seems unlikely.

There are also some other unresolved discussions on other message boards online.

Any ideas?

Stackoverflow won't let me post the whole trace (too long) but I am happy to post relevant parts if people need to see them. I don't know what parts from the trace are most important to post.

like image 690
bernie2436 Avatar asked Oct 17 '25 10:10

bernie2436


1 Answers

This looks like a SQL Server bug. EXCEPTION_ACCESS_VIOLATION means that code inside of SQL Server tried to access "invalid" memory (for example, dereferencing a NULL pointer). It has nothing to do with SQL Server security settings.

Even though this is likely to be a bug, I recommend that you run

DBCC CHECKDB WITH EXTENDED_LOGICAL_CHECKS, DATA_PURITY, NO_INFOMSGS

on the database in question. There might be corruption that is triggering a SQL Server bug.

like image 154
usr Avatar answered Oct 19 '25 01:10

usr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!