File tree Expand file tree Collapse file tree 4 files changed +355
-332
lines changed
tests/internal/crashtracker Expand file tree Collapse file tree 4 files changed +355
-332
lines changed Original file line number Diff line number Diff line change 773. Triggers a crash to test stack capture
88"""
99
10+ import ctypes
1011import os
1112import sys
12- import signal
1313import time
14- import ctypes
14+
1515
1616def nested_function_3 ():
1717 """Deepest function that will trigger a crash"""
1818 print ("In nested_function_3 - about to crash!" )
1919 # Trigger a segmentation fault
2020 ctypes .string_at (0 )
2121
22+
2223def nested_function_2 ():
2324 """Middle function"""
2425 print ("In nested_function_2" )
2526 nested_function_3 ()
2627
28+
2729def nested_function_1 ():
2830 """Top-level function"""
2931 print ("In nested_function_1" )
3032 nested_function_2 ()
3133
34+
3235def main ():
3336 print ("Setting up crashtracker test..." )
3437
3538 # Enable crashtracking with runtime stacks
36- os .environ [' DD_CRASHTRACKING_ENABLED' ] = ' true'
37- os .environ [' DD_CRASHTRACKING_EMIT_RUNTIME_STACKS' ] = ' true'
39+ os .environ [" DD_CRASHTRACKING_ENABLED" ] = " true"
40+ os .environ [" DD_CRASHTRACKING_EMIT_RUNTIME_STACKS" ] = " true"
3841
3942 # Import and initialize crashtracker
4043 try :
41- import ddtrace
4244 from ddtrace .internal .core import crashtracking
4345
4446 # Start crashtracking
@@ -71,5 +73,6 @@ def main():
7173 print ("ERROR: Should have crashed by now!" )
7274 return 1
7375
76+
7477if __name__ == "__main__" :
7578 sys .exit (main ())
You can’t perform that action at this time.
0 commit comments