diff --git a/docs/404.html b/docs/404.html index f7f43874..91166061 100644 --- a/docs/404.html +++ b/docs/404.html @@ -12121,7 +12121,7 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_67647/1830731544.py", line 4, in <cell line: 3> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_1042/1830731544.py", line 4, in <cell line: 3> raise NotFoundError NotFoundError: '404' (expected)diff --git a/docs/code/01_Intro.py b/docs/code/01_Intro.py index b2a5095f..8736a7d0 100755 --- a/docs/code/01_Intro.py +++ b/docs/code/01_Intro.py @@ -3,7 +3,7 @@ # "Part I: Whetting Your Appetite" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/01_Intro.html -# Last change: 2024-06-30 19:19:31+02:00 +# Last change: 2024-11-09 17:09:40+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/02_Observing.py b/docs/code/02_Observing.py index e0cdf8b9..5c78372a 100755 --- a/docs/code/02_Observing.py +++ b/docs/code/02_Observing.py @@ -3,7 +3,7 @@ # "Part II: Observing Executions" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/02_Observing.html -# Last change: 2024-06-30 19:19:53+02:00 +# Last change: 2024-11-09 17:10:09+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/03_Dependencies.py b/docs/code/03_Dependencies.py index 38ff01d8..10985b0b 100755 --- a/docs/code/03_Dependencies.py +++ b/docs/code/03_Dependencies.py @@ -3,7 +3,7 @@ # "Part III: Flows and Dependencies" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/03_Dependencies.html -# Last change: 2024-06-30 19:20:29+02:00 +# Last change: 2024-11-09 17:10:53+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/04_Reducing.py b/docs/code/04_Reducing.py index 0cd6ebee..694e89fc 100755 --- a/docs/code/04_Reducing.py +++ b/docs/code/04_Reducing.py @@ -3,7 +3,7 @@ # "Part IV: Reducing Failure Causes" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/04_Reducing.html -# Last change: 2024-06-30 19:20:56+02:00 +# Last change: 2024-11-09 17:11:25+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/05_Abstracting.py b/docs/code/05_Abstracting.py index d8c0995d..4fd4aa11 100755 --- a/docs/code/05_Abstracting.py +++ b/docs/code/05_Abstracting.py @@ -3,7 +3,7 @@ # "Part V: Abstracting Failures" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/05_Abstracting.html -# Last change: 2024-06-30 19:21:26+02:00 +# Last change: 2024-11-09 17:11:59+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/06_Repairing.py b/docs/code/06_Repairing.py index 6da247c5..9ab58d17 100755 --- a/docs/code/06_Repairing.py +++ b/docs/code/06_Repairing.py @@ -3,7 +3,7 @@ # "Part VI: Automatic Repair" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/06_Repairing.html -# Last change: 2024-06-30 19:27:58+02:00 +# Last change: 2024-11-09 17:13:01+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/07_In_the_Large.py b/docs/code/07_In_the_Large.py index 5ff4d2f9..37e69fe2 100755 --- a/docs/code/07_In_the_Large.py +++ b/docs/code/07_In_the_Large.py @@ -3,7 +3,7 @@ # "Part VII: Debugging in the Large" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/07_In_the_Large.html -# Last change: 2024-06-30 19:28:07+02:00 +# Last change: 2024-11-09 17:13:12+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/99_Appendices.py b/docs/code/99_Appendices.py index edfad5cb..46e34d74 100755 --- a/docs/code/99_Appendices.py +++ b/docs/code/99_Appendices.py @@ -3,7 +3,7 @@ # "Appendices" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/99_Appendices.html -# Last change: 2024-06-30 19:30:06+02:00 +# Last change: 2024-11-09 17:27:48+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/Assertions.py b/docs/code/Assertions.py index 3f5f19d3..05672d57 100755 --- a/docs/code/Assertions.py +++ b/docs/code/Assertions.py @@ -3,7 +3,7 @@ # "Asserting Expectations" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Assertions.html -# Last change: 2024-06-30 19:20:25+02:00 +# Last change: 2024-11-09 17:10:48+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -55,9 +55,9 @@ >>> with ExpectError(): >>> y = my_square_root(-1) Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/76616918.py", line 2, in + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/76616918.py", line 2, in y = my_square_root(-1) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2617682038.py", line 2, in my_square_root + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2617682038.py", line 2, in my_square_root assert x >= 0 AssertionError (expected) @@ -77,11 +77,11 @@ >>> with ExpectError(): >>> x = managed_mem[2] Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1296110967.py", line 2, in + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1296110967.py", line 2, in x = managed_mem[2] - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2465984283.py", line 3, in __getitem__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2465984283.py", line 3, in __getitem__ return self.read(address) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2898840933.py", line 9, in read + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2898840933.py", line 9, in read assert self.allocated[address], \ AssertionError: Reading from unallocated memory (expected) diff --git a/docs/code/ChangeCounter.py b/docs/code/ChangeCounter.py index 84fb42f5..00c0e810 100755 --- a/docs/code/ChangeCounter.py +++ b/docs/code/ChangeCounter.py @@ -3,7 +3,7 @@ # "Where the Bugs are" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/ChangeCounter.html -# Last change: 2024-06-30 18:57:45+02:00 +# Last change: 2024-11-09 18:09:29+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -66,10 +66,6 @@ >>> change_counter.messages.get(('README.md',), None) ['Doc update', - 'Doc update', - 'Doc update', - 'Doc update', - 'Doc update', 'Doc update', 'Fix: corrected rule for rendered notebooks (#24)\nNew: strip out any tags\nNew: when rendering .md files, replace videos by proper image', 'Doc update', @@ -82,6 +78,10 @@ 'Update', 'Doc update', 'Doc update', + 'Doc update', + 'Doc update', + 'Doc update', + 'Doc update', 'Updated README', 'Doc update', 'Doc update'] diff --git a/docs/code/ChangeDebugger.py b/docs/code/ChangeDebugger.py index 57e6d527..e9150690 100755 --- a/docs/code/ChangeDebugger.py +++ b/docs/code/ChangeDebugger.py @@ -3,7 +3,7 @@ # "Isolating Failure-Inducing Changes" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/ChangeDebugger.html -# Last change: 2024-06-30 19:21:22+02:00 +# Last change: 2024-11-09 17:11:54+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -96,9 +96,9 @@ def remove_html_markup(s): # type: ignore >>> with ExpectError(AssertionError): >>> test() Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_54974/4262003862.py", line 3, in + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_78522/4262003862.py", line 3, in test() - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_54974/3045937450.py", line 2, in test + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_78522/3045937450.py", line 2, in test assert remove_html_markup('"foo"') == '"foo"' AssertionError (expected) diff --git a/docs/code/ClassDiagram.py b/docs/code/ClassDiagram.py index b0b90728..b3980026 100755 --- a/docs/code/ClassDiagram.py +++ b/docs/code/ClassDiagram.py @@ -3,7 +3,7 @@ # "Class Diagrams" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/ClassDiagram.html -# Last change: 2024-06-30 18:57:54+02:00 +# Last change: 2024-11-09 17:28:36+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/DDSetDebugger.py b/docs/code/DDSetDebugger.py index 8fee95d1..ac60f190 100755 --- a/docs/code/DDSetDebugger.py +++ b/docs/code/DDSetDebugger.py @@ -3,7 +3,7 @@ # "Generalizing Failure Circumstances" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/DDSetDebugger.html -# Last change: 2024-06-30 19:22:02+02:00 +# Last change: 2024-11-09 17:33:15+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/Debugger.py b/docs/code/Debugger.py index a092f1a2..0e92928c 100755 --- a/docs/code/Debugger.py +++ b/docs/code/Debugger.py @@ -3,7 +3,7 @@ # "How Debuggers Work" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Debugger.html -# Last change: 2024-06-30 19:20:09+02:00 +# Last change: 2024-11-09 17:10:36+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -57,9 +57,9 @@ (debugger) help -break -- Set a breakoint in given line. If no line is given, list all breakpoints +break -- Set a breakpoint in given line. If no line is given, list all breakpoints continue -- Resume execution -delete -- Delete breakoint in line given by `arg`. +delete -- Delete breakpoint in line given by `arg`. Without given line, clear all breakpoints help -- Give help on given `command`. If no command is given, give help on all list -- Show current function. If `arg` is given, show its source code. @@ -465,7 +465,7 @@ def list_command(self, arg: str = "") -> None: class Debugger(Debugger): def break_command(self, arg: str = "") -> None: - """Set a breakoint in given line. If no line is given, list all breakpoints""" + """Set a breakpoint in given line. If no line is given, list all breakpoints""" if arg: self.breakpoints.add(int(arg)) @@ -502,7 +502,7 @@ def break_command(self, arg: str = "") -> None: class Debugger(Debugger): def delete_command(self, arg: str = "") -> None: - """Delete breakoint in line given by `arg`. + """Delete breakpoint in line given by `arg`. Without given line, clear all breakpoints""" if arg: diff --git a/docs/code/DeltaDebugger.py b/docs/code/DeltaDebugger.py index b311ea65..cb75ce2f 100755 --- a/docs/code/DeltaDebugger.py +++ b/docs/code/DeltaDebugger.py @@ -3,7 +3,7 @@ # "Reducing Failure-Inducing Inputs" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/DeltaDebugger.html -# Last change: 2024-06-30 19:21:06+02:00 +# Last change: 2024-11-09 17:11:35+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -51,9 +51,9 @@ >>> with ExpectError(ZeroDivisionError): >>> myeval('1 + 2 * 3 / 0') Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_54673/4002351332.py", line 2, in + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_77462/4002351332.py", line 2, in myeval('1 + 2 * 3 / 0') - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_54673/2200911420.py", line 2, in myeval + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_77462/2200911420.py", line 2, in myeval return eval(inp) File "", line 1, in ZeroDivisionError: division by zero (expected) diff --git a/docs/code/DynamicInvariants.py b/docs/code/DynamicInvariants.py index 033b7dec..188901df 100755 --- a/docs/code/DynamicInvariants.py +++ b/docs/code/DynamicInvariants.py @@ -3,7 +3,7 @@ # "Mining Function Specifications" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/DynamicInvariants.html -# Last change: 2024-06-30 19:21:49+02:00 +# Last change: 2024-11-09 17:34:13+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/ExpectError.py b/docs/code/ExpectError.py index 70e7941a..9e8a5954 100755 --- a/docs/code/ExpectError.py +++ b/docs/code/ExpectError.py @@ -3,7 +3,7 @@ # "Error Handling" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/ExpectError.html -# Last change: 2024-06-30 19:30:29+02:00 +# Last change: 2024-11-09 17:28:13+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -47,7 +47,7 @@ >>> with ExpectError(): >>> x = 1 / 0 Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_65665/2664980466.py", line 2, in + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_98441/2664980466.py", line 2, in x = 1 / 0 ZeroDivisionError: division by zero (expected) @@ -63,9 +63,9 @@ 3 seconds have passed Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_65665/1223755941.py", line 2, in + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_98441/1223755941.py", line 2, in long_running_test() - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_65665/3930412460.py", line 4, in long_running_test + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_98441/3930412460.py", line 4, in long_running_test time.sleep(1) File "Timeout.ipynb", line 43, in timeout_handler raise TimeoutError() diff --git a/docs/code/Intro_Debugging.py b/docs/code/Intro_Debugging.py index dca301bd..b91ced73 100755 --- a/docs/code/Intro_Debugging.py +++ b/docs/code/Intro_Debugging.py @@ -3,7 +3,7 @@ # "Introduction to Debugging" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Intro_Debugging.html -# Last change: 2024-06-30 19:19:49+02:00 +# Last change: 2024-11-09 17:10:04+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/PerformanceDebugger.py b/docs/code/PerformanceDebugger.py index c3d00a50..f6fa82ed 100755 --- a/docs/code/PerformanceDebugger.py +++ b/docs/code/PerformanceDebugger.py @@ -3,7 +3,7 @@ # "Debugging Performance Issues" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/PerformanceDebugger.html -# Last change: 2024-06-30 19:27:54+02:00 +# Last change: 2024-11-09 17:46:22+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -59,14 +59,14 @@ 243 16% for c in s: 244 15% assert tag or not quote 245 0% - 246 14% if c == '' and not quote: - 249 2% tag = False - 250 8% elif (c == '"' or c == "'") and tag: + 246 15% if c == '' and not quote: + 249 3% tag = False + 250 9% elif (c == '"' or c == "'") and tag: 251 0% quote = not quote 252 9% elif not tag: - 253 5% out = out + c + 253 4% out = out + c 254 0% - 255 2% return out + 255 3% return out diff --git a/docs/code/Repairer.py b/docs/code/Repairer.py index 83aeb59b..68fb2485 100755 --- a/docs/code/Repairer.py +++ b/docs/code/Repairer.py @@ -3,7 +3,7 @@ # "Repairing Code Automatically" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Repairer.html -# Last change: 2024-06-30 18:45:54+02:00 +# Last change: 2024-11-09 17:47:41+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -500,7 +500,7 @@ def visit(self, node: ast.AST) -> ast.AST: self.mutations += 1 if self.log: - print(f"{node.lineno:4}:{op.__name__ + ':':7} " + print(f"{node.lineno:4}:{op.__name__ + ':':7} " # type: ignore f"{self.format_node(node)} " f"becomes {self.format_node(new_node)}") diff --git a/docs/code/Slicer.py b/docs/code/Slicer.py index a0585a3f..a59d9d1b 100755 --- a/docs/code/Slicer.py +++ b/docs/code/Slicer.py @@ -3,7 +3,7 @@ # "Tracking Failure Origins" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Slicer.html -# Last change: 2024-06-30 19:20:52+02:00 +# Last change: 2024-11-09 17:11:19+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -976,11 +976,11 @@ def visit_Name(self, node: Name) -> AST: def make_get_data(id: str, method: str = 'get') -> Call: return Call(func=Attribute(value=Name(id=DATA_TRACKER, ctx=Load()), attr=method, ctx=Load()), - args=[ast.Str(s=id), Name(id=id, ctx=Load())], + args=[ast.Str(id), Name(id=id, ctx=Load())], keywords=[]) if __name__ == '__main__': - show_ast(Module(body=[make_get_data("x")])) + show_ast(Module(body=[make_get_data("x")], type_ignores=[])) # type: ignore if __name__ == '__main__': print(ast.dump(ast.parse("_data.get('x', x)"))) @@ -1066,7 +1066,7 @@ def make_set_data(id: str, value: Any, new_node = Call(func=Attribute(value=Name(id=DATA_TRACKER, ctx=Load()), attr=method, ctx=Load()), - args=[ast.Str(s=id), value], + args=[ast.Str(id), value], keywords=keywords) ast.copy_location(new_node, value) @@ -1429,7 +1429,7 @@ def make_call(self, node: AST, func: str, ctx=Load()), attr=func, ctx=Load()), - args=[node], + args=[node], # type: ignore keywords=keywords) def visit_Call(self, node: Call) -> Call: @@ -1562,11 +1562,11 @@ def visit_FunctionDef(self, node: ast.FunctionDef) -> ast.FunctionDef: create_stmts = [] for n, child in enumerate(named_args): - keywords=[keyword(arg='pos', value=ast.Num(n=n + 1))] + keywords=[keyword(arg='pos', value=ast.Num(n + 1))] if child is node.args.vararg: - keywords.append(keyword(arg='vararg', value=ast.Str(s='*'))) + keywords.append(keyword(arg='vararg', value=ast.Str('*'))) if child is node.args.kwarg: - keywords.append(keyword(arg='vararg', value=ast.Str(s='**'))) + keywords.append(keyword(arg='vararg', value=ast.Str('**'))) if n == len(named_args) - 1: keywords.append(keyword(arg='last', value=ast.NameConstant(value=True))) @@ -1575,7 +1575,7 @@ def visit_FunctionDef(self, node: ast.FunctionDef) -> ast.FunctionDef: value=Call( func=Attribute(value=Name(id=DATA_TRACKER, ctx=Load()), attr='param', ctx=Load()), - args=[ast.Str(s=child.arg), + args=[ast.Str(child.arg), Name(id=child.arg, ctx=Load()) ], keywords=keywords diff --git a/docs/code/StackInspector.py b/docs/code/StackInspector.py index 041ff9b7..3d9c09c6 100755 --- a/docs/code/StackInspector.py +++ b/docs/code/StackInspector.py @@ -3,7 +3,7 @@ # "Inspecting Call Stacks" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/StackInspector.html -# Last change: 2024-06-30 18:58:00+02:00 +# Last change: 2024-11-09 17:28:42+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/StatisticalDebugger.py b/docs/code/StatisticalDebugger.py index 6feb95aa..df8ee16a 100755 --- a/docs/code/StatisticalDebugger.py +++ b/docs/code/StatisticalDebugger.py @@ -3,7 +3,7 @@ # "Statistical Debugging" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/StatisticalDebugger.html -# Last change: 2024-06-30 19:21:35+02:00 +# Last change: 2024-11-09 17:33:52+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -131,19 +131,19 @@ >>> debugger.rank() [('remove_html_markup', 12), + ('remove_html_markup', 14), ('remove_html_markup', 3), - ('remove_html_markup', 6), ('remove_html_markup', 9), - ('remove_html_markup', 1), + ('remove_html_markup', 6), ('remove_html_markup', 4), + ('remove_html_markup', 1), ('remove_html_markup', 7), - ('remove_html_markup', 13), ('remove_html_markup', 16), + ('remove_html_markup', 13), ('remove_html_markup', 2), ('remove_html_markup', 11), - ('remove_html_markup', 14), - ('remove_html_markup', 10), - ('remove_html_markup', 8)] + ('remove_html_markup', 8), + ('remove_html_markup', 10)] ### Classes and Methods diff --git a/docs/code/Timeout.py b/docs/code/Timeout.py index 62a42645..5a7df638 100755 --- a/docs/code/Timeout.py +++ b/docs/code/Timeout.py @@ -3,7 +3,7 @@ # "Timeout" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Timeout.html -# Last change: 2024-06-30 19:30:38+02:00 +# Last change: 2024-11-09 17:28:25+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/Timer.py b/docs/code/Timer.py index 285875b3..ea984c60 100755 --- a/docs/code/Timer.py +++ b/docs/code/Timer.py @@ -3,7 +3,7 @@ # "Timer" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Timer.html -# Last change: 2024-06-30 19:30:33+02:00 +# Last change: 2024-11-09 17:28:19+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -47,7 +47,7 @@ >>> with Timer() as t: >>> some_long_running_function() >>> t.elapsed_time() -0.023621540996828116 +0.025446416984777898 For more details, source, and documentation, see diff --git a/docs/code/Tours.py b/docs/code/Tours.py index a47bf5d7..e8b6c16a 100755 --- a/docs/code/Tours.py +++ b/docs/code/Tours.py @@ -3,7 +3,7 @@ # "Tours through the Book" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Tours.html -# Last change: 2024-06-30 19:19:36+02:00 +# Last change: 2024-11-09 17:09:47+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/Tracer.py b/docs/code/Tracer.py index 00048958..f9b8a05f 100755 --- a/docs/code/Tracer.py +++ b/docs/code/Tracer.py @@ -3,7 +3,7 @@ # "Tracing Executions" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Tracer.html -# Last change: 2024-06-30 19:20:03+02:00 +# Last change: 2024-11-09 17:10:28+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors @@ -396,6 +396,7 @@ def __init__(self, *, condition: Optional[str] = None, file: TextIO = sys.stdout if condition is None: condition = 'False' + assert isinstance(condition, str) self.condition: str = condition self.last_report: Optional[bool] = None @@ -481,6 +482,7 @@ class EventTracer(ConditionalTracer): def __init__(self, *, condition: Optional[str] = None, events: List[str] = [], file: TextIO = sys.stdout) -> None: """Constructor. `events` is a list of expressions to watch.""" + assert isinstance(events, List) # avoid type errors self.events = events self.last_event_values: Dict[str, Any] = {} super().__init__(file=file, condition=condition) diff --git a/docs/code/Tracking.py b/docs/code/Tracking.py index f7de52ea..9f3347be 100755 --- a/docs/code/Tracking.py +++ b/docs/code/Tracking.py @@ -3,7 +3,7 @@ # "Tracking Bugs" - a chapter of "The Debugging Book" # Web site: https://www.debuggingbook.org/html/Tracking.html -# Last change: 2024-06-30 22:45:05+02:00 +# Last change: 2024-11-10 11:42:06+01:00 # # Copyright (c) 2021-2023 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarland University, authors, and contributors diff --git a/docs/code/bookutils/__init__.py b/docs/code/bookutils/__init__.py index 6f0ad30b..4b3e59e3 100644 --- a/docs/code/bookutils/__init__.py +++ b/docs/code/bookutils/__init__.py @@ -35,7 +35,7 @@ def rich_output() -> bool: rich = False return rich - + # Project identifier def project() -> Optional[str]: wd = os.getcwd() @@ -79,7 +79,7 @@ class InteractiveSVG: def __init__(self, filename: str) -> None: with open(filename, 'r', encoding='utf-8') as svg_fh: self.svg_content = svg_fh.read() - + def _repr_html_(self) -> str: return self.svg_content @@ -137,16 +137,16 @@ def print_content(content: str, filename: Optional[str] = None, lexer: Optional[ def getsourcelines(function: Any) -> Tuple[List[str], int]: """A replacement for inspect.getsourcelines(), but with syntax highlighting""" import inspect - + source_lines, starting_line_number = \ inspect.getsourcelines(function) - + if not rich_output(): return source_lines, starting_line_number - + from pygments import highlight, lexers, formatters from pygments.lexers import get_lexer_for_filename - + lexer = get_lexer_for_filename('.py') colorful_content = highlight( "".join(source_lines), lexer, @@ -158,14 +158,44 @@ def getsourcelines(function: Any) -> Tuple[List[str], int]: # Showing ASTs def show_ast(tree: AST) -> Optional[Any]: - if rich_output(): - import showast # We can import showast only when in a notebook - return showast.show_ast(tree) - else: - import ast # Textual alternative111 + if not rich_output(): + # We can import showast only when in a notebook + import ast # Textual alternative print(ast.dump(tree)) return None + # show_ast() no longer works in Python 3.12: the `imp` module is deprecated + # import showast + # return showast.show_ast(tree) + + # Workaround, avoiding `imp` + import_showast() + import showast + from showast.rendering.graphviz import render + return render(tree, showast.Settings) + +# Allow importing the showast module +def import_showast() -> None: + try: + import showast + return + except ModuleNotFoundError: + pass + + # Create a local (empty) 'imp' module while importing showast + # This is an ugly hack until the `showast` module is updated to 3.12 + import os, sys, shutil + os.mkdir('imp') + imp_init = os.path.join('imp', '__init__.py') + with open(imp_init, 'w') as fd: + pass + original_sys_path = sys.path + sys.path = ['.'] + sys.path + import showast + sys.path = original_sys_path + shutil.rmtree('imp') + + # Escaping unicode characters into ASCII for user-facing strings def unicode_escape(s: str, error: str = 'backslashreplace') -> str: def ascii_chr(byte: int) -> str: @@ -190,9 +220,9 @@ def terminal_escape(s: str) -> str: import os firefox = None -def HTML(data: Optional[str] = None, - url: Optional[str] = None, - filename: Optional[str] = None, +def HTML(data: Optional[str] = None, + url: Optional[str] = None, + filename: Optional[str] = None, png: bool = False, headless: bool = True, zoom: float = 2.0) -> Any: @@ -236,10 +266,10 @@ def HTML(data: Optional[str] = None, # Render URL as PNG firefox.get(url) return Image(firefox.get_screenshot_as_png()) - - + + # Quizzes -# Usage: quiz('Which of these is not a fruit?', +# Usage: quiz('Which of these is not a fruit?', # ['apple', 'banana', 'pear', 'tomato'], '27 / 9') import uuid import markdown @@ -257,14 +287,14 @@ def quiztext(text: Union[str, object]) -> str: # Widget quizzes. No support for multiple-choice quizzes. # Currently unused in favor of jsquiz(), below. -def nbquiz(question: str, options: List[str], correct_answer: int, - globals: Optional[Dict[str, Any]], +def nbquiz(question: str, options: List[str], correct_answer: int, + globals: Optional[Dict[str, Any]], title: str = 'Quiz', debug: bool = False) -> object: import ipywidgets as widgets if isinstance(correct_answer, str): correct_answer = int(eval(correct_answer, globals)) - + radio_options = [(quiztext(words), i) for i, words in enumerate(options)] alternatives = widgets.RadioButtons( options = radio_options, @@ -275,10 +305,10 @@ def nbquiz(question: str, options: List[str], correct_answer: int, title_out = widgets.HTML(value=f'
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_67647/1830731544.py", line 4, in <cell line: 3> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_1042/1830731544.py", line 4, in <cell line: 3> raise NotFoundError NotFoundError: '404' (expected)diff --git a/docs/html/Assertions.html b/docs/html/Assertions.html index 2fa587bf..59d2f79b 100644 --- a/docs/html/Assertions.html +++ b/docs/html/Assertions.html @@ -12110,9 +12110,9 @@
>>> with ExpectError():
>>> y = my_square_root(-1)
Traceback (most recent call last):
- File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/76616918.py", line 2, in <cell line: 1>
+ File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/76616918.py", line 2, in <cell line: 1>
y = my_square_root(-1)
- File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2617682038.py", line 2, in my_square_root
+ File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2617682038.py", line 2, in my_square_root
assert x >= 0
AssertionError (expected)
>>> with ExpectError():
>>> x = managed_mem[2]
Traceback (most recent call last):
- File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1296110967.py", line 2, in <cell line: 1>
+ File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1296110967.py", line 2, in <cell line: 1>
x = managed_mem[2]
- File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2465984283.py", line 3, in __getitem__
+ File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2465984283.py", line 3, in __getitem__
return self.read(address)
- File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2898840933.py", line 9, in read
+ File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2898840933.py", line 9, in read
assert self.allocated[address], \
AssertionError: Reading from unallocated memory (expected)
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2715578531.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2715578531.py", line 2, in <cell line: 1> assert False AssertionError (expected)@@ -12368,9 +12368,9 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1450148856.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1450148856.py", line 2, in <cell line: 1> my_own_assert(2 + 2 == 5) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/3374119957.py", line 3, in my_own_assert + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/3374119957.py", line 3, in my_own_assert raise AssertionError AssertionError (expected)@@ -12765,22 +12765,22 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2842303881.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2842303881.py", line 2, in <cell line: 1> fun() - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/3649916634.py", line 2, in fun + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/3649916634.py", line 2, in fun assert 2 + 2 == 5 AssertionError (expected)@@ -12905,9 +12905,9 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/3162937341.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/3162937341.py", line 2, in <cell line: 1> square_root(-1) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1081921329.py", line 2, in square_root + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1081921329.py", line 2, in square_root assert x >= 0 AssertionError (expected)@@ -13006,9 +13006,9 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2953341793.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2953341793.py", line 2, in <cell line: 1> square_root('4') - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1840548601.py", line 2, in square_root + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1840548601.py", line 2, in square_root assert isinstance(x, (int, float)) AssertionError (expected)@@ -13099,16 +13099,16 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2976301596.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2976301596.py", line 2, in <cell line: 1> '4' >= 0 # type: ignore TypeError: '>=' not supported between instances of 'str' and 'int' (expected)@@ -13269,22 +13269,22 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1913183346.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1913183346.py", line 2, in <cell line: 1> remove_html_markup('"x > y"') - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2717035104.py", line 17, in remove_html_markup + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2717035104.py", line 17, in remove_html_markup assert '<' not in out and '>' not in out AssertionError (expected)@@ -14142,19 +14142,19 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/283236387.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/283236387.py", line 2, in <cell line: 1> t = Time(-23, 0, 0) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/559831374.py", line 3, in __init__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/559831374.py", line 3, in __init__ assert 0 <= hours <= 23 AssertionError (expected)@@ -14850,9 +14850,9 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/91299477.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/91299477.py", line 2, in <cell line: 1> my_time.hours = 25 # type: ignore - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2658705698.py", line 8, in hours + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2658705698.py", line 8, in hours assert 0 <= new_hours <= 23 AssertionError (expected)@@ -14973,11 +14973,11 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/283236387.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/283236387.py", line 2, in <cell line: 1> t = Time(-23, 0, 0) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/346828762.py", line 6, in __init__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/346828762.py", line 6, in __init__ assert self.repOK() - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/478898990.py", line 3, in repOK + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/478898990.py", line 3, in repOK assert 0 <= self.hours() <= 23 AssertionError (expected)@@ -15109,11 +15109,11 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/119323666.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/119323666.py", line 2, in <cell line: 1> t = Time("After midnight") # type: ignore - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/346828762.py", line 6, in __init__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/346828762.py", line 6, in __init__ assert self.repOK() - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1587012707.py", line 3, in repOK + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1587012707.py", line 3, in repOK assert isinstance(self.hours(), int) AssertionError (expected)@@ -15437,7 +15437,7 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/295675708.py", line 3, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/295675708.py", line 3, in <cell line: 1> "foo"[index] IndexError: string index out of range (expected)@@ -16584,9 +16584,9 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/381644293.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/381644293.py", line 2, in <cell line: 1> dynamic_mem.allocate(1) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2922652606.py", line 45, in allocate + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2922652606.py", line 45, in allocate raise MemoryError("Out of Memory") MemoryError: Out of Memory (expected)@@ -17237,9 +17237,9 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2188947149.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2188947149.py", line 2, in <cell line: 1> dynamic_mem.allocate(1) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2922652606.py", line 24, in allocate + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2922652606.py", line 24, in allocate if chunk_length < 0 and abs(chunk_length) >= block_size: File "Timeout.ipynb", line 43, in timeout_handler raise TimeoutError() @@ -17760,11 +17760,11 @@Quiz
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1363131886.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1363131886.py", line 2, in <cell line: 1> x = managed_mem[p + 2] - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2465984283.py", line 3, in __getitem__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2465984283.py", line 3, in __getitem__ return self.read(address) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2898840933.py", line 11, in read + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2898840933.py", line 11, in read assert self.initialized[address], \ AssertionError: Reading from uninitialized memory (expected)@@ -17890,11 +17890,11 @@Quiz
@@ -17502,7 +17502,7 @@Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/4208287712.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/4208287712.py", line 2, in <cell line: 1> managed_mem[p] = 10 - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2465984283.py", line 6, in __setitem__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2465984283.py", line 6, in __setitem__ self.write(address, item) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2898840933.py", line 3, in write + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2898840933.py", line 3, in write assert self.allocated[address], \ AssertionError: Writing into unallocated memory (expected)@@ -17930,9 +17930,9 @@Quiz
@@ -17209,9 +17209,9 @@Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/3645412891.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/3645412891.py", line 2, in <cell line: 1> managed_mem.free(p) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/193494573.py", line 10, in free + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/193494573.py", line 10, in free assert self.allocated[base], \ AssertionError: Freeing memory that is already freed (expected)@@ -18213,36 +18213,37 @@Quiz
-@@ -18308,27 +18309,28 @@================================================================= -==53468==ERROR: AddressSanitizer: heap-use-after-free on address 0x000103115a68 at pc 0x0001005cfeb8 bp 0x00016f832a20 sp 0x00016f832a18 -READ of size 4 at 0x000103115a68 thread T0 - #0 0x1005cfeb4 in main+0x94 (testuseafterfree:arm64+0x100003eb4) - #1 0x194be60dc (<unknown module>) - -0x000103115a68 is located 40 bytes inside of 400-byte region [0x000103115a40,0x000103115bd0) +testuseafterfree(74510,0x1fd223840) malloc: nano zone abandoned due to inability to reserve vm space. +================================================================= +==74510==ERROR: AddressSanitizer: heap-use-after-free on address 0x614000000068 at pc 0x000102487eb8 bp 0x00016d97a9f0 sp 0x00016d97a9e8 +READ of size 4 at 0x614000000068 thread T0 + #0 0x102487eb4 in main+0x94 (testuseafterfree:arm64+0x100003eb4) + #1 0x197d8c270 (<unknown module>) + +0x614000000068 is located 40 bytes inside of 400-byte region [0x614000000040,0x6140000001d0) freed by thread T0 here: - #0 0x100eeb260 in wrap_free+0x98 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x53260) - #1 0x1005cfe58 in main+0x38 (testuseafterfree:arm64+0x100003e58) - #2 0x194be60dc (<unknown module>) + #0 0x1028f4d40 in free+0x98 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x54d40) + #1 0x102487e58 in main+0x38 (testuseafterfree:arm64+0x100003e58) + #2 0x197d8c270 (<unknown module>) previously allocated by thread T0 here: - #0 0x100eeb124 in wrap_malloc+0x94 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x53124) - #1 0x1005cfe4c in main+0x2c (testuseafterfree:arm64+0x100003e4c) - #2 0x194be60dc (<unknown module>) + #0 0x1028f4c04 in malloc+0x94 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x54c04) + #1 0x102487e4c in main+0x2c (testuseafterfree:arm64+0x100003e4c) + #2 0x197d8c270 (<unknown module>) SUMMARY: AddressSanitizer: heap-use-after-free (testuseafterfree:arm64+0x100003eb4) in main+0x94 Shadow bytes around the buggy address: - 0x000103115780: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa - 0x000103115800: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa - 0x000103115880: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa - 0x000103115900: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa - 0x000103115980: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa -=>0x000103115a00: fa fa fa fa fa fa fa fa fd fd fd fd fd[fd]fd fd - 0x000103115a80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd - 0x000103115b00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd - 0x000103115b80: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa - 0x000103115c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa - 0x000103115c80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x613ffffffd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x613ffffffe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x613ffffffe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x613fffffff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x613fffffff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +=>0x614000000000: fa fa fa fa fa fa fa fa fd fd fd fd fd[fd]fd fd + 0x614000000080: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd + 0x614000000100: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd + 0x614000000180: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa + 0x614000000200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x614000000280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 @@ -18262,7 +18263,7 @@Quiz
ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb -==53468==ABORTING +==74510==ABORTINGQuiz
@@ -17037,7 +17037,7 @@-diff --git a/docs/html/ChangeCounter.html b/docs/html/ChangeCounter.html index e2f4af2b..682ada32 100644 --- a/docs/html/ChangeCounter.html +++ b/docs/html/ChangeCounter.html @@ -12087,10 +12087,6 @@================================================================= -==53517==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000102037e6a at pc 0x000102037d60 bp 0x00016ddcaa40 sp 0x00016ddcaa38 -READ of size 1 at 0x000102037e6a thread T0 - #0 0x102037d5c in main+0x84 (testoverflow:arm64+0x100003d5c) - #1 0x194be60dc (<unknown module>) - -0x000102037e6a is located 6 bytes after global variable '.str' defined in 'testoverflow.c' (0x102037e60) of size 4 +testoverflow(74528,0x1fd223840) malloc: nano zone abandoned due to inability to reserve vm space. +================================================================= +==74528==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000102b6feaa at pc 0x000102b6fdf0 bp 0x00016d292a10 sp 0x00016d292a08 +READ of size 1 at 0x000102b6feaa thread T0 + #0 0x102b6fdec in main+0x84 (testoverflow:arm64+0x100003dec) + #1 0x197d8c270 (<unknown module>) + +0x000102b6feaa is located 6 bytes after global variable '.str' defined in 'testoverflow.c' (0x102b6fea0) of size 4 '.str' is ascii string 'foo' -SUMMARY: AddressSanitizer: global-buffer-overflow (testoverflow:arm64+0x100003d5c) in main+0x84 +SUMMARY: AddressSanitizer: global-buffer-overflow (testoverflow:arm64+0x100003dec) in main+0x84 Shadow bytes around the buggy address: - 0x000102037b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -=>0x000102037e00: 00 00 00 00 00 00 00 00 00 00 00 00 04[f9]f9 f9 - 0x000102037e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102038000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102038080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6fc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6fc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6fd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6fd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6fe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +=>0x000102b6fe80: 00 00 00 00 04[f9]f9 f9 00 00 00 00 00 00 00 00 + 0x000102b6ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b70000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b70080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b70100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 @@ -18348,7 +18350,7 @@Quiz
ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb -==53517==ABORTING +==74528==ABORTINGThe
messages
attribute holds all commit messages related to that node:>>> change_counter.messages.get(('README.md',), None) ['Doc update', - 'Doc update', - 'Doc update', - 'Doc update', - 'Doc update', 'Doc update', 'Fix: corrected rule for rendered notebooks (#24)\nNew: strip out any <iframe> tags\nNew: when rendering .md files, replace videos by proper image', 'Doc update', @@ -12103,6 +12099,10 @@ 'Update', 'Doc update', 'Doc update', + 'Doc update', + 'Doc update', + 'Doc update', + 'Doc update', 'Updated README', 'Doc update', 'Doc update'] @@ -12115,9 +12115,9 @@The
map()
method ofChangeCounter
andFineChangeCounter
produces an interactive tree map that allows exploring the elements of a repository. The redder (darker) a rectangle, the more changes it has seen; the larger a rectangle, the larger its size in bytes.->>> fine_change_counter.map()''' - + if multiple_choice: input_type = "checkbox" instructions = "Check all that apply." else: input_type = "radio" instructions = "Pick a choice." - + menu = "".join(f'''@@ -16719,7 +16719,7 @@
''' for (i, option) in enumerate(options)) - + html_fragment = f''' {script}@@ -441,16 +471,16 @@ def jsquiz(question: str, return HTML(html_fragment) # HTML quizzes. Not interactive. -def htmlquiz(question: str, - options: List[str], - correct_answer: Any, +def htmlquiz(question: str, + options: List[str], + correct_answer: Any, globals: Optional[Dict[str, Any]] = None, title: str = 'Quiz') -> Any: # should be IPython.core.display.HTML - + menu = "".join(f'''@@ -16028,7 +16028,7 @@{quiztext(option)} ''' for (i, option) in enumerate(options)) - + html = f'''{quiztext(title)}
{quiztext(question)}
@@ -465,7 +495,7 @@ def htmlquiz(question: str, def textquiz(question: str, options: List[str], correct_answer: Any, globals: Optional[Dict[str, Any]] = None, title: str = 'Quiz') -> None: menu = "".join(f''' {i}. {option}''' for (i, option) in enumerate(options)) - + text = f'''{title}: {question} {menu} @@ -474,13 +504,13 @@ def textquiz(question: str, options: List[str], correct_answer: Any, globals: Op print(text) # Entry point for all of the above. -def quiz(question: str, options: List[str], +def quiz(question: str, options: List[str], correct_answer: Union[str, - int, + int, List[Union[str, int]], - Set[Union[str, int]]], + Set[Union[str, int]]], globals: Optional[Dict[str, Any]] = None, **kwargs: Any) -> Any: - """Display a quiz. + """Display a quiz. `question` is a question string to be asked. `options` is a list of strings with possible answers. `correct_answer` is either @@ -490,7 +520,7 @@ def quiz(question: str, options: List[str], these will be displayed as is and evaluated for the correct values. `title` is the title to be displayed. """ - + if globals is None: globals = {} @@ -499,7 +529,7 @@ def quiz(question: str, options: List[str], if have_ipython: return jsquiz(question, options, correct_answer, globals, **kwargs) - + return textquiz(question, options, correct_answer, globals, **kwargs) @@ -518,7 +548,7 @@ def input(prompt: str) -> str: INPUTS = INPUTS[1:] except: pass - + if given_input: if rich_output(): from IPython.display import display @@ -526,9 +556,9 @@ def input(prompt: str) -> str: else: print(f"{prompt} {given_input}") return given_input - + return original_input(prompt) - + def next_inputs(list: List[str] = []) -> List[str]: global INPUTS INPUTS += list diff --git a/docs/notebooks/index.ipynb b/docs/notebooks/index.ipynb index d6416f94..2cc080a8 100644 --- a/docs/notebooks/index.ipynb +++ b/docs/notebooks/index.ipynb @@ -24,10 +24,10 @@ "execution_count": 1, "metadata": { "execution": { - "iopub.execute_input": "2024-07-01T14:49:39.718459Z", - "iopub.status.busy": "2024-07-01T14:49:39.717817Z", - "iopub.status.idle": "2024-07-01T14:49:39.820259Z", - "shell.execute_reply": "2024-07-01T14:49:39.819943Z" + "iopub.execute_input": "2024-11-09T16:09:33.492903Z", + "iopub.status.busy": "2024-11-09T16:09:33.492497Z", + "iopub.status.idle": "2024-11-09T16:09:33.613403Z", + "shell.execute_reply": "2024-11-09T16:09:33.607951Z" }, "slideshow": { "slide_type": "skip" @@ -49,7 +49,7 @@ " " ], "text/plain": [ - "" + " " ] }, "execution_count": 1, diff --git a/docs/notebooks/requirements.txt b/docs/notebooks/requirements.txt index 836ff993..65f4e21f 100644 --- a/docs/notebooks/requirements.txt +++ b/docs/notebooks/requirements.txt @@ -18,6 +18,7 @@ nbconvert>=6.0.7 nbformat>=5.0.8 networkx>=2.5 numpy>=1.16.5 +numpy<2.0.0 # numpy 2.0 conflicts with Pandas pydriller>=2.3 pyparsing==2.4.7 # newer versions conflict with bibtexparser Pygments>=2.7.1 diff --git a/docs/slides/Assertions.slides.html b/docs/slides/Assertions.slides.html index 1d7689f8..854f9eac 100644 --- a/docs/slides/Assertions.slides.html +++ b/docs/slides/Assertions.slides.html @@ -14765,7 +14765,7 @@ Assertions¶
@@ -15587,9 +15587,9 @@Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2715578531.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2715578531.py", line 2, in <cell line: 1> assert False AssertionError (expected)@@ -14891,9 +14891,9 @@Assertions¶
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1450148856.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1450148856.py", line 2, in <cell line: 1> my_own_assert(2 + 2 == 5) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/3374119957.py", line 3, in my_own_assert + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/3374119957.py", line 3, in my_own_assert raise AssertionError AssertionError (expected)@@ -15466,7 +15466,7 @@Assertion DiagnosticsAssertion DiagnosticsQuiz
- -- - + +
+ +
- -
+ +
- -
+ +
- -
+ +
Quiz
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2842303881.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2842303881.py", line 2, in <cell line: 1> fun() - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/3649916634.py", line 2, in fun + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/3649916634.py", line 2, in fun assert 2 + 2 == 5 AssertionError (expected)@@ -15708,9 +15708,9 @@Checking Preconditions
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/3162937341.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/3162937341.py", line 2, in <cell line: 1> square_root(-1) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1081921329.py", line 2, in square_root + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1081921329.py", line 2, in square_root assert x >= 0 AssertionError (expected)@@ -15838,9 +15838,9 @@Checking Preconditions
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2953341793.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2953341793.py", line 2, in <cell line: 1> square_root('4') - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1840548601.py", line 2, in square_root + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1840548601.py", line 2, in square_root assert isinstance(x, (int, float)) AssertionError (expected)@@ -15913,7 +15913,7 @@Checking PreconditionsChecking PreconditionsQuiz
- -- - + +
+ +
- -
+ +
Quiz
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2976301596.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2976301596.py", line 2, in <cell line: 1> '4' >= 0 # type: ignore TypeError: '>=' not supported between instances of 'str' and 'int' (expected)@@ -16145,7 +16145,7 @@Checking ResultsChecking ResultsQuiz
- -- - + +
+ +
- -
+ +
- -
+ +
- -
+ +
Assertions and TestsAssertions and TestsQuiz
- -- - + +
+ +
- -
+ +
Partial ChecksPartial ChecksQuiz
- -- - + +
+ +
- -
+ +
- -
+ +
- -
+ +
Quiz
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1913183346.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1913183346.py", line 2, in <cell line: 1> remove_html_markup('"x > y"') - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2717035104.py", line 17, in remove_html_markup + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2717035104.py", line 17, in remove_html_markup assert '<' not in out and '>' not in out AssertionError (expected)@@ -17320,7 +17320,7 @@Assertions and DocumentationAssertions and DocumentationQuiz
- -- - + +
+ +
- -
+ +
- -
+ +
Using Assertions to Trivia label = document.getElementById(quiz_id + "-" + i.toString() + "-label") if (!checkbox) break; - + if (checkbox.checked) { label.style.fontWeight = "bold"; } @@ -17514,7 +17514,7 @@
Using Assertions to Trivia else { document.getElementById(quiz_id + "-submit").value = "Try again"; - + if (!bad_answers.has(quiz_id)) { bad_answers.set(quiz_id, 1); } @@ -17555,22 +17555,22 @@
Quiz
- -- - + +
+ +
- -
+ +
- -
+ +
- -
+ +
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/283236387.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/283236387.py", line 2, in <cell line: 1> t = Time(-23, 0, 0) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/559831374.py", line 3, in __init__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/559831374.py", line 3, in __init__ assert 0 <= hours <= 23 AssertionError (expected)@@ -18270,11 +18270,11 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/283236387.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/283236387.py", line 2, in <cell line: 1> t = Time(-23, 0, 0) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/346828762.py", line 6, in __init__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/346828762.py", line 6, in __init__ assert self.repOK() - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/478898990.py", line 3, in repOK + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/478898990.py", line 3, in repOK assert 0 <= self.hours() <= 23 AssertionError (expected)@@ -18466,11 +18466,11 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/119323666.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/119323666.py", line 2, in <cell line: 1> t = Time("After midnight") # type: ignore - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/346828762.py", line 6, in __init__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/346828762.py", line 6, in __init__ assert self.repOK() - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1587012707.py", line 3, in repOK + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1587012707.py", line 3, in repOK assert isinstance(self.hours(), int) AssertionError (expected)@@ -18942,7 +18942,7 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/295675708.py", line 3, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/295675708.py", line 3, in <cell line: 1> "foo"[index] IndexError: string index out of range (expected)@@ -20215,9 +20215,9 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2188947149.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2188947149.py", line 2, in <cell line: 1> dynamic_mem.allocate(1) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2922652606.py", line 24, in allocate + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2922652606.py", line 24, in allocate if chunk_length < 0 and abs(chunk_length) >= block_size: File "Timeout.ipynb", line 43, in timeout_handler raise TimeoutError() @@ -20679,11 +20679,11 @@Managed Memory
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1363131886.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1363131886.py", line 2, in <cell line: 1> x = managed_mem[p + 2] - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2465984283.py", line 3, in __getitem__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2465984283.py", line 3, in __getitem__ return self.read(address) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2898840933.py", line 11, in read + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2898840933.py", line 11, in read assert self.initialized[address], \ AssertionError: Reading from uninitialized memory (expected)@@ -20846,11 +20846,11 @@Managed Memory
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/4208287712.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/4208287712.py", line 2, in <cell line: 1> managed_mem[p] = 10 - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2465984283.py", line 6, in __setitem__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2465984283.py", line 6, in __setitem__ self.write(address, item) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2898840933.py", line 3, in write + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2898840933.py", line 3, in write assert self.allocated[address], \ AssertionError: Writing into unallocated memory (expected)@@ -20903,9 +20903,9 @@Managed Memory
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/3645412891.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/3645412891.py", line 2, in <cell line: 1> managed_mem.free(p) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/193494573.py", line 10, in free + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/193494573.py", line 10, in free assert self.allocated[base], \ AssertionError: Freeing memory that is already freed (expected)@@ -21288,36 +21288,37 @@Checking Memory Usage with
-================================================================= -==53468==ERROR: AddressSanitizer: heap-use-after-free on address 0x000103115a68 at pc 0x0001005cfeb8 bp 0x00016f832a20 sp 0x00016f832a18 -READ of size 4 at 0x000103115a68 thread T0 - #0 0x1005cfeb4 in main+0x94 (testuseafterfree:arm64+0x100003eb4) - #1 0x194be60dc (<unknown module>) - -0x000103115a68 is located 40 bytes inside of 400-byte region [0x000103115a40,0x000103115bd0) +testuseafterfree(74510,0x1fd223840) malloc: nano zone abandoned due to inability to reserve vm space. +================================================================= +==74510==ERROR: AddressSanitizer: heap-use-after-free on address 0x614000000068 at pc 0x000102487eb8 bp 0x00016d97a9f0 sp 0x00016d97a9e8 +READ of size 4 at 0x614000000068 thread T0 + #0 0x102487eb4 in main+0x94 (testuseafterfree:arm64+0x100003eb4) + #1 0x197d8c270 (<unknown module>) + +0x614000000068 is located 40 bytes inside of 400-byte region [0x614000000040,0x6140000001d0) freed by thread T0 here: - #0 0x100eeb260 in wrap_free+0x98 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x53260) - #1 0x1005cfe58 in main+0x38 (testuseafterfree:arm64+0x100003e58) - #2 0x194be60dc (<unknown module>) + #0 0x1028f4d40 in free+0x98 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x54d40) + #1 0x102487e58 in main+0x38 (testuseafterfree:arm64+0x100003e58) + #2 0x197d8c270 (<unknown module>) previously allocated by thread T0 here: - #0 0x100eeb124 in wrap_malloc+0x94 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x53124) - #1 0x1005cfe4c in main+0x2c (testuseafterfree:arm64+0x100003e4c) - #2 0x194be60dc (<unknown module>) + #0 0x1028f4c04 in malloc+0x94 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x54c04) + #1 0x102487e4c in main+0x2c (testuseafterfree:arm64+0x100003e4c) + #2 0x197d8c270 (<unknown module>) SUMMARY: AddressSanitizer: heap-use-after-free (testuseafterfree:arm64+0x100003eb4) in main+0x94 Shadow bytes around the buggy address: - 0x000103115780: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa - 0x000103115800: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa - 0x000103115880: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa - 0x000103115900: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa - 0x000103115980: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa -=>0x000103115a00: fa fa fa fa fa fa fa fa fd fd fd fd fd[fd]fd fd - 0x000103115a80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd - 0x000103115b00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd - 0x000103115b80: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa - 0x000103115c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa - 0x000103115c80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x613ffffffd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x613ffffffe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x613ffffffe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x613fffffff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x613fffffff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +=>0x614000000000: fa fa fa fa fa fa fa fa fd fd fd fd fd[fd]fd fd + 0x614000000080: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd + 0x614000000100: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd + 0x614000000180: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa fa + 0x614000000200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x614000000280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 @@ -21337,7 +21338,7 @@Checking Memory Usage with ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb -==53468==ABORTING +==74510==ABORTING
================================================================= -==53517==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000102037e6a at pc 0x000102037d60 bp 0x00016ddcaa40 sp 0x00016ddcaa38 -READ of size 1 at 0x000102037e6a thread T0 - #0 0x102037d5c in main+0x84 (testoverflow:arm64+0x100003d5c) - #1 0x194be60dc (<unknown module>) - -0x000102037e6a is located 6 bytes after global variable '.str' defined in 'testoverflow.c' (0x102037e60) of size 4 +testoverflow(74528,0x1fd223840) malloc: nano zone abandoned due to inability to reserve vm space. +================================================================= +==74528==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000102b6feaa at pc 0x000102b6fdf0 bp 0x00016d292a10 sp 0x00016d292a08 +READ of size 1 at 0x000102b6feaa thread T0 + #0 0x102b6fdec in main+0x84 (testoverflow:arm64+0x100003dec) + #1 0x197d8c270 (<unknown module>) + +0x000102b6feaa is located 6 bytes after global variable '.str' defined in 'testoverflow.c' (0x102b6fea0) of size 4 '.str' is ascii string 'foo' -SUMMARY: AddressSanitizer: global-buffer-overflow (testoverflow:arm64+0x100003d5c) in main+0x84 +SUMMARY: AddressSanitizer: global-buffer-overflow (testoverflow:arm64+0x100003dec) in main+0x84 Shadow bytes around the buggy address: - 0x000102037b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037d80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -=>0x000102037e00: 00 00 00 00 00 00 00 00 00 00 00 00 04[f9]f9 f9 - 0x000102037e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102037f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102038000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 0x000102038080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6fc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6fc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6fd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6fd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6fe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +=>0x000102b6fe80: 00 00 00 00 04[f9]f9 f9 00 00 00 00 00 00 00 00 + 0x000102b6ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b6ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b70000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b70080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 + 0x000102b70100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 @@ -21442,7 +21444,7 @@Checking Memory Usage with ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb -==53517==ABORTING +==74528==ABORTING
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/76616918.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/76616918.py", line 2, in <cell line: 1> y = my_square_root(-1) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2617682038.py", line 2, in my_square_root + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2617682038.py", line 2, in my_square_root assert x >= 0 AssertionError (expected)@@ -21850,11 +21852,11 @@
Traceback (most recent call last): - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/1296110967.py", line 2, in <cell line: 1> + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/1296110967.py", line 2, in <cell line: 1> x = managed_mem[2] - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2465984283.py", line 3, in __getitem__ + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2465984283.py", line 3, in __getitem__ return self.read(address) - File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_53336/2898840933.py", line 9, in read + File "/var/folders/n2/xd9445p97rb3xh7m1dfx8_4h0006ts/T/ipykernel_74444/2898840933.py", line 9, in read assert self.allocated[address], \ AssertionError: Reading from unallocated memory (expected)diff --git a/docs/slides/ChangeCounter.slides.html b/docs/slides/ChangeCounter.slides.html index c9b9ff25..18699ed9 100644 --- a/docs/slides/ChangeCounter.slides.html +++ b/docs/slides/ChangeCounter.slides.html @@ -15220,7 +15220,7 @@
[<pydriller.domain.commit.ModifiedFile at 0x1054f6770>]+
[<pydriller.domain.commit.ModifiedFile at 0x10b82efe0>]
144.13216316599573+
306.42190745903645
[('notebooks', 'Intro_Debugging.ipynb'), - ('html', 'custom.css'), - ('Chapters.makefile',), - ('notebooks', '02_Observing.ipynb'), - ('notebooks', '04_Reducing.ipynb'), +@@ -16550,13 +16550,7 @@[('requirements.txt',), ('notebooks', 'PerformanceDebugger.ipynb'), - ('notebooks', 'ThreadDebugger.ipynb'), - ('notebooks', 'Debugger.ipynb'), - ('notebooks', 'Tracer.ipynb'), - ('binder', 'postBuild')]+ ('notebooks', 'PICS', 'scalene-out.png'), + ('notebooks', 'ChangeCounter.ipynb'), + ('notebooks', 'ChangeDebugger.ipynb'), + ('notebooks', 'DDSetDebugger.ipynb'), + ('notebooks', 'DeltaDebugger.ipynb'), + ('notebooks', 'Repairer.ipynb'), + ('notebooks', 'Slicer.ipynb'), + ('notebooks', 'StatisticalDebugger.ipynb')]
['New: (Incomplete) chapters on performance and concurrency debugging', - 'New: moved StackInspector in its own module', - "New: mark (pretty much) all chapters as 'ready'", - 'Doc fix', - 'New: release first chapters', - 'New: PerformanceDebugger goes live', - 'New: Publish repair chapter', +['New: Publish repair chapter', 'New chapter: Tracking', 'New: ChangeCounter is public', 'New: do not check types in fuzzingbook (yet)', @@ -16566,6 +16560,11 @@Counting ChangesCounting ChangesVisualizing Past Changes -
+ + + + + + + +++ +++Slide content +++ + + + +++Slide content +