Skip to contentSkip to conversation

segfault when cloning over https

DISCUSSION Jan Kasprzak 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello,

I am trying to use git for accessing the repository over https. I can run

git clone --bare http://www.fi.muni.cz/~kas/tmp/git.git

without problems, but when I change http to https, it either segfaults or fails with heap corruption detected:

$ git clone --bare https://www.fi.muni.cz/~kas/tmp/git.git
[...]
got f1a1aac6880f1c8f122c57c2380800ec54d10982
*** glibc detected *** git: double free or corruption (!prev): 0x00007f8455a90fe0 ***
======= Backtrace: =========
/lib64/libc.so.6[0xf8bec8]
/lib64/libc.so.6(cfree+0x76)[0xf8e486]
/lib64/libnsspem.so[0x7f845f3f2a75]
/lib64/libnsspem.so[0x7f845f3e1a56]
/lib64/libnsspem.so[0x7f845f3e71a9]
/lib64/libnsspem.so[0x7f845f3ee9c4]
/lib64/libnss3.so[0x7f846210dc4d]
/lib64/libnss3.so(PK11_CreateGenericObject+0x42)[0x7f846210ded2]
/usr/lib64/libcurl.so.4[0x14b129]
/usr/lib64/libcurl.so.4(Curl_nss_connect+0x622)[0x14b9f2]
/usr/lib64/libcurl.so.4(Curl_protocol_connect+0xd2)[0x12bd72]
/usr/lib64/libcurl.so.4[0x13efd3]
/usr/lib64/libcurl.so.4(curl_multi_perform+0x8b)[0x13f2ab]
git[0x49de9f]
git[0x49df2f]
git[0x4a0499]
git[0x4a081e]
git[0x49aa36]
git[0x494b41]
git[0x4942f3]
git[0x415674]
git[0x4041a3]
git[0x4043bc]
/lib64/libc.so.6(__libc_start_main+0xe6)[0xf32576]
git[0x403c69]
======= Memory map: ========
00110000-00157000 r-xp 00000000 08:01 113025474                          /usr/lib64/libcurl.so.4.1.0
00157000-00357000 ---p 00047000 08:01 113025474                          /usr/lib64/libcurl.so.4.1.0
[...]

I have tried this against various https servers hosting different
repositories, and from various distributions (including Fedora 7, Fedora 8, and Fedora 10, all x86_64), and from various git builds (1.6.0.6 from Fedora 10, 1.6.1.2 built from the source, etc.

Does anybody see the same problem? Do you use git over https at all?

It is possible to test against this repository:

http://www.fi.muni.cz/~kas/tmp/git.git
https://www.fi.muni.cz/~kas/tmp/git.git

You will have to add the following certificate to your ca-bundle.crt to access the repository:

-----BEGIN CERTIFICATE----- MIICsTCCAhoCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAkNaMRcwFQYD VQQIEw5DemVjaCBSZXB1YmxpYzENMAsGA1UEBxMEQnJubzEfMB0GA1UEChMWRmFj dWx0eSBvZiBJbmZvcm1hdGljczEMMAoGA1UECxMDQ1ZUMRowGAYDVQQDExFBZG1p bmlzdHJhdGl2YSBGSTEeMBwGCSqGSIb3DQEJARYPdW5peEBmaS5tdW5pLmN6MB4X DTk3MTExMDEyMDQyOVoXDTI1MDMyODEyMDQyOVowgaAxCzAJBgNVBAYTAkNaMRcw FQYDVQQIEw5DemVjaCBSZXB1YmxpYzENMAsGA1UEBxMEQnJubzEfMB0GA1UEChMW RmFjdWx0eSBvZiBJbmZvcm1hdGljczEMMAoGA1UECxMDQ1ZUMRowGAYDVQQDExFB ZG1pbmlzdHJhdGl2YSBGSTEeMBwGCSqGSIb3DQEJARYPdW5peEBmaS5tdW5pLmN6 MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMm0dLLgsMSwmYPZdYYDGNsdwK 04k9O5gTYk+S70+ygUsLQNL+VLYqprsfZkDelX2wea8oUkj69R8I+vF6N1E8Ubik 3c4RFqJB6tsnTJT1YplCFd7s1BZlGSEKHC3OzHYp19pnXc0IHgX404pgpmuXaq6R Xu+D8iboFKi60ZpsVQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAD7842aqJRKlFDzk LK8SpR8KZ/jYWSdzNrwCQfLAlAzo8wDTcC3hgnaiKHJq4ZvS9h2tnGWm+qEToQwB oKjKyR87zaFeEWu/tNxBNPkAXfX9jdyJ5ozDTVDpFLoLEZ5ppIuh/ZDbPhjTQZrc IFfjrlWlrKXmiH9hCSQ5R/lIlrnG
-----END CERTIFICATE-----

Please Cc: me directly, I am not a member of this list.

Thanks,

-Yenya

Signature · 3 lines
| Jan "Yenya" Kasprzak  <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839      Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/    Journal: http://www.fi.muni.cz/~kas/blog/ |
Quoted 2 lines
Quoted 2 lines

If you find yourself arguing with Alan Cox, you’re _probably_ wrong. <<
--James Morris in "How and Why You Should Become a Kernel Hacker" <<

#1 lore raw
Quoted 6 lines · Jan Kasprzak

without problems, but when I change http to https, it either segfaults or fails with heap corruption detected:

/lib64/libnsspem.so[0x7f845f3ee9c4] /lib64/libnss3.so[0x7f846210dc4d] /lib64/libnss3.so(PK11_CreateGenericObject+0x42)[0x7f846210ded2] /usr/lib64/libcurl.so.4[0x14b129]

This is a libcurl built to use a Fedora-patched NSS library for the SSL stuff. You could try to build your own libcurl with a different SSL library to see if that works fine, as then we could narrow this down a bit...

Signature · 1 line
 / daniel.haxx.se
#2 lore raw

Daniel Stenberg wrote:
: On Thu, 29 Jan 2009, Jan Kasprzak wrote:
:
: >without problems, but when I change http to https, it either segfaults or : >fails with heap corruption detected:
:
: >/lib64/libnsspem.so[0x7f845f3ee9c4]
: >/lib64/libnss3.so[0x7f846210dc4d]
: >/lib64/libnss3.so(PK11_CreateGenericObject+0x42)[0x7f846210ded2] : >/usr/lib64/libcurl.so.4[0x14b129]
:
: This is a libcurl built to use a Fedora-patched NSS library for the SSL : stuff. You could try to build your own libcurl with a different SSL library : to see if that works fine, as then we could narrow this down a bit...

Good guess! When I manually rebuild libcurl without nss and
with SSL, it works. I have forwarded this to Fedora bugzilla as

https://bugzilla.redhat.com/show_bug.cgi?id=483222

Thanks,

-Yenya

Signature · 3 lines
| Jan "Yenya" Kasprzak  <kas at {fi.muni.cz - work | yenya.net - private}> |
| GPG: ID 1024/D3498839      Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E |
| http://www.fi.muni.cz/~kas/    Journal: http://www.fi.muni.cz/~kas/blog/ |
Quoted 2 lines
Quoted 2 lines

If you find yourself arguing with Alan Cox, you’re _probably_ wrong. <<
--James Morris in "How and Why You Should Become a Kernel Hacker" <<