Environment:
- Boost: 1.91.0
- Arch: LoongArch (loongarch64)
- Compiler: GCC 15.2.1
Problem:
b2 crashes with std::length_error on basic commands like ./b2 --show-libraries.
Backtrace:
#11 var_defines (variable.cpp:84)
#12 guarded_main (jam.cpp:527)
#13 main (jam.cpp:694)
Root cause:
In variable.cpp:84, when an empty string is passed to var_defines(), string_view::find('=') returns npos, causing var to be constructed with npos as length. Then std::string{var.begin(), var.end()} tries to allocate 18446744073709551615 bytes -> length_error.
Environment:
Problem:
b2 crashes with std::length_error on basic commands like
./b2 --show-libraries.Backtrace:
Root cause:
In variable.cpp:84, when an empty string is passed to var_defines(), string_view::find('=') returns npos, causing var to be constructed with npos as length. Then std::string{var.begin(), var.end()} tries to allocate 18446744073709551615 bytes -> length_error.