zhouyifan279 commented on issue #5702:
URL:
https://github.com/apache/incubator-gluten/issues/5702#issuecomment-2105874050
A simplified program call reproduce this Bug.
```java
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
public class AttachListener {
public static void main(String[] args) throws InterruptedException {
File file = extractVeloxLibrary();
System.load(file.getAbsolutePath());
System.out.println("Library velox loaded");
Thread.sleep(Long.MAX_VALUE);
}
static File extractVeloxLibrary() {
String tmpdir = System.getProperty("java.io.tmpdir");
File file = new File(tmpdir, "libvelox.dylib");
if (file.exists()) {
file.delete();
}
try (InputStream is =
AttachListener.class.getResourceAsStream("/libvelox.dylib");
FileOutputStream fos = new FileOutputStream(file)) {
byte[] buffer = new byte[4096];
int read;
while ((read = is.read(buffer)) != -1) {
fos.write(buffer, 0, read);
}
} catch (java.io.IOException e) {
throw new RuntimeException("Failed to extract library", e);
}
return file;
}
}
```
Compile and run:
```bash
javac AttachListener.java
java -cp
/path/to/incubator-gluten/package/target/gluten-velox-bundle-spark3.5_2.12-osx_14.4_aarch_64-1.2.0-SNAPSHOT.jar:/path/to/spark-3.5.1-bin-hadoop3/jars/*:.
AttachListener
```
`jstack` also fails on `AttachListener` process.
--
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]