Open iradization opened 1 year ago
It appears that when the c'tor of loc is first created, the empty string ("") value should be written to this members of loc which are stored in __DATA_CONST section. Maybe the compiler should allow writing the __DATA_CONST section upon construction of constexpr like in this case, and prevent further writes from this point onward (I guess not). Or maybe this loc object should be stored in the heap, since it's created during runtime by the c'tor (so it shouldn't be constexpr only static)
I'm using macOS M1/M2 architecture with Xcode/LLVM compiler, Perhaps do you know if there's a compilation flag that enables it ?
constexpr
variables don't execute any code on construction, they are initialized at compile time.
Without seeing the disassembly around the crash address, it's hard to tell what exactly is going on.
The system_error
is constructed either here https://github.com/boostorg/asio/blob/ce07af1fdf532c22e6bfe161ded186cb356aa9c2/include/boost/asio/basic_socket.hpp#L861
and it's possible that ec.lc_flags_
at this point somehow stores an invalid pointer to source_location
, but why it would do so, isn't clear.
The location of the error code is probably set here https://github.com/boostorg/asio/blob/723eee7a402f5bd1c39a4821fc4951abfe0d0bbd/include/boost/asio/detail/reactive_socket_service.hpp#L587
although I'm not sure whether this is the right socket implementation for macOS.
I'm trying to figure out a crash dump that I got when initiating a boost implementation of unix domain socket.
What's strange about it is that the relevant frame is when it parsed the ec.what() which is a function that basically create a string message ...
Besides the callstack, I could generate a crash file with a crash reason
So It seems like when the ec message is created, we attempt to write a read only memory (DATA_CONST) . I think that this is the problematic code :
which is called from here
However, i don't understand where do we attempt to write to the const expression 'loc'... any idea what may be the reason ?