SqlServer Bug: the extended stored procedure has been running and the waiting type PREEMPTIVE_ OS _GETPROCADDRESS appears, sqlserver

Source: Internet
Author: User

SqlServer Bug: the extended stored procedure has been running and the waiting type PREEMPTIVE_ OS _GETPROCADDRESS appears, sqlserver


Today, xp_readerrorlog is used to query a deadlock information on the new server for the first time, and the result is always running, even if the kill is still running:

(Run in two server instances, one of which has been killed)

exec xp_readerrorlog 0,1,NULL,NULL,'2015-01-07 22:13:10','2015-01-07 22:13:11','ASC'


The following execution is normal and the result is coming soon:

exec xp_readerrorlog 0,1,'deadlock victim',NULL,'2015-04-01','2015-04-10','desc'



Operating System:Microsoft Windows Server 2008 R2 Enterprise (64) Service Pack 1

SqlServer:Microsoft SQL Server 2008 (RTM) Microsoft Corporation Enterprise Edition (64-bit) (Build 7601: Service Pack 1)


select p.spid,p.waittime,p.lastwaittype,p.cpu,p.open_tran,p.status,p.cmd,s.text from master.dbo.sysprocesses p cross apply sys.dm_exec_sql_text(p.sql_handle) swhere spid=55--where spid=374 --haved killed



The CPU usage of this session has been increasing and running continuously.



Find an article: Why does PREEMPTIVE_ OS _GETPROCADDRESS Show a Large Accumulation?


This is a bug in SQL Server 2008. It is caused by the execution of the extended storage process, which leads to the continuous accumulation of the type PREEMPTIVE_ OS _GETPROCADDRESS.


As mentioned above, calculate the approximate execution time of the extended stored procedure:

declare @WaitTime bigintselect @WaitTime = wait_time_ms from sys.dm_os_wait_stats where wait_type = 'MSQL_XP'select @WaitTime - wait_time_ms from sys.dm_os_wait_stats where wait_type = 'PREEMPTIVE_OS_GETPROCADDRESS'

The results of the two instances are less than 300 milliseconds. Besides, the waiting type PREEMPTIVE_ OS _GETPROCADDRESS is not added currently.

select * from sys.dm_os_wait_stats where wait_type='PREEMPTIVE_OS_GETPROCADDRESS'



No increase. There are two possible results:

1. The extended storage process is complete;

2. The extended stored procedure is still being executed (because the data is not calculated to DMV when the execution is in progress)


A batch of queries are executed below, and it is found that the session is all running, and tasks, threads, and work are all running the same object.

select * from sys.dm_exec_sessions where session_id=55select * from sys.dm_exec_connections where session_id=55select * from sys.dm_exec_requests where session_id=55select * from sys.dm_os_tasks where task_address=0x00000000005DD948 and session_id=55select * from sys.dm_os_workers where worker_address=0x00000008B58FC1A0select * from sys.dm_os_threads where thread_address=0x000007FFFFF594A8


Is it a bug? Is it still running? How to revoke it? Do I have to restart the SQL Server service to solve this problem?

(The current status is still the same as the figure above, but the time and CPU are constantly increasing. Still searching for answers !~)






Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.