impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Armstrong (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4957: Don't crash Impalad on LLVM fatal error
Date Wed, 08 Mar 2017 21:44:49 GMT
Tim Armstrong has posted comments on this change.

Change subject: IMPALA-4957: Don't crash Impalad on LLVM fatal error
......................................................................


Patch Set 4:

(6 comments)

http://gerrit.cloudera.org:8080/#/c/6318/2/be/src/codegen/llvm-codegen.cc
File be/src/codegen/llvm-codegen.cc:

PS2, Line 110: [[noreturn]] 
> As far as I understand, yes.
Thanks - make sense then


http://gerrit.cloudera.org:8080/#/c/6318/4/be/src/codegen/llvm-codegen.cc
File be/src/codegen/llvm-codegen.cc:

PS4, Line 111:  const std::string& reason,
Couldn't 'reason' be a reference to something allocated on the stack between this stack frame
and the try/catch stack from? It doesn't seem valid to throw it directly.


Line 148:   llvm::install_fatal_error_handler(LlvmCodegenHandleError);
I'm looking at the LLVM docs and it doesn't seem like there's any guarantee that LLVM will
be in a "sane" state when calling the error handler - LLVM seems to assume that the handler
won't throw and it can call exit(1) after it returns:

   install_fatal_error_handler - Installs a new error handler to be used whenever a serious
(non-recoverable) error is encountered by LLVM.

Is it worth the risks of trying to continue after we've got into a state that LLVM thinks
is non-recoverable? I don't think LLVM code is generally written to be exception-safe, since
their coding standard forbids exceptions.


Line 1026:       DCHECK(std::find(materialized_functions_.begin(), materialized_functions_.end(),
I'm concerned the N^2 loop could add to test execution time. Can we avoid that somehow? E.g.
build a temporary set of the function names #ifndef NDEBUG.


Line 1094:   } catch (std::string& reason) {
Consider creating a custom exception class instead of throwing a std::string.


Line 1095:     module_->dump();
Where does the dump() output go to? Would be good to comment.


-- 
To view, visit http://gerrit.cloudera.org:8080/6318
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I54706e261ed223eadde347b1184fb0102e03a3d6
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Michael Ho <kwho@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhecht@cloudera.com>
Gerrit-Reviewer: Jim Apple <jbapple-impala@apache.org>
Gerrit-Reviewer: Michael Ho <kwho@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstrong@cloudera.com>
Gerrit-HasComments: Yes

Mime
View raw message