diff --git a/PrintCapabilityValue.c b/PrintCapabilityValue.c new file mode 100644 index 0000000..3941cc2 --- /dev/null +++ b/PrintCapabilityValue.c @@ -0,0 +1,23 @@ +/* + + How do I printf a capability value + we use calloc() and still producing same results + However, the memory allocation with calloc() will be initialized to zero + + by Joseph Kaberuka +*/ + +#include +#include + +int main() { + +void *x =(void *)calloc(1, 1); +printf("The address in this capability is %p\n", x); +printf("The full capability (incl metadata) is %#p\n", x); +// Freeing the allocated memory +free(x); + +return 0; + +} diff --git a/buildsuccess.txt b/buildsuccess.txt new file mode 100644 index 0000000..68ae9cb --- /dev/null +++ b/buildsuccess.txt @@ -0,0 +1,9 @@ +1. Following the README file, when adapting the build configuration, the file cheribuild.json can be configured at ~/.config/cheribuild.json + +2. However, during my build with this file, unhandled exceptions has been issues time and time and prevented a successful build process + +3. I had to remove this file from ~/ directory and also from cheribuild cloned directory + +4. Removing the same file from both locations, python3 cheribuild.py run-morello-purecap completed successfully + + diff --git a/provenanceissue.c b/provenanceissue.c new file mode 100644 index 0000000..29222d9 --- /dev/null +++ b/provenanceissue.c @@ -0,0 +1,26 @@ +#include + +void myFunction(int *ptr){ +//trying to perform some operations with ptr + +} + +int main() { + +int array_data[5]={1,2,3,4,5}; + +int *ptr1 =array_data; + +//pass ptr to myFunction + +myFunction(ptr1); + +//attempt to access 'array_data' through 'ptr1' again + +int myValue =*ptr1; + +printf("myvalue : %d\n", myValue); + +return 0; + +}