SQL Server Bug: Extended stored procedure has been running waiting type preemptive_os_getprocaddress

Source: Internet
Author: User


Today, using Xp_readerrorlog for the first time in a new server to query a deadlock information, the results have been running, even if kill has been running:

(Run in 2 server instances, one of which has been kill)

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


And the following execution is normal, and the results come out quickly:

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



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

SQL Server: microsoft SQL Server (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



When the session was found to be executing, the CPU was constantly increasing and running.



Found an article: Why does preemptive_os_getprocaddress Show a Large accumulation?


A bug in SQL Server 2008 is that executing an extended stored procedure causes type preemptive_os_getprocaddress to accumulate time continuously.


Calculate the approximate time of the extended stored procedure execution as described above:

DECLARE @WaitTime bigintselect @WaitTime = Wait_time_ms from sys.dm_os_wait_stats where wait_type = ' msql_xp ' select @WaitT Ime-wait_time_ms from sys.dm_os_wait_stats where wait_type = ' preemptive_os_getprocaddress '

The results of 2 instances are also less than 300 milliseconds. Also, the wait type preemptive_os_getprocaddress is not currently incremented.

SELECT * from sys.dm_os_wait_stats where wait_type= ' preemptive_os_getprocaddress '



No increase, two possible outcomes:

1. Extended stored procedures executed;

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


The following executes a batch of queries, found that the session is running, task, thread, work is running the same object.

SELECT * FROM sys.dm_exec_sessions where Session_id=55select * from Sys.dm_exec_connections where Session_id=55select * fr Om 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 or not? Is it still running? How do I undo it? Do you want to restart the SQL Server service to resolve it?

(The current state is still the same as the diagram above, but the time and CPU are increasing.) Still looking for the answer! ~






SQL Server Bug: Extended stored procedure has been running waiting type preemptive_os_getprocaddress

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.