rdtr opened a new issue, #13601:
URL: https://github.com/apache/gluten/issues/13601

   ### Backend
   
   VL (Velox)
   
   ### Bug description
   
   ### Bug description
   
   **[Expected behavior]** When a worker of the parallel broadcast hash table 
build fails, the query fails with that worker's error.
   
   **[Actual behavior]** The JVM crashes with SIGSEGV in 
`Java_org_apache_gluten_vectorized_HashJoinBuilder_nativeBuild`.
   
   **Cause.** `HashJoinBuilder.nativeBuild` in 
`cpp/velox/jni/VeloxJniWrapper.cc` runs one task per build thread and waits 
with `folly::collectAll(futures).wait()`. That call discards the tasks' 
exceptions. A failed task leaves its entries in `otherTables` and 
`hashTableBuilders` null, and the code right after the wait dereferences them 
(`mainTable->prepareJoinTable(...)`, 
`hashTableBuilders[i]->joinHasNullKeys()`). The serial path (`numThreads == 1`) 
propagates the exception and is not affected.
   
   **Repro.** Call `nativeBuild` with `broadcastHashTableBuildThreads = 4` and 
a join key that is not in the build schema, so that `rowType->findChild` throws 
in each task. I reproduced it this way at 315117dc4 on Spark 4.0. I haven't 
seen it from a user query; any exception in a build task takes the same path.
   
   ### Gluten version
   
   main branch
   
   ### Spark version
   
   Spark-4.0.x
   
   ### Spark configurations
   
   `spark.gluten.sql.columnar.backend.velox.broadcastHashTableBuildThreads=4`
   
   ### System information
   
   _No response_
   
   ### Relevant logs
   
   ```bash
   #  SIGSEGV (0xb)
   # Problematic frame:
   # C  [libvelox.so+0x25e73c4]  
Java_org_apache_gluten_vectorized_HashJoinBuilder_nativeBuild+0x1884
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to