View Issue Details

IDProjectCategoryView StatusLast Update
0005948GNUnetutil librarypublic2020-04-22 17:27
ReporternikitaAssigned Tonikita 
PrioritynormalSeverityminorReproducibilityhave not tried
Status feedbackResolutionopen 
Product Version0.11.6 
Target Version0.13.0Fixed in Version 
Summary0005948: idn / idn2 detection logic must be improved
Descriptionit works in not so obvious ways right now, not as intended
Additional Informationdnsparser.c: In function 'GNUNET_DNSPARSER_check_label':
dnsparser.c:65:7: error: 'IDNA_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
   if (IDNA_SUCCESS != idna_to_ascii_8z (label, &output, IDNA_ALLOW_UNASSIGNED))
       ^~~~~~~~~~~~
       EXIT_SUCCESS
dnsparser.c:65:7: note: each undeclared identifier is reported only once for each function it appears in
dnsparser.c:65:23: warning: implicit declaration of function 'idna_to_ascii_8z' [-Wimplicit-function-declaration]
   if (IDNA_SUCCESS != idna_to_ascii_8z (label, &output, IDNA_ALLOW_UNASSIGNED))
                       ^~~~~~~~~~~~~~~~
dnsparser.c:65:57: error: 'IDNA_ALLOW_UNASSIGNED' undeclared (first use in this function)
   if (IDNA_SUCCESS != idna_to_ascii_8z (label, &output, IDNA_ALLOW_UNASSIGNED))
                                                         ^~~~~~~~~~~~~~~~~~~~~
dnsparser.c: In function 'GNUNET_DNSPARSER_check_name':
dnsparser.c:101:7: error: 'IDNA_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
   if (IDNA_SUCCESS != idna_to_ascii_8z (name, &output, IDNA_ALLOW_UNASSIGNED))
       ^~~~~~~~~~~~
       EXIT_SUCCESS
dnsparser.c:101:56: error: 'IDNA_ALLOW_UNASSIGNED' undeclared (first use in this function)
   if (IDNA_SUCCESS != idna_to_ascii_8z (name, &output, IDNA_ALLOW_UNASSIGNED))
                                                        ^~~~~~~~~~~~~~~~~~~~~
dnsparser.c: In function 'parse_name':
dnsparser.c:232:3: error: unknown type name 'Idna_rc'
   Idna_rc rc;
   ^~~~~~~
dnsparser.c:256:11: error: 'IDNA_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
       if (IDNA_SUCCESS !=
           ^~~~~~~~~~~~
           EXIT_SUCCESS
dnsparser.c:257:17: warning: implicit declaration of function 'idna_to_unicode_8z8z' [-Wimplicit-function-declaration]
           (rc = idna_to_unicode_8z8z (tmp, &utf8, IDNA_ALLOW_UNASSIGNED)))
                 ^~~~~~~~~~~~~~~~~~~~
dnsparser.c:257:51: error: 'IDNA_ALLOW_UNASSIGNED' undeclared (first use in this function)
           (rc = idna_to_unicode_8z8z (tmp, &utf8, IDNA_ALLOW_UNASSIGNED)))
                                                   ^~~~~~~~~~~~~~~~~~~~~
In file included from ../../src/include/gnunet_crypto_lib.h:59,
                 from ../../src/include/gnunet_util_lib.h:64,
                 from dnsparser.c:44:
dnsparser.c:262:21: warning: implicit declaration of function 'idna_strerror'; did you mean 'gcry_strerror'? [-Wimplicit-function-declaration]
                     idna_strerror (rc));
                     ^~~~~~~~~~~~~
../../src/include/gnunet_common.h:554:39: note: in definition of macro 'GNUNET_log'
           GNUNET_log_nocheck ((kind), __VA_ARGS__); \
                                       ^~~~~~~~~~~
dnsparser.c:260:24: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'int' [-Wformat=]
                     _ ("Failed to convert DNS IDNA name `%s' to UTF-8: %s\n"),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/include/gnunet_common.h:554:39: note: in definition of macro 'GNUNET_log'
           GNUNET_log_nocheck ((kind), __VA_ARGS__); \
                                       ^~~~~~~~~~~
dnsparser.c:260:21: note: in expansion of macro '_'
                     _ ("Failed to convert DNS IDNA name `%s' to UTF-8: %s\n"),
                     ^
dnsparser.c: In function 'GNUNET_DNSPARSER_builder_add_name':
dnsparser.c:900:3: error: unknown type name 'Idna_rc'
   Idna_rc rc;
   ^~~~~~~
dnsparser.c:905:7: error: 'IDNA_SUCCESS' undeclared (first use in this function); did you mean 'EXIT_SUCCESS'?
   if (IDNA_SUCCESS !=
       ^~~~~~~~~~~~
       EXIT_SUCCESS
dnsparser.c:906:50: error: 'IDNA_ALLOW_UNASSIGNED' undeclared (first use in this function)
       (rc = idna_to_ascii_8z (name, &idna_start, IDNA_ALLOW_UNASSIGNED)))
                                                  ^~~~~~~~~~~~~~~~~~~~~
In file included from ../../src/include/gnunet_crypto_lib.h:59,
                 from ../../src/include/gnunet_util_lib.h:64,
                 from dnsparser.c:44:
dnsparser.c:910:19: warning: format '%s' expects argument of type 'char *', but argument 4 has type 'int' [-Wformat=]
                   "Failed to convert UTF-8 name `%s' to DNS IDNA format: %s\n"),
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/include/gnunet_common.h:554:39: note: in definition of macro 'GNUNET_log'
           GNUNET_log_nocheck ((kind), __VA_ARGS__); \
                                       ^~~~~~~~~~~
dnsparser.c:909:17: note: in expansion of macro '_'
                 _ (
                 ^
*** [dnsparser.lo] Error code 1

make[3]: stopped in /usr/work/wip/gnunet/work/gnunet-0.11.6/src/util
1 error

make[3]: stopped in /usr/work/wip/gnunet/work/gnunet-0.11.6/src/util
*** [all-recursive] Error code 1

make[2]: stopped in /usr/work/wip/gnunet/work/gnunet-0.11.6/src
1 error

make[2]: stopped in /usr/work/wip/gnunet/work/gnunet-0.11.6/src
*** [all-recursive] Error code 1

make[1]: stopped in /usr/work/wip/gnunet/work/gnunet-0.11.6
1 error

make[1]: stopped in /usr/work/wip/gnunet/work/gnunet-0.11.6
*** [all] Error code 2

make: stopped in /usr/work/wip/gnunet/work/gnunet-0.11.6
1 error

make: stopped in /usr/work/wip/gnunet/work/gnunet-0.11.6
*** Error code 2

Stop.
make[1]: stopped in /usr/pkgsrc/wip/gnunet
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/wip/gnunet
TagsNo tags attached.

Activities

Christian Grothoff

2019-10-26 14:41

manager   ~0015028

Please attach the gnunet_config.h you got on the platform.

nikita

2019-10-26 15:10

developer  

gnunet_config.h (24,114 bytes)

nikita

2019-10-26 15:14

developer   ~0015029

Last edited: 2019-10-26 15:17

View 2 revisions

I do not get this with master in my user environment.

also the gnunet_config.h seems pretty clear about the problem, reading it now - there is no IDN at all.

in pkgsrc, relevant snippet I pass in:

# idn is mandatory but idn or idn2 can be used with a preference
# for idn2.
.if !empty(PKG_OPTIONS:Midn)
.include "../../devel/libidn2/buildlink3.mk"
CONFIGURE_ARGS+= --with-libidn2=${BUILDLINK_PREFIX.libidn2}
.else
.include "../../devel/libidn/buildlink3.mk"
CONFIGURE_ARGS+= --with-libidn=${BUILDLINK_PREFIX.libidn}
.endif


so the configure switch + the path is passed, which is confusing why we end up with no idn at all in this context.
It works when I don't add the "idn" option - then I had "idn 1".

nikita

2019-10-26 15:25

developer   ~0015031

Last edited: 2019-10-26 15:26

View 2 revisions

This results in idn2_msg being "yes", ie idn2 is found:

checking idna.h usability... no
checking idna.h presence... no
checking for idna.h... no
checking idn/idna.h usability... no
checking idn/idna.h presence... no
checking for idn/idna.h... no
checking if libidn can be used... configure: Checking for libidn2
checking for idn2_to_unicode_8z8z in -lidn2... yes

I think I'll have a look at the detection code. Of course some of these messages could be wrong since autotools does sometimes not include necessary libraries on other systems.

nikita

2019-10-26 15:31

developer   ~0015032

the config.log results seem suspicious.

config.log (548,627 bytes)

nikita

2019-10-31 09:15

developer   ~0015045

I'll fix the configure script.


Niclas Rosenvik / NetBSD:

I don't know really but I believe that the problem is in the configure
script. Setting --with-libidn2 makes configure search for idna.h when
it should search for idn2.h. I tried using --with-libidn=no without
setting --with-libidn2, that makes configure search for idn2.h after
it finds libidn2. --with-libidn2 disables search of idn2.h for me at
least. And for me it is the same behavior of I call ./configure
directly as if I run bmake configure. You can try to have
--with-libidn=no in options.mk instead of
--with-libidn2=${BUILDLINK_PREFIX.libidn2} and see how that works.
I know its a little backwards to have the idn option turn of libidn but
it seems to work.

schanzen

2019-12-20 13:10

manager   ~0015197

Is this fixed?

nikita

2020-04-05 01:48

developer   ~0015529

Last edited: 2020-04-17 16:40

View 2 revisions

I'll take a look this until end of May if I had this fixed earlier.

Issue History

Date Modified Username Field Change
2019-10-26 12:06 nikita New Issue
2019-10-26 12:06 nikita Status new => assigned
2019-10-26 12:06 nikita Assigned To => Christian Grothoff
2019-10-26 14:41 Christian Grothoff Note Added: 0015028
2019-10-26 15:10 nikita File Added: gnunet_config.h
2019-10-26 15:14 nikita Note Added: 0015029
2019-10-26 15:17 nikita Note Edited: 0015029 View Revisions
2019-10-26 15:25 nikita Note Added: 0015031
2019-10-26 15:26 nikita Note Edited: 0015031 View Revisions
2019-10-26 15:31 nikita File Added: config.log
2019-10-26 15:31 nikita Note Added: 0015032
2019-10-31 09:14 nikita Assigned To Christian Grothoff => nikita
2019-10-31 09:15 nikita Note Added: 0015045
2019-10-31 09:25 nikita Summary gcc 8: many "IDNA_" undeclared errors with idn2 in dnsparser.c => idn / idn2 detection logic must be improved
2019-10-31 09:25 nikita Description Updated View Revisions
2019-12-20 13:10 schanzen Status assigned => feedback
2019-12-20 13:10 schanzen Note Added: 0015197
2019-12-20 13:10 schanzen Target Version => 0.12.1
2019-12-25 12:26 Christian Grothoff Target Version 0.12.1 => 0.12.2
2020-01-13 14:44 schanzen Target Version 0.12.2 => 0.12.3
2020-04-05 01:48 nikita Note Added: 0015529
2020-04-17 16:40 nikita Note Edited: 0015529 View Revisions
2020-04-22 17:27 schanzen Target Version 0.12.3 => 0.13.0