[ 
https://issues.apache.org/jira/browse/ARROW-2138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16361449#comment-16361449
 ] 

ASF GitHub Bot commented on ARROW-2138:
---------------------------------------

wesm closed pull request #1595: ARROW-2138: [C++] abort on failed debug check
URL: https://github.com/apache/arrow/pull/1595
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/cpp/src/arrow/allocator-test.cc b/cpp/src/arrow/allocator-test.cc
index 7c768be92..55cc203ba 100644
--- a/cpp/src/arrow/allocator-test.cc
+++ b/cpp/src/arrow/allocator-test.cc
@@ -51,8 +51,8 @@ TEST(stl_allocator, FreeLargeMemory) {
   uint8_t* data = alloc.allocate(100);
 
 #ifndef NDEBUG
-  EXPECT_EXIT(alloc.deallocate(data, 120), ::testing::ExitedWithCode(1),
-              ".*Check failed: \\(bytes_allocated_\\) >= \\(size\\)");
+  EXPECT_DEATH(alloc.deallocate(data, 120),
+               ".*Check failed: \\(bytes_allocated_\\) >= \\(size\\)");
 #endif
 
   alloc.deallocate(data, 100);
diff --git a/cpp/src/arrow/memory_pool-test.cc 
b/cpp/src/arrow/memory_pool-test.cc
index 0a4785d52..c5e3ef295 100644
--- a/cpp/src/arrow/memory_pool-test.cc
+++ b/cpp/src/arrow/memory_pool-test.cc
@@ -51,8 +51,8 @@ TEST(DefaultMemoryPoolDeathTest, FreeLargeMemory) {
   ASSERT_OK(pool->Allocate(100, &data));
 
 #ifndef NDEBUG
-  EXPECT_EXIT(pool->Free(data, 120), ::testing::ExitedWithCode(1),
-              ".*Check failed: \\(bytes_allocated_\\) >= \\(size\\)");
+  EXPECT_DEATH(pool->Free(data, 120),
+               ".*Check failed: \\(bytes_allocated_\\) >= \\(size\\)");
 #endif
 
   pool->Free(data, 100);
diff --git a/cpp/src/arrow/util/logging.h b/cpp/src/arrow/util/logging.h
index 39815f303..4ca4d2252 100644
--- a/cpp/src/arrow/util/logging.h
+++ b/cpp/src/arrow/util/logging.h
@@ -105,7 +105,7 @@ class CerrLog {
       std::cerr << std::endl;
     }
     if (severity_ == ARROW_FATAL) {
-      std::exit(1);
+      std::abort();
     }
   }
 
@@ -134,7 +134,7 @@ class FatalLog : public CerrLog {
     if (has_logged_) {
       std::cerr << std::endl;
     }
-    std::exit(1);
+    std::abort();
   }
 };
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [C++] Have FatalLog abort instead of exiting
> --------------------------------------------
>
>                 Key: ARROW-2138
>                 URL: https://issues.apache.org/jira/browse/ARROW-2138
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: C++
>            Reporter: Antoine Pitrou
>            Priority: Trivial
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> Not sure this is desirable, since {{util/logging.h}} was taken from glog, but 
> the various debug checks current {{std::exit(1)}} on failure. This is a clean 
> exit (though with an error code) and therefore doesn't trigger the usual 
> debugging tools such as gdb or Python's faulthandler. By replacing it with 
> something like {{std::abort()}} the exit would be recognized as a process 
> crash.
>  
> Thoughts?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to