forked from OSchip/llvm-project
				
			[asan] Override default sigaltstack setting on Android.
Android libc always sets altstack on non-main threads, but it is too small for our unwinder. With use_sigaltstack=1, override this setting with a larger one. llvm-svn: 201557
This commit is contained in:
		
							parent
							
								
									63a4af7346
								
							
						
					
					
						commit
						50bef914a6
					
				| 
						 | 
					@ -100,7 +100,8 @@ void SetAlternateSignalStack() {
 | 
				
			||||||
  stack_t altstack, oldstack;
 | 
					  stack_t altstack, oldstack;
 | 
				
			||||||
  CHECK_EQ(0, sigaltstack(0, &oldstack));
 | 
					  CHECK_EQ(0, sigaltstack(0, &oldstack));
 | 
				
			||||||
  // If the alternate stack is already in place, do nothing.
 | 
					  // If the alternate stack is already in place, do nothing.
 | 
				
			||||||
  if ((oldstack.ss_flags & SS_DISABLE) == 0) return;
 | 
					  // Android always sets an alternate stack, but it's too small for us.
 | 
				
			||||||
 | 
					  if (!SANITIZER_ANDROID && !(oldstack.ss_flags & SS_DISABLE)) return;
 | 
				
			||||||
  // TODO(glider): the mapped stack should have the MAP_STACK flag in the
 | 
					  // TODO(glider): the mapped stack should have the MAP_STACK flag in the
 | 
				
			||||||
  // future. It is not required by man 2 sigaltstack now (they're using
 | 
					  // future. It is not required by man 2 sigaltstack now (they're using
 | 
				
			||||||
  // malloc()).
 | 
					  // malloc()).
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue