Library seems to reset SIGCHLD handling to default action (ignore)

Hi,

we are using Aspose Barcode 20.10 and have written the following simple method to generate a QR code in GIF format.

public static byte[] toGifImageBytes(String text, int mode, int ecl, int left, int top, int right, int bottom) throws Exception {
    AsposeLicenses.loadBarcodeLicense();
    BarCodeControl barcode = new BarCodeControl();
    barcode.setEncodeType(EncodeTypes.QR);
    barcode.setQREncodeMode(QREncodeMode.values()[mode]);
    barcode.setQRErrorLevel(QRErrorLevel.values()[ecl]);
    barcode.setCodeLocation(CodeLocation.NONE);
    barcode.setGraphicsUnit(GraphicsUnit.PIXEL);
    barcode.setMargins(new MarginsF(left, right, top, bottom));
    barcode.setCodeText(text);
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    barcode.save(os, BarCodeImageFormat.GIF);
    return os.toByteArray();
}

Here, the first line loads the license and the rest is standard Aspose code.

It seems to us that this code, when run on Linux, resets the handler for the SIGCHLD signal to its default behavior, which is to ignore the signal.
It then starts 3 external processes for some reason.
It does not reinstall the original signal handler for SIGCHLD afterwards.
This totally ruins our application, which depends on being able to catch this signal and act consequently.

Two questions:

  • What are the 3 processes launched by this code?
  • Why not save the original signal handler and reinstall it afterwards?

Regards
Mario

@mrossi,
We have noted your concerns and logged a ticket under id: BARCODEJAVA-1089 for detailed analysis. You will be notified here once any update is ready for sharing.

Sorry,

I mistakenly reported the issue under Aspose.Cells rather than under Aspose.BarCode, where it really belongs.
Can you move it there?

Regards
Mario

@monoff,

We have moved the thread to respective forum now.

@mrossi,
BarcodeControl is intended for Swing applications mainly.
Moreover this is deprecated and will be removed in the next release.
If you want to use exactly the class intended for Swing applications you should use BarCodeGeneratorControl which is the improved version of class for Swing application.

But for your purposes will be more appropriate to use the following code:

public static byte[] toGifImageBytes(String text, int mode, int ecl, int left, int top, int right, int bottom) throws Exception
{
BarcodeGenerator barcode = new BarcodeGenerator(EncodeTypes.QR);
System.out.println(QREncodeMode.values()[mode]);
barcode.getParameters().getBarcode().getQR().setQrEncodeMode(QREncodeMode.values()[mode]);
barcode.getParameters().getBarcode().getQR().setQrErrorLevel(QRErrorLevel.values()[ecl]);
barcode.getParameters().getBarcode().getCodeTextParameters().setLocation(CodeLocation.NONE);
barcode.getParameters().getBarcode().getPadding().getLeft().setPixels(left);
barcode.getParameters().getBarcode().getPadding().getRight().setPixels(right);
barcode.getParameters().getBarcode().getPadding().getTop().setPixels(top);
barcode.getParameters().getBarcode().getPadding().getBottom().setPixels(bottom);
barcode.setCodeText(text);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
return baos.toByteArray();
}

Please test this code for your case and share the results.