You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, that's a problem. `a` was accidentally allocated with zero size. Fix this like you see in `a2_matrix_mul.cpp` and things will work just fine.
@@ -470,7 +470,7 @@ Let us use the Address Sanitizer again to catch invalid pointer addresses at run
470
470
128 });
471
471
```
472
472
473
-
4. Understand what is happening
473
+
4. Putting together what we know
474
474
475
475
Looking at the error, we see that we were trying to read local index `LID(68, 3, 0)` , or global index `GID(468, 73, 0)` of either array `a` or array `b`. According to the text when the program ran (`Problem size: c(150,600) = a(150,300) * b(300,600)`) both of these indexes are in range, but are they?
476
476
@@ -488,6 +488,7 @@ Let us use the Address Sanitizer again to catch invalid pointer addresses at run
488
488
489
489
In `b1_matrix_mul_null_usm.cpp` a bad (in this case, null) pointer that is supposed to represent allocated memory on the device is inadvertently passed as an argument to a kernel. This example uses explicitly allocated device memory rather than SYCL buffers like the previous example.
490
490
491
+
#### Checking the Behavior using Multiple Backends
@@ -541,7 +542,7 @@ In `b1_matrix_mul_null_usm.cpp` a bad (in this case, null) pointer that is suppo
541
542
Segmentation fault (core dumped)
542
543
```
543
544
544
-
#### Attempting to Understand What Is Happening
545
+
#### Debugging the Problem
545
546
546
547
Why did we try with multiple backends? If one had shown correct or incorrect results, and one had crashed, we might be facing a race condition that only occasionally manifests as something that goes terribly wrong. Or one of the backbends might have a bug while the others do not. But here all three crash, so it's likely the program is doing something illegal to memory. The host CPU is a particularly good place to test for illegal memory accesses, because the CPU never allows pointers with an address within a few kilobytes of address `0x0`, while this may be legally allocated memory on the GPU.
0 commit comments