Xcode keeps crashing when compiling or aborting execution of a code in c

Hi i'm new to Xcode and i have this issue i can't fix. I open up Xcode and load project in c, it works fine on the first build, then when i try to rebuild the code it crashes with the following log. It also happens when i stop the execution if the code. i cutted out a part of the log because there is 7k characters limit


Process:               Xcode [940]
Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               15.0.1 (22266)
Build Info:            IDEApplication-22266000000000000~15 (15A507)
App Item ID:           497799835
App External ID:       860559424
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2023-11-24 09:00:02.7578 +0100
OS Version:            macOS 14.0 (23A344)
Report Version:        12
Anonymous UUID:        4F0BC142-5BCC-80DA-2B00-CFC8714B5F44


Time Awake Since Boot: 350 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000

Termination Reason:    Namespace SIGNAL, Code 6 Abort trap: 6
Terminating Process:   Xcode [940]

Application Specific Information:
abort() called

Application Specific Signatures:
NSInvalidArgumentException

Application Specific Backtrace 0:
0   CoreFoundation                      0x000000018b5008c0 __exceptionPreprocess + 176
1   DVTFoundation                       0x00000001069ebe30 DVTFailureHintExceptionPreprocessor + 388
2   libobjc.A.dylib                     0x000000018aff9eb4 objc_exception_throw + 60
3   CoreFoundation                      0x000000018b5f2b3c -[__NSCFString characterAtIndex:].cold.1 + 0
4   CoreFoundation                      0x000000018b477f54 -[NSConstantDictionary objectForKey:] + 0
5   SourceEditor                        0x0000000117b8c3ec $s12SourceEditor0ab4DataA0C17deleteTextInRangeyAA0aB8PositionVSnyAFGF + 2300
6   IDEConsoleKit                       0x000000011732afb4 $s13IDEConsoleKit0A4ViewC21removeAllConsoleItems33_16D2ADED863F10BE3A741D5B18B494B7LLyyF + 516
7   IDEConsoleKit                       0x0000000117328c7c $s13IDEConsoleKit0A4ViewC10setMatchesyySaySo0A4ItemCGF + 712
8   IDEConsoleKit                       0x00000001172e2328 $s13IDEConsoleKit0A13FilterManagerC13filterConsole33_2971D1EE5E4DDD5D099E1A896C78B97ALL011incrementalC0ySb_tFyycfU1_ + 128
9   IDEConsoleKit                       0x00000001172cb158 $sIeg_IeyB_TR + 28
10  DVTFoundation                       0x0000000106a8aa48 $sIeg_IeyB_TR + 28
11  DVTFoundation                       0x0000000106a2f330 __DVT_CALLING_CLIENT_BLOCK__ + 16
12  DVTFoundation                       0x0000000106a2fcf0 __DVTDispatchAsync_block_invoke + 48
13  libdispatch.dylib                   0x000000018b1ffcb8 _dispatch_call_block_and_release + 32
14  libdispatch.dylib                   0x000000018b201910 _dispatch_client_callout + 20
15  libdispatch.dylib                   0x000000018b20ffa8 _dispatch_main_queue_drain + 984
16  libdispatch.dylib                   0x000000018b20fbc0 _dispatch_main_queue_callback_4CF + 44
17  CoreFoundation                      0x000000018b4cd220 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
18  CoreFoundation                      0x000000018b48aaac __CFRunLoopRun + 1996
19  CoreFoundation                      0x000000018b489c2c CFRunLoopRunSpecific + 608
20  HIToolbox                           0x00000001959e2448 RunCurrentEventLoopInMode + 292
21  HIToolbox                           0x00000001959e20d8 ReceiveNextEventCommon + 220
22  HIToolbox                           0x00000001959e1fdc _BlockUntilNextEventMatchingListInModeWithFilter + 76
23  AppKit                              0x000000018ec64f90 _DPSNextEvent + 660
24  AppKit                              0x000000018f438b94 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
25  DVTKit                              0x00000001058a0a9c -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 300
26  AppKit                              0x000000018ec5843c -[NSApplication run] + 476
27  DVTKit                              0x000000010589fcbc -[DVTApplication run] + 60
28  AppKit                              0x000000018ec2f708 NSApplicationMain + 880
29  dyld                                0x000000018b035058 start + 2224

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	       0x18b37711c __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x18b3aecc0 pthread_kill + 288
2   libsystem_c.dylib             	       0x18b2bea50 abort + 180
3   IDEKit                        	       0x10a4f8d58 +[IDEAssertionHandler _handleAssertionWithLogString:assertionSignature:assertionReason:extraBacktrace:] + 972
4   IDEKit                        	       0x10a4f9e88 -[IDEAssertionHandler handleUncaughtException:] + 596
5   IDEKit                        	       0x10a4fa1b8 IDEHandleUncaughtException + 68
6   CoreFoundation                	       0x18b5a4f84 __handleUncaughtException + 800
7   libobjc.A.dylib               	       0x18b003888 _objc_terminate() + 132
8   libc++abi.dylib               	       0x18b365a9c std::__terminate(void (*)()) + 16
9   libc++abi.dylib               	       0x18b365a40 std::terminate() + 56
10  libdispatch.dylib             	       0x18b201924 _dispatch_client_callout + 40
11  libdispatch.dylib             	       0x18b20ffa8 _dispatch_main_queue_drain + 984
12  libdispatch.dylib             	       0x18b20fbc0 _dispatch_main_queue_callback_4CF + 44
13  CoreFoundation                	       0x18b4cd220 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
14  CoreFoundation                	       0x18b48aaac __CFRunLoopRun + 1996
15  CoreFoundation                	       0x18b489c2c CFRunLoopRunSpecific + 608
16  HIToolbox                     	       0x1959e2448 RunCurrentEventLoopInMode + 292
17  HIToolbox                     	       0x1959e20d8 ReceiveNextEventCommon + 220
18  HIToolbox                     	       0x1959e1fdc _BlockUntilNextEventMatchingListInModeWithFilter + 76
19  AppKit                        	       0x18ec64f90 _DPSNextEvent + 660
20  AppKit                        	       0x18f438b94 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
21  DVTKit                        	       0x1058a0a9c -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 300
22  AppKit                        	       0x18ec5843c -[NSApplication run] + 476
23  DVTKit                        	       0x10589fcbc -[DVTApplication run] + 60
24  AppKit                        	       0x18ec2f708 NSApplicationMain + 880
25  dyld                          	       0x18b035058 start + 2224