openjdk 11 crash with SIGSEGV (0xb) at pc=0x00007f879bce3ec8, pid=9190, tid=9262 using opencv 4.5.1 on ubuntu 20.04
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openjdk-lts (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
I'm creating a sprin boot application that use opncv to read read n cams using rstp protocol an send images to am angular frontend.
After a few the java application died with this error:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f879b
#
# JRE version: OpenJDK Runtime Environment (11.0.11+9) (build 11.0.11+
# Java VM: OpenJDK 64-Bit Server VM (11.0.11+
# Problematic frame:
# C [libc.so.6+0xbeec8]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/
#
# An error report file with more information is saved as:
# /home/pietro/
#
# If you would like to submit a bug report, please visit:
# https:/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
the code is above
@Slf4j
public class WebCamService {
public WebCamService(
cam.setName(
String url;
if ( Strings.
url = String.format( CREDENTIAL_
} else {
url = camData.getUrl();
}
cam.setHost( url );
this.id = camData.getId();
if ( Strings.hasText( camData.
types = Arrays.asList( camData.
} else {
types = new ArrayList<
}
}
private static final String CREDENTIAL_
private static final String TOPIC_TEMPLATE = "/topic/%s%s";
private static final String IMG_VIDEO_TEMPLATE = "%s/%s";
private List<String> types;
@Autowired
private SimpMessagingTe
@Autowired
private NeuralProcessor neuralProcessor;
private WebCamViewer cam = new WebCamViewer();
private ExecutorService read;
private ExecutorService work;
@Value(
private String videoDirPath;
@Value(
private String imageDirPath;
private AtomicBoolean screenshot = new AtomicBoolean(
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public boolean startCam() {
cam.open();
if (!cam.isOpened()) {
log.error("Error opening video camera {}", cam.getName() );
} else {
read = Executors.
work = Executors.
String streamTopic = String.format( TOPIC_TEMPLATE, "", getId() );
String screenTopic = String.format( TOPIC_TEMPLATE, "screen_", getId() );
log.info("Video camera {} is opened", cam.getName() );
Object _self = this;
AtomicRefere
read.execute(() -> {
Mat f = new Mat();
int idx = 0;
while (!read.isShutdown() && cam.isOpened()) {
synchronized (_self) {
f.release();
if ( cam.read(f) ) {
}
}
}
});
work.execute(() -> {
int counter = 0;
int err = 0;
Mat f = new Mat();
List<DnnObject> objs = new ArrayList<
while (!work.isShutdown() && cam.isOpened()) {
Mat frame = null;
synchronized (_self) {
frame = atomicFrame.get();
if ( frame != null ) {
frame = f;
}
}
if (frame != null) {
if (frame.empty()) {
err++;
} else {
err = 0;
if (++counter % 15 == 0) {
counter = 0;
}
if ( screenshot.get() ) {
try {
if ( Utils.saveImage( frame, Utils.generateF
}
} catch (MessagingException e) {
} catch (IOException e) {
}
}
final Mat f1 = frame;
try {
} catch (MessagingException e) {
} catch (IOException e) {
}
}
frame.
if (err >= 10) {
stopCam();
}
}
}
});
}
return cam.isOpened();
}
public boolean stopCam() {
stopRecording();
if ( read != null && !read.isTermina
read.shutdown();
}
if ( work != null && !work.isTermina
work.shutdown();
}
cam.close();
return !cam.isOpened();
}
public void takeScreenshot() {
if ( cam.isOpened() ) {
screenshot.set( true );
}
}
public boolean isOn() {
return cam.isOpened();
}
}
where WebCamViewer is a simple wrapper of VideoCapture.
In the spring-boot starter class there is an executor that every 30 seconds call
System.
System.gc();
I'd appreciate any advice or direction on how to solve this, thanks
full statck trace here https:/
Hi, sorry for the late reply, is it still an issue with 11.0.20+8?