Endless loop when looking for barcodes

Hi

I cannot read barcodes for certain types. For example Code39Standard. It seems to loop endlessly. I tried adding a timeout but it never times out. I have to kill the process.

This is the 2019 C++ library.

Still awaiting the 2021 version with Swiss support and the bug fix for DataMatrix reading.

Thanks

Occurs second time I read some barcode types like Code39Standard. For example DataMatrix it does not happen - I can read it again and again.

Only thing that looks out of place is the PrepareForUnload that I call for each image I look for barcodes on…

std::list<BarcodeHelper::Barcode> BarcodeHelper::barcodes(const unsigned char* filedata, const size_t filesize, const std::wstring& barcodetype)

{
System::IO::MemoryStream::Ptr stream = System::MakeObjectSystem::IO::MemoryStream();
// TODO: is this really the best way of getting data into Aspose?
for (size_t i = 0; i < filesize; i++)
stream->WriteByte(*(filedata + i));
stream->set_Position(0);

std::list<Barcode> result;

System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>(stream, DecodeType::Code39Standard);

while (reader->Read() == true)
{
}

System::AsposeCppLibrary::PrepareForUnload(); // probably not the optimal place, but it is required before shutting down application, after reader->Read() has been called once

return result;

}

@bleze,
You may please create a new solution that can be compiled and executed here without any missing reference to reproduce the issue. Provide your sample images also for our reference. We will analyze the scenario and share our feedback accordingly.

Hi

Like I suspected the placement of PrepareForUnload is the cause of this. This function cannot be called twice, because it will cause the endless loop for Code39Standard and others (all 1D?).

Hopefully you can fix if for 21.2 release of C++?

NB! I cannot move this call due to the nature of the plugin system in my application.

To get sample to work, copy “0.png” to build folder. It will run barcode reader twice on it. Actually the image does not seem to matter. Any image will cause this error.

Thanks
barcodeendlessloop.zip (1.5 MB)

@bleze,
We have observed the issue and logged it in our database for further investigation. You will be notified here once any update is ready for sharing.

This issue is logged as:

BARCODECPP-444 - Endless loop when looking for barcodes

Datamatrix reading won’t be fixed in current C++ release and I cannot give ETA. There are broken Datamatrix L-pattern and currently we don’t have stable algorithm to restore this corruption.

But will C++ lib be updated more often than every second year? Because right now I do not have a good feeling in my stomach and won’t purchase 2 user licenses, until I’m confident Aspose is the way to go for reading and creating barcodes.

Where can I find the list of known issues and outstanding bugs in the upcoming release?

@bleze,
We have noted your concern and will share our feedback soon.

Please define soon :slight_smile:

@bleze,
We are sorry for the delay but this issue is still not resolved. We are trying to define some ETA for this issue and will share update when ready for sharing.

I have solved this issue myself, but I still need 21 version with Swiss support and any other bug fixes. ETA on that at least?

@bleze,

Could you please share issue ids, so we could track them and update you accordingly.

I have done that in different threads. Still no updates to C++ barcode lib since 2019…

@bleze,

Please follow up in those threads to get latest updates.

Each one you say you will report back, but never do

@bleze,

We are sorry but sometimes we could not resolve certain issues soon due to following reasons:

  1. Issue is complex or new feature.
  2. We have other priority (important) tasks on hand to be addressed.
  3. Issue may depend upon other modules to be fixed first.
    etc.

We recommend you to kindly do a fresh follow up into those threads. We will try to provide latest updates for your issue(s).

@bleze
First, please accept my apologizes for this delay and any inconvenience that this may have caused.

We’ve looked into your example. You 're trying to find Code39 barcodes but the image you’ve attached contains only one QR. Also you must be running your example in Debug mode. Unfortunately this mode is unavoidable slower than Release one.

Please try the updated example in Release mode:
barcodeendlessloop_2.zip (1.5 MB)

License file with the corresponded name should be placed in the same folder as “0.png”