helpGnuTLS - Support: sr #108189, gnutls_x509_crt_init(1) returns...


sr #108189: gnutls_x509_crt_init(1) returns null in neon

Submitted by:  Alexander Vershilov <qnikst>
Submitted on:  Tue Nov 27 09:40:08 2012  
Category: NonePriority: 5 - Normal
Severity: 3 - NormalStatus: Need Info
Privacy: PublicAssigned to: Nikos Mavrogiannopoulos <nmav>
Open/Closed: ClosedOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Wed Nov 28 10:33:13 2012, comment #7:

Thanks, that file (with minor fixes) fixed situation. I'll apply it in gentoo, and try to mail upstream.

Alexander Vershilov <qnikst>
Tue Nov 27 23:30:47 2012, comment #6:

One issue I noticed is on line 489 that size is not set to zero. The new attached file should fix the first warning, but I don't know whether the others are related (the gnutls line numbers in the file do not correspond to anything i can check).

(file #26985)

Nikos Mavrogiannopoulos <nmav>
Project AdministratorIn charge of this item.
Tue Nov 27 23:17:50 2012, comment #5:

Which version of gnutls did you use for this trace? It would be best to try with the latest version released (3.1.5).

Nikos Mavrogiannopoulos <nmav>
Project AdministratorIn charge of this item.
Tue Nov 27 20:34:32 2012, comment #4:

I think that problem is that neon incorrectly uses gnutls, the only reason I've filled a bug is that neon upsteam seems dead, and this error was introduced with some gnutls update. So any suggestions how to fix this error are welcome.

I've attached a valgrind log:

==13911== at 0x8C90344: gnutls_x509_crt_get_subject (x509.c:2362)

this is done after calling:

x509_crt_copy line 486 [1]

issuer = x509_crt_copy(issuer); // <- here returns null
cert = populate_cert(ne_calloc(sizeof *cert), issuer);


(file #26984)

Alexander Vershilov <qnikst>
Tue Nov 27 17:11:24 2012, comment #3:

Could you then try with valgrind? This function is very inprobable to cause an error because it is one of the most tested in our included tests. The issue could be somewhere unrelated due to a memory corruption or so.

Nikos Mavrogiannopoulos <nmav>
Project AdministratorIn charge of this item.
Tue Nov 27 12:51:18 2012, comment #2:

I also have no idea how that commit can be related to that error, but testing it and previous commits has a stable result (an error after and and success before). I can make an image of a system where I have tested, with a sets of a scripts. Also I can send a bisect history.

No, changing to '< 0' instead 'of != 0' haven't solved my issue (at least with latest gnutls), I'll check on the previous versions).

Alexander Vershilov <qnikst>
Tue Nov 27 10:05:37 2012, comment #1:

Hello the commit that you mention has only changes in text files so I don't know how it relates to the issue you notice. In any case if you fix the check to:

if (gnutls_x509_crt_init(&dest) < 0) {

(instead of != 0), does it fix the issue for you?

Nikos Mavrogiannopoulos <nmav>
Project AdministratorIn charge of this item.
Tue Nov 27 09:40:08 2012, original submission:

When neon is used with resent gnutls version it segfaults when it is used by subversion to checkout some https repositories. [1,2]

error was in code sample:

gnutls_x509_crt dest;

if (gnutls_x509_crt_init(&dest) != 0) {
return NULL;

I tried to find out when this behavior is introduced and find out that it's a commit:

50f0068ae327abce4f648cfb12132b0254f9afa8 [3]

And problem still persist in current gnutls versions.

How to reproduce:
1). install gnutls
2). install neon with gnutls support
3). install subversion
4). try to checkout svn repo (e.g.

Libraries and programs:

1). gnutls >= 2.99.4
2). neon-0.29.6
3). subversion 1.7.7


I can provide additional information if needed.

Alexander Vershilov <qnikst>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #26985:  ne_gnutls-2.c added by nmav (40kB - text/x-csrc)
file #26984:  subversion-neon-gnutls.log added by qnikst (5kB - text/x-log - valgrind result)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by nmav (Posted a comment)
  • -unavailable- added by qnikst (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat Feb 16 11:49:48 2013nmavOpen/ClosedOpen=>Closed
    Tue Nov 27 23:30:47 2012nmavAttached File-=>Added ne_gnutls-2.c, #26985
    Tue Nov 27 20:34:32 2012qnikstAttached File-=>Added subversion-neon-gnutls.log, #26984
    Tue Nov 27 17:11:24 2012nmavStatusNone=>Need Info
      Assigned toNone=>nmav

    Back to the top

    Powered by Savane 3.1-cleanup