anujphadke has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/9154


Change subject: IMPALA-6008: Creating a UDF from a shared library with a .ll 
extenion crashes impala
......................................................................

IMPALA-6008: Creating a UDF from a shared library with a .ll extenion
crashes impala

Impala crashes on creating a UDF from a shared library (.so file) which
was renamed to have .ll extension. CreateFile() call in GetSymbols() fails
and returns on error and does not close the codegen object. This patch
closes the codegen object on failure. This avoids hitting a DCHECK later
up in the stack.
The chain of failures also invokes the DiagnosticHandlerFn. RuntimeState
object is NULL when the DiagnosticHandlerFn gets called in this case.
This change also adds a check before accessing it for logging.

Testing:
Created a UDF using a shared object with a .ll extension (renamed a .so
object). This change returns the following error instead of crashing -

[localhost:21000] > create function foo4 (string, string) returns string
location '/tmp/test.ll' symbol='MyAwesomeUdf';
Query: create function foo4 (string, string) returns string location
'/tmp/test.ll' symbol='MyAwesomeUdf'
ERROR: AnalysisException: Could not load binary: /tmp/test.ll
Could not parse module /tmp/test.15137.0.ll: llvm.bitcode:2

Change-Id: Id060668802ca9c80367cdc0e8a823b968d549bbb
---
M be/src/codegen/llvm-codegen.cc
1 file changed, 9 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/54/9154/1
--
To view, visit http://gerrit.cloudera.org:8080/9154
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id060668802ca9c80367cdc0e8a823b968d549bbb
Gerrit-Change-Number: 9154
Gerrit-PatchSet: 1
Gerrit-Owner: anujphadke <apha...@cloudera.com>

Reply via email to