Marvee Amasi
Marvee Amasi
DIIDevHeads IoT Integration Server
Created by Marvee Amasi on 8/15/2024 in #firmware-and-baremetal
Segmentation Fault in C Function Printing Double from Assembly Code
From my_call.asm, %r12 points to memory allocated in the heap. The weird thing is that when I convert the double to an integer before calling printf , there is no segmentation fault by uncommenting the line in case 6 and commenting the line below , it comes out with the right result that is 5 . During debugging, I found the segmentation fault occured within the subroutines of the printf function where I can't see the code. Also even if I define a random double, I can't print it
6 replies