wedesoft / anymeal

AnyMeal is a free and open source recipe management software developed using SQLite3 and Qt5. It can manage a cookbook with more than 250,000 MealMaster recipes, thereby allowing to import, export, search, display, edit, and print them. AnyMeal is available for GNU/Linux and Microsoft Windows.
https://wedesoft.github.io/anymeal
GNU General Public License v3.0
56 stars 5 forks source link

librecode can hang for invalid conversions #40

Closed bkmgit closed 7 months ago

bkmgit commented 11 months ago

The tests require google test sources:

Might it be possible to directly link to a pre-compiled libgtest ? This could be added as an additional configuration option.

wedesoft commented 11 months ago

Ok, I have changed the configure script to look for Googletest source code as well as libgtest. I have tested it with both configurations. Let me know if I should make a new release with this change.

bkmgit commented 11 months ago

Thanks for this update. Tested on both Googletest 1.12 and 1.13 so can relax the version to at least include those. https://github.com/wedesoft/anymeal/pull/41 A new release would be great.

bkmgit commented 11 months ago

Recode exception test seems to timeout https://download.copr.fedorainfracloud.org/results/fed500/anymeal/fedora-rawhide-x86_64/06541861-anymeal/builder-live.log

On the command line trying

$ echo Äpfel > test.txt
$ recode utf8..ascii test.txt 
recode: /home/fedora/test.txt failed: Untranslatable input in step `ISO-10646-UCS-2..ANSI_X3.4-1968'
bkmgit commented 11 months ago

The following program also hangs:

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <recodext.h>

const char *program_name;

int
main (int argc, char *const *argv)
{
  program_name = argv[0];
  RECODE_OUTER outer = recode_new_outer (true);
  RECODE_REQUEST request = recode_new_request (outer);
  char input_buffer[10] = "Äpfel";
  char *output_buffer;
  size_t output_length;
  size_t input_length = 6;
  size_t output_allocated;
  bool success;

  success = recode_scan_request (request, "latin1..ascii");
  request->verbose_flag = true;
  success = recode_buffer_to_buffer(request,
                  input_buffer, input_length,
                  &output_buffer, &output_length, &output_allocated);
  if (success) printf("%s\n",output_buffer);

  recode_delete_request (request);
  recode_delete_outer (outer);

  exit (success ? 0 : 1);
}

So probably an issue with recode library.

wedesoft commented 7 months ago

I switched to iconv and released version 1.26. I hope this will work better since it is part of GNU libc.