diff --git a/src/crystal/system/unix/signal.cr b/src/crystal/system/unix/signal.cr index 58b1180f56ef..d0fdbf298391 100644 --- a/src/crystal/system/unix/signal.cr +++ b/src/crystal/system/unix/signal.cr @@ -153,7 +153,7 @@ module Crystal::System::Signal if is_stack_overflow Crystal::System.print_error "Stack overflow (e.g., infinite or very deep recursion)\n" else - Crystal::System.print_error "Invalid memory access (signal %d) at address 0x%lx\n", sig, addr + Crystal::System.print_error "Invalid memory access (signal %d) at address %p\n", sig, addr end Exception::CallStack.print_backtrace diff --git a/src/exception/call_stack/libunwind.cr b/src/exception/call_stack/libunwind.cr index 220db21b71f0..81943d99f376 100644 --- a/src/exception/call_stack/libunwind.cr +++ b/src/exception/call_stack/libunwind.cr @@ -102,7 +102,7 @@ struct Exception::CallStack end private def self.print_frame(repeated_frame) - Crystal::System.print_error "[0x%llx] ", repeated_frame.ip.address.to_u64 + Crystal::System.print_error "[%p] ", repeated_frame.ip.address print_frame_location(repeated_frame) Crystal::System.print_error " (%d times)", repeated_frame.count + 1 unless repeated_frame.count == 0 Crystal::System.print_error "\n" diff --git a/src/exception/call_stack/stackwalk.cr b/src/exception/call_stack/stackwalk.cr index f49c87fae623..4879ed8bb95d 100644 --- a/src/exception/call_stack/stackwalk.cr +++ b/src/exception/call_stack/stackwalk.cr @@ -37,7 +37,7 @@ struct Exception::CallStack case exception_info.value.exceptionRecord.value.exceptionCode when LibC::EXCEPTION_ACCESS_VIOLATION addr = exception_info.value.exceptionRecord.value.exceptionInformation[1] - Crystal::System.print_error "Invalid memory access (C0000005) at address 0x%llx\n", addr + Crystal::System.print_error "Invalid memory access (C0000005) at address %p\n", Pointer(Void).new(addr) print_backtrace(exception_info) LibC._exit(1) when LibC::EXCEPTION_STACK_OVERFLOW @@ -150,7 +150,7 @@ struct Exception::CallStack end private def self.print_frame(repeated_frame) - Crystal::System.print_error "[0x%llx] ", repeated_frame.ip.address.to_u64 + Crystal::System.print_error "[%p] ", repeated_frame.ip.address print_frame_location(repeated_frame) Crystal::System.print_error " (%d times)", repeated_frame.count + 1 unless repeated_frame.count == 0 Crystal::System.print_error "\n"