Hi Keith, Thank you for your review. >Thank you for the patch. I can confirm that this is independent of >architecture/OS. On x86_64 Fedora 43, we can also demonstrate the issue: >Is it >possible to write a test for this? >I apologize for being pedantic, but this is more accurately described as >a (abort due to a) std::logic_error. >Typo "predicissor". Did you mean "predecessor?” >Typo “After" >Please use "nullptr" instead. Sure. I will fix all the typos and make a small test case in v2 of this patch [in gdb.base test suite]. Will be changing the heading as well since this is a problem in many other targets. But I have one question below before I send a v2 of this patch. >While this fix does catch this one specific place, I wonder if this bug >lurks elsewhere. For example, in main.c, when getcwd() is called and >returns NULL, gdb warns the user and leaves current_directory as NULL. >Changing that so that current_directory isn't NULL also fixes this >problem and could prevent(?) other similar problems. Of course, that >kind of change could introduce some sort of API semantic inconsistencies >with current_directory which likely would require more (invasive) >changes. I did test other places where getcwd () is used. But the only thing is it is not causing any crash. I could not produce a similar issue when getcwd () is not able to get the current directory for any reason due to other files using getcwd(). What do you think is the best thing we can do? Should we then change the main.c file as well to handle getcwd () failing to make it uniform everywhere in GDB wherever possible since we are thinking there will be a way by which one can run into similar issue due to the same? Kindly let me know. Have a nice day ahead. Thanks and regards, Aditya.