Subject Re: [firebird-support] Re: Terminate Long Running Transaction
Author Vlad Horsun
> Tried Classic Server Architecture as well and ended up with maxed out
> CPU. Here is the trace from that:

This is _both_ traces.

I skipped first trace. Here where second trace begins


> Application exception occurred:
> App: C:\Program Files\Firebird\bin\fb_inet_server.exe
> (pid=2160)


> *----> State Dump for Thread Id 0xf90 <----*

This is worker thread. It is reads the data. Nothing unusual

> eax=00000004 ebx=00000004 ecx=00000000 edx=00000004 esi=00e525a5
> edi=00eee785
> eip=004e69c8 esp=0022eb8c ebp=00e525a1 iopl=0 nv up ei pl zr
> na po nc
> cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000
> efl=00000246
>
> *** WARNING: Unable to verify checksum for C:\Program
> Files\Firebird\bin\fb_inet_server.exe
> function: fb_inet_server!SQZ_decompress
> 004e69ae e83d23f3ff call fb_inet_server!ERR_bugcheck
> (00418cf0)
> 004e69b3 83c40c add esp,0xc
> 004e69b6 8bcb mov ecx,ebx
> 004e69b8 8bc1 mov eax,ecx
> 004e69ba c1e902 shr ecx,0x2
> 004e69bd 8bf5 mov esi,ebp
> 004e69bf f3a5 rep movsd
> 004e69c1 8bc8 mov ecx,eax
> 004e69c3 83e103 and ecx,0x3
> 004e69c6 f3a4 rep movsb
> 004e69c8 8b7c2418 mov edi,[esp+0x18]
> ss:0023:0022eba4=00eee785
> 004e69cc 03eb add ebp,ebx
> 004e69ce 3b6c2414 cmp ebp,[esp+0x14]
> 004e69d2 0f8258ffffff jb fb_inet_server!
> SQZ_decompress+0x20 (004e6930)
> 004e69d8 5e pop esi
> 004e69d9 5b pop ebx
> 004e69da 3b7c2418 cmp edi,[esp+0x18]
> 004e69de 7617 jbe fb_inet_server!
> SQZ_decompress+0xe7 (004e69f7)
> 004e69e0 68f2000000 push 0xf2
> 004e69e5 6850075a00 push 0x5a0750
> 004e69ea 68b3000000 push 0xb3
>
> *----> Stack Back Trace <----*
> *** ERROR: Symbol file could not be found. Defaulted to export
> symbols for C:\WINDOWS\system32\kernel32.dll -
> ChildEBP RetAddr Args to Child
> 0022eb98 0049f112 00e5261e 00eee785 00eee774 fb_inet_server!
> SQZ_decompress+0xb8 (FPO: [EBP 0x00d96ed8] [4,0,0]) (CONV: cdecl)
> 0022efd8 004a12f1 0022f1f4 00d96ed8 00e3359c fb_inet_server!
> VIO_data+0x112 (FPO: [EBP 0x00d96ca8] [3,263,0]) (CONV: cdecl)
> 0022eff4 004cc5bf 0022f1f4 00d96ed8 00d95fdc fb_inet_server!
> VIO_get+0x61 (FPO: [5,0,0]) (CONV: cdecl)
> 0022f028 004cc91b 00e32c58 00d95fdc 00d96524 fb_inet_server!
> get_record+0xef (FPO: [EBP 0x00d96ca8] [4,3,0]) (CONV: cdecl)
> 0022f058 004cc18d 0022f100 00d96524 00000000 fb_inet_server!
> get_record+0x44b (FPO: [EBP 0x00d96270] [4,3,0]) (CONV: cdecl)
> 0022f07c 004cc1b8 0022f1f4 00d96270 00000003 fb_inet_server!
> fetch_record+0x2d (FPO: [EBP 0x00d96270] [3,0,0]) (CONV: cdecl)
> 0022f09c 004ccac6 0022f1f4 00d96270 00000004 fb_inet_server!
> fetch_record+0x58 (FPO: [EBP 0x00d96ca8] [3,0,0]) (CONV: cdecl)
> 0022f0d0 004cd018 0022f1f4 00d96270 00000000 fb_inet_server!
> get_record+0x5f6 (FPO: [EBP 0x0022f1f4] [4,3,0]) (CONV: cdecl)
> 0022f0fc 0046955f 0022f1f4 00d96270 00000000 fb_inet_server!
> RSE_get_record+0x48 (FPO: [EBP 0x0022f184] [3,2,0]) (CONV: cdecl)
> 0022f184 0046712e 0022f1f4 00d96ca8 00e3ac78 fb_inet_server!
> looper+0x32f (CONV: cdecl)
> 0022f19c 00467a1e 00000005 009086f4 00d96ca8 fb_inet_server!
> execute_looper+0x5e (FPO: [EBP 0x0022f1cc] [1,0,0]) (CONV: cdecl)
> 0022f1cc 0041d7c8 0022f1f4 00d96ca8 00000001 fb_inet_server!
> EXE_receive+0x9e (CONV: cdecl)
> 0022f25c 0040f183 0022f410 00d96ca8 00000001 fb_inet_server!
> jrd8_receive+0xd8 (CONV: cdecl)
> 0022f2d4 004ec586 0022f410 00f0ec3c 00000001 fb_inet_server!
> isc_receive+0x73 (FPO: [6,20,0]) (CONV: stdcall)
> 0022f334 004ed793 0022f410 00907a08 0000000c fb_inet_server!
> GDS_DSQL_FETCH_CPP+0x216 (CONV: cdecl)
> 0022f350 0040e628 0022f410 00907a08 0000000c fb_inet_server!
> dsql8_fetch+0x23 (FPO: [7,0,0]) (CONV: cdecl)
> 0022f3cc 0055d891 0022f410 00906f6c 0000000c fb_inet_server!
> isc_dsql_fetch_m+0x78 (FPO: [7,20,0]) (CONV: stdcall)
> 0022f45c 0055ea02 0022f7c4 0022f80c 00000138 fb_inet_server!
> rem_port::fetch+0x171 (FPO: [EBP 0x0022f570] [2,24,0]) (CONV:
> thiscall)
> 0022f570 0055ecb5 0090ad60 0022f80c 0022f58c fb_inet_server!
> process_packet+0x442 (CONV: cdecl)
> 0022fa88 00551a81 0090ad60 00000008 0055206d fb_inet_server!
> SRVR_main+0x65 (FPO: [2,320,0]) (CONV: cdecl)
> 0022fa94 0055206d 77e66404 0024253b 00000000 fb_inet_server!
> service_connection+0x11 (FPO: [0,0,0]) (CONV: cdecl)
> 0022ff18 00548eb8 00400000 00000000 0024253b fb_inet_server!
> WinMain+0xfd (CONV: stdcall)
> 0022ffc0 77e523e5 00000000 00000000 7ffda000 fb_inet_server!
> WinMainCRTStartup+0x185 (CONV: cdecl)
> WARNING: Stack unwind information not available. Following frames may
> be wrong.
> 0022fff0 00000000 00548d33 00000000 78746341 kernel32!
> IsProcessorFeaturePresent+0x9e


> *----> State Dump for Thread Id 0x130 <----*

This is blocking_action_thread. It is waits signal from lock manager to
release some blocked resource. It is sleep now

> *----> Stack Back Trace <----*
> *** ERROR: Symbol file could not be found. Defaulted to export
> symbols for C:\Program Files\Firebird\bin\MSVCR71.dll -
> ChildEBP RetAddr Args to Child
> WARNING: Stack unwind information not available. Following frames may
> be wrong.
> 00cfff34 77e6ba42 0000070c ffffffff 00000000 ntdll!KiFastSystemCallRet
> 00cfff48 00547901 0000070c ffffffff 005478e0 kernel32!
> WaitForSingleObject+0x12
> 00cfff60 00404897 005e71b4 00000000 00604970 fb_inet_server!
> blocking_action_thread+0x21 (FPO: [1,0,0]) (CONV: stdcall)
> 00cfff84 7c349565 009ddd00 00000000 00000000 fb_inet_server!
> `anonymous namespace'::threadStart+0x47 (FPO: [1,4,0]) (CONV: stdcall)
> 00cfffb8 77e6608b 006048d8 00000000 00000000 MSVCR71!endthreadex+0xa0
> 00cfffec 00000000 7c3494f6 006048d8 00000000 kernel32!
> GetModuleFileNameA+0xeb


All i can say - you have some query which is or badly written or Firebird's
optimiser choosed really bad plan for it. Find and fix it. Good luck

Regards,
Vlad