this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fixes for LLDB and Node.js

+36 -13
+8 -1
src/kernel/emulation/linux/mman/madvise.c
··· 4 4 #include "../../../../../platform-include/sys/errno.h" 5 5 #include <linux-syscalls/linux.h> 6 6 7 + #define MADV_FREE 5 8 + #define MADV_FREE_REUSABLE 7 9 + #define MADV_FREE_REUSE 8 10 + 7 11 long sys_madvise(void* addr, unsigned long len, int advice) 8 12 { 9 13 int ret; 10 14 15 + if (advice == MADV_FREE_REUSABLE || advice == MADV_FREE_REUSE) 16 + advice = MADV_FREE; 17 + 11 18 // advice < 0 are identical between OS X and Linux 12 19 // advice >= 5 are specific to OS X/BSD 13 20 if (advice >= 5) 14 - return -ENOTSUP; 21 + return 0; 15 22 16 23 ret = LINUX_SYSCALL(__NR_madvise, addr, len, advice); 17 24
+2 -1
src/kernel/emulation/linux/process/execve.c
··· 87 87 if (arg != NULL) 88 88 { 89 89 *arg = '\0'; // terminate interp 90 - while (isspace(*arg)) 90 + arg++; 91 + while (isspace(*arg) && *arg) 91 92 arg++; 92 93 if (*arg == '\0') 93 94 arg = NULL; // no argument, just whitespace
+26 -11
src/kernel/emulation/linux/signal/sigexc.c
··· 318 318 // SIGILL -> EXC_BAD_INSTRUCTION 319 319 // SIGFPE -> EXC_ARITHMETIC 320 320 // * -> EXC_SOFTWARE with EXC_SOFT_SIGNAL (e.g. SIGSTOP) 321 + kern_printf("sigexc_handler #2\n"); 321 322 322 - switch (bsd_signum) 323 + // Only real exceptions produced by the CPU get translated to these 324 + // Mach exceptions. The rest comes as EXC_SOFTWARE. 325 + if (info != NULL && info->si_code != 0) 323 326 { 324 - // Only real exceptions produced by the CPU get translated to these 325 - // Mach exceptions. The rest comes as EXC_SOFTWARE. 326 - if (info != NULL && info->si_code != 0) 327 - { 327 + switch (bsd_signum) 328 + { 328 329 case SIGSEGV: 329 330 mach_exception = EXC_BAD_ACCESS; 330 331 codes[0] = EXC_I386_GPFLT; ··· 356 357 } 357 358 } 358 359 break; 360 + default: 361 + mach_exception = EXC_SOFTWARE; 362 + codes[0] = EXC_SOFT_SIGNAL; 363 + codes[1] = bsd_signum; 359 364 } 360 - default: 361 - mach_exception = EXC_SOFTWARE; 362 - codes[0] = EXC_SOFT_SIGNAL; 363 - codes[1] = bsd_signum; 365 + } 366 + else 367 + { 368 + mach_exception = EXC_SOFTWARE; 369 + codes[0] = EXC_SOFT_SIGNAL; 370 + codes[1] = bsd_signum; 364 371 } 365 372 366 373 port = get_exc_port(mach_exception, &behavior); ··· 417 424 { 418 425 _pthread_setspecific_direct(SIGEXC_TSD_KEY, bsd_signum); 419 426 427 + kern_return_t ret; 428 + 420 429 if (behavior & MACH_EXCEPTION_CODES) 421 430 { 422 - mach_exception_raise(port, thread, mach_task_self(), mach_exception, codes, sizeof(codes) / sizeof(codes[0])); 431 + ret = mach_exception_raise(port, thread, mach_task_self(), mach_exception, codes, sizeof(codes) / sizeof(codes[0])); 423 432 } 424 433 else 425 434 { 426 435 exception_data_type_t small_codes[2] = { (exception_data_type_t) codes[0], (exception_data_type_t) codes[1] }; 427 - exception_raise(port, thread, mach_task_self(), mach_exception, small_codes, sizeof(small_codes) / sizeof(small_codes[0])); 436 + ret = exception_raise(port, thread, mach_task_self(), mach_exception, small_codes, sizeof(small_codes) / sizeof(small_codes[0])); 437 + } 438 + 439 + if (ret == MACH_RCV_PORT_DIED || ret == MACH_SEND_INVALID_DEST) 440 + { 441 + kern_printf("Exception handler death? ret is 0x%x\n", ret); 442 + darling_sigexc_uninstall(); 428 443 } 429 444 430 445 bsd_signum = _pthread_getspecific_direct(SIGEXC_TSD_KEY);