Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
lbreddemann
Active Contributor
0 Kudos

A few months ago, I described how to set up and configure the Windows Debugger in order to be able to generate a call stack for a hanging MaxDB thread.

As this was technically interesting (at least I hope so), it is by far not the simplest way to get a call stack for a hanging task.
Moreover, due to the internal tasking model of MaxDB you cannot specifically point to a usertask (that is the session of a user) and debug it.
All you can do is to get the call stack of a currently running thread and look up what task it ran at this time later on.

An easier and much more comfortable way to do that is the following x_cons command:

x_cons <DBSID> debugtask <Task-ID>

This command triggers the MaxDB Kernel to write out the current call stack for task <Task-ID> to the knldiag file.

So let us give it a try! I used my 7.5 Build 48 test database on windows and provoked a LOG FULL situation by using a statement like this:

create table test as select 'xxx', 'zzz', 0 from tables t1, tables t2

As soon as the database got in LOG FULL I used x_cons to figure out the task id of the hanging task:

x_cons db750 show active user   (ok I used the short form...)

C:\\WINDOWS>x_cons db750 sh ta us
SERVERDB: DB750
ID   UKT  Win   TASK       APPL Current         Timeout Region     Wait
\
          tid   type        pid state          priority cnt try    item
\
T15    6  0xDEC User       3516 LOG FULL (246)        0 0               303(s)

So task 15 is the one we are looking for.
To get the call stack now, all I had to do is to issue this command:

x_cons db750 debugtask T15

That is it.

In the knldiag file, there is now the complete call stack as if it would be there when the database crashes. It looks like this (for readability, I omitted the timestamp entries):

[...]
0xF24     20001 Log      Log is full.
0xDEC WRN 20054 Log      LOG FULL: task 15 suspended
0xF24     20001 Log      Log is full.
0xDEC ERR 18891 CALLSTCK Dumping callstack of T15
0xF40 ERR 19999 BTRACE   Using 'imagehlp.dll' version: 4.0.5
0xF40 ERR 19999 BTRACE   SymbolSearchPath:  c:\\sapdb\\data\\wrk\\DB750;C:\\SAPDB\\DB750\\DB\\pgm;C:\\SAPDB\\DB750\\DB\\symbols;C:\\SAPDB\\DB750\\DB\\sap;C:
0xF40 ERR 19999 BTRACE                      \\WINDOWS;C:\\SAPDB\\DB750\\DB\\sap\\
0xF40 ERR 19999 BTRACE   ----> Register Dump <----
0xF40 ERR 19999 BTRACE     Eax=0x009a0e20 Ebx=0x00000000 Ecx=0x02ae0d7c Edx=0x00000158 Esi=0x000001ac Edi=0x00000000
0xF40 ERR 19999 BTRACE     Eip=0x7c90eb94 Esp=0x02ae0d24 Ebp=0x02ae0d88
0xF40 ERR 19999 BTRACE     Cs=0x001b  Ss=0x0023  Ds=0x0023  Es=0x0023  Fs=0x003b  Gs=0x0000  Efl=0x0246
0xF40 ERR 19999 BTRACE   ----> Module List <----
0xF40 ERR 19999 BTRACE   |.text Start |.text End   | Module File Name
0xF40 ERR 19999 BTRACE   | 0x00400000 | 0x009d5000 | C:\\SAPDB\\DB750\\DB\\pgm\\kernel.exe
0xF40 ERR 19999 BTRACE   | 0x038b0000 | 0x03904000 | C:\\WINDOWS\\system32\\MSVCR70.dll
0xF40 ERR 19999 BTRACE   | 0x03920000 | 0x03a20000 | C:\\SAPDB\\DB750\\DB\\pgm\\dbghelp.dll
0xF40 ERR 19999 BTRACE   | 0x5d090000 | 0x5d12a000 | C:\\WINDOWS\\system32\\comctl32.dll
0xF40 ERR 19999 BTRACE   | 0x629c0000 | 0x629c9000 | C:\\WINDOWS\\system32\\LPK.DLL
0xF40 ERR 19999 BTRACE   | 0x71aa0000 | 0x71aa8000 | C:\\WINDOWS\\system32\\WS2HELP.dll
0xF40 ERR 19999 BTRACE   | 0x71ab0000 | 0x71ac7000 | C:\\WINDOWS\\system32\\WS2_32.dll
0xF40 ERR 19999 BTRACE   | 0x74d90000 | 0x74dfb000 | C:\\WINDOWS\\system32\\USP10.dll
0xF40 ERR 19999 BTRACE   | 0x76000000 | 0x7600d000 | C:\\sapdb\\programs\\pgm\\sqltcp1.dll
0xF40 ERR 19999 BTRACE   | 0x76050000 | 0x760c5000 | C:\\SAPDB\\DB750\\DB\\pgm\\liboms.dll
0xF40 ERR 19999 BTRACE   | 0x76390000 | 0x763ad000 | C:\\WINDOWS\\system32\\IMM32.DLL
0xF40 ERR 19999 BTRACE   | 0x76c90000 | 0x76cb8000 | C:\\WINDOWS\\system32\\imagehlp.dll
0xF40 ERR 19999 BTRACE   | 0x76f20000 | 0x76f47000 | C:\\WINDOWS\\system32\\DNSAPI.dll
0xF40 ERR 19999 BTRACE   | 0x76fc0000 | 0x76fc6000 | C:\\WINDOWS\\system32\\rasadhlp.dll
0xF40 ERR 19999 BTRACE   | 0x773d0000 | 0x774d3000 | C:\\WINDOWS\\WinSxS\\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_
0xF40 ERR 19999 BTRACE   :            :            : x-ww_ac3f9c03\\comctl32.dll
0xF40 ERR 19999 BTRACE   | 0x774e0000 | 0x7761d000 | C:\\WINDOWS\\system32\\ole32.dll
0xF40 ERR 19999 BTRACE   | 0x77c10000 | 0x77c68000 | C:\\WINDOWS\\system32\\msvcrt.dll
0xF40 ERR 19999 BTRACE   | 0x77dd0000 | 0x77e6b000 | C:\\WINDOWS\\system32\\ADVAPI32.dll
0xF40 ERR 19999 BTRACE   | 0x77e70000 | 0x77f02000 | C:\\WINDOWS\\system32\\RPCRT4.dll
0xF40 ERR 19999 BTRACE   | 0x77f10000 | 0x77f57000 | C:\\WINDOWS\\system32\\GDI32.dll
0xF40 ERR 19999 BTRACE   | 0x77f60000 | 0x77fd6000 | C:\\WINDOWS\\system32\\SHLWAPI.dll
0xF40 ERR 19999 BTRACE   | 0x77fe0000 | 0x77ff1000 | C:\\WINDOWS\\system32\\Secur32.dll
0xF40 ERR 19999 BTRACE   | 0x7c800000 | 0x7c8f5000 | C:\\WINDOWS\\system32\\kernel32.dll
0xF40 ERR 19999 BTRACE   | 0x7c900000 | 0x7c9b0000 | C:\\WINDOWS\\system32\\ntdll.dll
0xF40 ERR 19999 BTRACE   | 0x7c9c0000 | 0x7d1d6000 | C:\\WINDOWS\\system32\\SHELL32.dll
0xF40 ERR 19999 BTRACE   | 0x7e410000 | 0x7e4a0000 | C:\\WINDOWS\\system32\\USER32.dll
0xF40 ERR 19999 BTRACE   ----> Stack Back Trace <----
0xF40 ERR 19999 BTRACE     ntdll!KiFastSystemCallRet
0xF40 ERR 19999 BTRACE         SFrame:  IP:7c90eb94 RA:7c802532 FP:02ae0d88 SP:02ae0d24
0xF40 ERR 19999 BTRACE         Params:  01:000001ac 02:ffffffff 03:00000000 04:02ae0dc8
0xF40 ERR 19999 BTRACE     kernel32!WaitForSingleObject + 18 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:7c802532 RA:007b092d FP:02ae0d9c SP:02ae0d24
0xF40 ERR 19999 BTRACE         Params:  01:000001ac 02:ffffffff 03:00000000 04:00000000
0xF40 ERR 19999 BTRACE     kernel!eo670_WindowsTraceStack + 285 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:007b092d RA:007b0af9 FP:02ae0dc8 SP:02ae0dd0
0xF40 ERR 19999 BTRACE         Params:  01:00000000 02:00000000 03:7c800000 04:00000000
0xF40 ERR 19999 BTRACE         Source:  veo670-k.c ( Line: 7641 )
0xF40 ERR 19999 BTRACE     kernel!eo670_CTraceStackOCB + 73 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:007b0af9 RA:007b0be2 FP:02ae0de4 SP:02ae0dec
0xF40 ERR 19999 BTRACE         Params:  01:00000000 02:00000000 03:007d0258 04:00000005
0xF40 ERR 19999 BTRACE         Source:  veo670-k.c ( Line: 1086 )
0xF40 ERR 19999 BTRACE     kernel!eo670_CTraceStack + 18 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:007b0be2 RA:007d0258 FP:02ae0df0 SP:02ae0df8
0xF40 ERR 19999 BTRACE         Params:  01:00000005 02:7ff15dc0 03:7c910340 04:02ae0e20
0xF40 ERR 19999 BTRACE         Source:  veo670-k.c ( Line: 1048 )
0xF40 ERR 19999 BTRACE     kernel!sql74k_on_task_debug_request + 136 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:007d0258 RA:007a61c9 FP:02ae0e04 SP:02ae0e0c
0xF40 ERR 19999 BTRACE         Params:  01:02ae0e28 02:0000000f 03:00822a2c 04:ffffffff
0xF40 ERR 19999 BTRACE         Source:  vos74k.c ( Line: 439 )
0xF40 ERR 19999 BTRACE     kernel!vsuspend + 329 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:007a61c9 RA:0072897c FP:02ae0e20 SP:02ae0e28
0xF40 ERR 19999 BTRACE         Params:  01:7fec0e88 02:000000f6 03:02b07a60 04:7ef8e778
0xF40 ERR 19999 BTRACE         Source:  vos56k.c ( Line: 220 )
0xF40 ERR 19999 BTRACE     kernel!Log_Queue::WaitUntilSpaceIsAvailable + 828 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0072897c RA:006e35c8 FP:02ae0fdc SP:02ae0fe4
0xF40 ERR 19999 BTRACE         Params:  01:0000000f 02:02b07a60 03:00000001 04:7f0b6934
0xF40 ERR 19999 BTRACE         Source:  log_queue.cpp ( Line: 345 )
0xF40 ERR 19999 BTRACE     kernel!Log_Queue::Reserve + 40 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:006e35c8 RA:0071ad10 FP:02ae0ffc SP:02ae1004
0xF40 ERR 19999 BTRACE         Params:  01:0000000f 02:02b07a60 03:0000005c 04:00000030
0xF40 ERR 19999 BTRACE         Source:  log_queue.hpp ( Line: 195 )
0xF40 ERR 19999 BTRACE     kernel!Log_Transaction::WriteRedoEntry + 1472 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0071ad10 RA:00703ee0 FP:02ae1194 SP:02ae119c
0xF40 ERR 19999 BTRACE         Params:  01:02ae11ac 02:7f0b6934 03:02b06c30 04:00000000
0xF40 ERR 19999 BTRACE         Source:  log_transaction.cpp ( Line: 1770 )
0xF40 ERR 19999 BTRACE     kernel!Log_ReadWriteActionImage::WriteAfterImage + 128 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00703ee0 RA:00668225 FP:02ae11e8 SP:02ae11f0
0xF40 ERR 19999 BTRACE         Params:  01:02b079fc 02:02ae1214 03:0065e6f6 04:7f0b68b0
0xF40 ERR 19999 BTRACE         Source:  log_readwriteactionimage.cpp ( Line: 221 )
0xF40 ERR 19999 BTRACE     kernel!kb611ins_WriteAfterImage + 21 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00668225 RA:0065e6f6 FP:02ae11f4 SP:02ae11fc
0xF40 ERR 19999 BTRACE         Params:  01:7f0b68b0 02:02b079fc 03:02b06c30 04:02b06c30
0xF40 ERR 19999 BTRACE         Source:  vkb611.cpp ( Line: 125 )
0xF40 ERR 19999 BTRACE     kernel!kb61insert_rec + 246 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0065e6f6 RA:0065f0cf FP:02ae1214 SP:02ae121c
0xF40 ERR 19999 BTRACE         Params:  01:02b06c30 02:02ae1234 03:02aea1e8 04:00000002
0xF40 ERR 19999 BTRACE         Source:  vkb61.c ( Line: 2639 )
0xF40 ERR 19999 BTRACE     kernel!k61ins_select + 303 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0065f0cf RA:00636235 FP:02ae1640 SP:02ae1648
0xF40 ERR 19999 BTRACE         Params:  01:02b06c30 02:02aea1e8 03:00000001 04:00000000
0xF40 ERR 19999 BTRACE         Source:  vkb61.c ( Line: 2147 )
0xF40 ERR 19999 BTRACE     kernel!kb721result_handle + 597 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00636235 RA:006375c6 FP:02ae1670 SP:02ae1678
0xF40 ERR 19999 BTRACE         Params:  01:02b06c30 02:02ae21e8 03:02aed364 04:02ae1788
0xF40 ERR 19999 BTRACE         Source:  vkb721.c ( Line: 3404 )
0xF40 ERR 19999 BTRACE     kernel!kb721select_gets + 342 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:006375c6 RA:00637836 FP:02ae1700 SP:02ae1708
0xF40 ERR 19999 BTRACE         Params:  01:02b06c30 02:02aec700 03:02aed364 04:00000000
0xF40 ERR 19999 BTRACE         Source:  vkb721.c ( Line: 2713 )
0xF40 ERR 19999 BTRACE     kernel!kb721seq_search + 614 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00637836 RA:006382d2 FP:02ae1738 SP:02ae1740
0xF40 ERR 19999 BTRACE         Params:  01:02b06c30 02:02aed364 03:02ae21e8 04:02ae1788
0xF40 ERR 19999 BTRACE         Source:  vkb721.c ( Line: 2806 )
0xF40 ERR 19999 BTRACE     kernel!k721strat_distribution + 370 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:006382d2 RA:00633f82 FP:02ae175c SP:02ae1764
0xF40 ERR 19999 BTRACE         Params:  01:02b06c30 02:02aed364 03:02ae21e8 04:02ae1788
0xF40 ERR 19999 BTRACE         Source:  vkb721.c ( Line: 4308 )
0xF40 ERR 19999 BTRACE     kernel!k720_select + 866 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00633f82 RA:00634154 FP:02ae21d4 SP:02ae21dc
0xF40 ERR 19999 BTRACE         Params:  01:01b06c30 02:02aed364 03:02ae21e8 04:00000000
0xF40 ERR 19999 BTRACE         Source:  vkb720.c ( Line: 2390 )
0xF40 ERR 19999 BTRACE     kernel!k720_single_select + 36 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00634154 RA:0065e074 FP:02af13a4 SP:02af13ac
0xF40 ERR 19999 BTRACE         Params:  01:02b06c30 02:02b06c30 03:02af148c 04:00626e1a
0xF40 ERR 19999 BTRACE         Source:  vkb720.c ( Line: 3461 )
0xF40 ERR 19999 BTRACE     kernel!k61table_ins_del_upd + 52 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0065e074 RA:00626e1a FP:02af13b4 SP:02af13bc
0xF40 ERR 19999 BTRACE         Params:  01:02b06c30 02:02b079fc 03:02b06a44 04:02af19f0
0xF40 ERR 19999 BTRACE         Source:  vkb61.c ( Line: 2303 )
0xF40 ERR 19999 BTRACE     kernel!k05functions + 1450 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00626e1a RA:0046c905 FP:02af148c SP:02af1494
0xF40 ERR 19999 BTRACE         Params:  01:24b06c30 02:02b06c30 03:02b06a44 04:02af19f0
0xF40 ERR 19999 BTRACE         Source:  vkb05.c ( Line: 2089 )
0xF40 ERR 19999 BTRACE     kernel!a06lsend_mess_buf + 821 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0046c905 RA:0046d49a FP:02af18c8 SP:02af18d0
0xF40 ERR 19999 BTRACE         Params:  01:02b06a44 02:24b06c30 03:00000000 04:02af19f0
0xF40 ERR 19999 BTRACE         Source:  vak06.c ( Line: 7640 )
0xF40 ERR 19999 BTRACE     kernel!a06dml_send_mess_buf + 58 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0046d49a RA:00584a5b FP:02af18ec SP:02af18f4
0xF40 ERR 19999 BTRACE         Params:  01:02b06a44 02:02b06c30 03:02af433c 04:02af19f0
0xF40 ERR 19999 BTRACE         Source:  vak06.c ( Line: 7241 )
0xF40 ERR 19999 BTRACE     kernel!a505most_execute + 2731 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00584a5b RA:0058540b FP:02af19f8 SP:02af1a00
0xF40 ERR 19999 BTRACE         Params:  01:00b06a44 02:02af433c 03:02af3318 04:02af27e0
0xF40 ERR 19999 BTRACE         Source:  vak505.c ( Line: 6362 )
0xF40 ERR 19999 BTRACE     kernel!a505loop_most_execute + 811 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0058540b RA:00569f7b FP:02af1bd0 SP:02af1bd8
0xF40 ERR 19999 BTRACE         Params:  01:02b06a44 02:02af433c 03:02af3318 04:02af269c
0xF40 ERR 19999 BTRACE         Source:  vak505.c ( Line: 5892 )
0xF40 ERR 19999 BTRACE     kernel!a501exec_with_change_rec + 875 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00569f7b RA:00567e72 FP:02af26dc SP:02af26e4
0xF40 ERR 19999 BTRACE         Params:  01:02b06a44 02:02af433c 03:02af27e0 04:02af3318
0xF40 ERR 19999 BTRACE         Source:  vak501.c ( Line: 5344 )
0xF40 ERR 19999 BTRACE     kernel!a502complex_execution + 786 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00567e72 RA:00569e71 FP:02af27f8 SP:02af2800
0xF40 ERR 19999 BTRACE         Params:  01:00b06a44 02:02af433c 03:02af3318 04:02b05eb4
0xF40 ERR 19999 BTRACE         Source:  vak502.c ( Line: 5321 )
0xF40 ERR 19999 BTRACE     kernel!a501exec_with_change_rec + 609 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00569e71 RA:0056a252 FP:02af32f4 SP:02af32fc
0xF40 ERR 19999 BTRACE         Params:  01:02b06a44 02:02af433c 03:02b05eb4 04:02af3318
0xF40 ERR 19999 BTRACE         Source:  vak501.c ( Line: 5304 )
0xF40 ERR 19999 BTRACE     kernel!a501do_execute + 82 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0056a252 RA:0057b594 FP:02af431c SP:02af4324
0xF40 ERR 19999 BTRACE         Params:  01:02b06a44 02:02af433c 03:02b05eb4 04:00000000
0xF40 ERR 19999 BTRACE         Source:  vak501.c ( Line: 5395 )
0xF40 ERR 19999 BTRACE     kernel!a562_select_insert + 388 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0057b594 RA:004c80b9 FP:02b05ec8 SP:02b05ed0
0xF40 ERR 19999 BTRACE         Params:  01:02b06a44 02:00000000 03:02b06f88 04:02b06a44
0xF40 ERR 19999 BTRACE         Source:  vak562.c ( Line: 7157 )
0xF40 ERR 19999 BTRACE     kernel!ak35call_semantik + 873 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:004c80b9 RA:004c8aca FP:02b05f18 SP:02b05f20
0xF40 ERR 19999 BTRACE         Params:  01:00b06a44 02:02b072e2 03:00000000 04:02b06a44
0xF40 ERR 19999 BTRACE         Source:  vak35.c ( Line: 5650 )
0xF40 ERR 19999 BTRACE     kernel!a35_asql_statement + 1674 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:004c8aca RA:00587fc6 FP:02b05f6c SP:02b05f74
0xF40 ERR 19999 BTRACE         Params:  01:00b06a44 02:00000000 03:02b072e2 04:02b06a44
0xF40 ERR 19999 BTRACE         Source:  vak35.c ( Line: 5247 )
0xF40 ERR 19999 BTRACE     kernel!ak92not_only_execute + 1574 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00587fc6 RA:00589ae1 FP:02b060d0 SP:02b060d8
0xF40 ERR 19999 BTRACE         Params:  01:00b06a44 02:02b06220 03:02b0623a 04:02b061f8
0xF40 ERR 19999 BTRACE         Source:  vak92.c ( Line: 5309 )
0xF40 ERR 19999 BTRACE     kernel!ak92analyze_messagetype + 1361 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00589ae1 RA:00589e17 FP:02b0622c SP:02b06234
0xF40 ERR 19999 BTRACE         Params:  01:02b06a44 02:00000000 03:00000000 04:00000000
0xF40 ERR 19999 BTRACE         Source:  vak92.c ( Line: 5727 )
0xF40 ERR 19999 BTRACE     kernel!a92_mode_analyzer + 279 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00589e17 RA:0047c034 FP:02b0630c SP:02b06314
0xF40 ERR 19999 BTRACE         Params:  01:02b06a44 02:00000000 03:00000000 04:02b06a44
0xF40 ERR 19999 BTRACE         Source:  vak92.c ( Line: 6401 )
0xF40 ERR 19999 BTRACE     kernel!ak14insert_select + 228 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0047c034 RA:0047d5b0 FP:02b06348 SP:02b06350
0xF40 ERR 19999 BTRACE         Params:  01:02b06a44 02:02b06458 03:00000002 04:0000002b
0xF40 ERR 19999 BTRACE         Source:  vak14.c ( Line: 5307 )
0xF40 ERR 19999 BTRACE     kernel!a14create_tab_as_select + 592 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0047d5b0 RA:0058f39f FP:02b0647c SP:02b06484
0xF40 ERR 19999 BTRACE         Params:  01:02b06a44 02:02b06568 03:00020000 04:00000011
0xF40 ERR 19999 BTRACE         Source:  vak14.c ( Line: 5038 )
0xF40 ERR 19999 BTRACE     kernel!ak93one_command + 1567 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:0058f39f RA:00590516 FP:02b0658c SP:02b06594
0xF40 ERR 19999 BTRACE         Params:  01:01b06a44 02:00000001 03:02b065f0 04:00000001
0xF40 ERR 19999 BTRACE         Source:  vak93.c ( Line: 6525 )
0xF40 ERR 19999 BTRACE     kernel!a93_user_commands + 1046 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00590516 RA:004487d6 FP:02b06604 SP:02b0660c
0xF40 ERR 19999 BTRACE         Params:  01:00b06a44 02:02b06a3b 03:02b06a2f 04:02b07f6c
0xF40 ERR 19999 BTRACE         Source:  vak93.c ( Line: 5603 )
0xF40 ERR 19999 BTRACE     kernel!ak91run_sql_process + 134 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:004487d6 RA:004488f2 FP:02b06a30 SP:02b06a38
0xF40 ERR 19999 BTRACE         Params:  01:01b06a44 02:00000001 03:00000001 04:7ef9252c
0xF40 ERR 19999 BTRACE         Source:  vak91.c ( Line: 5406 )
0xF40 ERR 19999 BTRACE     kernel!ak91run_user_process + 98 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:004488f2 RA:00448989 FP:02b07ee4 SP:02b07eec
0xF40 ERR 19999 BTRACE         Params:  01:02b07f6c 02:00000003 03:7ff70818 04:02b07f54
0xF40 ERR 19999 BTRACE         Source:  vak91.c ( Line: 5434 )
0xF40 ERR 19999 BTRACE     kernel!a91mainprogam_with_allocator + 57 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00448989 RA:006d675f FP:02b07ef8 SP:02b07f00
0xF40 ERR 19999 BTRACE         Params:  01:03b07f6c 02:7c910340 03:7fec0e88 04:7c910331
0xF40 ERR 19999 BTRACE         Source:  vak91.c ( Line: 5459 )
0xF40 ERR 19999 BTRACE     kernel!gg941CreateAllocatorAndCallMainprog + 223 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:006d675f RA:00448923 FP:02b07f54 SP:02b07f5c
0xF40 ERR 19999 BTRACE         Params:  01:02b07f03 02:02b07fb4 03:00000014 04:02b07f6c
0xF40 ERR 19999 BTRACE         Source:  vgg941.cpp ( Line: 156 )
0xF40 ERR 19999 BTRACE     kernel!a91mainprogram + 35 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:00448923 RA:007d3054 FP:02b07fe0 SP:02b07fe8
0xF40 ERR 19999 BTRACE         Params:  01:7fec0e88 02:007d3854 03:00000000 04:00000000
0xF40 ERR 19999 BTRACE         Source:  vak91.c ( Line: 5446 )
0xF40 ERR 19999 BTRACE     kernel!sql88k_kernel_task + 148 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:007d3054 RA:007d3854 FP:02b07fe8 SP:02b07ff0
0xF40 ERR 19999 BTRACE         Params:  01:00000000 02:00000000 03:00000000 04:00000000
0xF40 ERR 19999 BTRACE         Source:  vos88k.c ( Line: 416 )
0xF40 ERR 19999 BTRACE     kernel!sql88k_ukt + 1140 bytes
0xF40 ERR 19999 BTRACE         SFrame:  IP:007d3854 RA:00000000 FP:02b07ff0 SP:02b07ff0
0xF40 ERR 19999 BTRACE         Params:  01:00000000 02:00000000 03:00000000 04:00000000
0xF40 ERR 19999 BTRACE         Source:  vos88k.c ( Line: 277 )
------------------- current write position ----------------    

As you can see, it is pretty much the same content as you get from the windows debugger.
The call stack is again written top-down, putting the last executed calls in the first rows of the output. As we see the call stack routine was the last 'thing' the task ran through - not too surprising.
Anyhow, when we browse a bit further below, we find
kernel!Log_Queue::WaitUntilSpaceIsAvailable
so we can tell what the task is currently doing when it is not writing call stacks.
For a more elaborate discussion of a call stack visit my first blog entry on this topic (see link above).

By the way: very often in customer messages people (people and collegues as well) try to give valueable information by attaching parts of this call stack to the message. Unfortunately most people seem to believe, that the "----> Module List <----" and "----> Register Dump <----" are the most critical information and forget to attach the "----> Stack Back Trace <----" as well.
In fact it's the exact opposite.While the stack back trace is somwhat intelligible to supporters, the module list and the register dump contain information that only a few developers can make sense of.

As far as I have tested, this call works for MaxDBs from version 7.4.3 onwards.
As the debugtask command is not documented, it is an unsupported function and should not be used on productive systems unless advised by the SAP support.
Nevertheless, it may be sometime interesting to look at the call stack for educational purposes.

Best regards,
Lars