l$ bin/curl -V
curl 7.35.0 (i386-unknown-freebsd9.2) libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: GSS-Negotiate IDN Largefile NTLM NTLM_WB SSL libz TLS-SRP
$ bin/curl --verbose --negotiate -u : http://hostname:8080/manager/html
Hostname was NOT found in DNS cache
Trying 1.2.3.4...
* Connected to hostname (1.2.3.4) port 8080 (#0)
GET /manager/html HTTP/1.1
User-Agent: curl/7.35.0
Host: hostname:8080
Accept: /< HTTP/1.1 401 Unauthorized
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Cache-Control: private
< Expires: Thu, 01 Jan 1970 01:00:00 CET
Segmentation fault: 11 (Speicherabzug geschrieben)
Curl crashes with segmentation fault. I am on:
uname -a
FreeBSD hostname2 9.2-STABLE FreeBSD 9.2-STABLE
Core files can be provided on request.
Thanks! Any chance you can (re-)build with debug symbols and get us a back trace with gdb on that crash?
What exact features shall I enable in the configure script?
While checking Google for the backtrace in GDB, it seems to be straight forward. So, yes: I will provide the files you need.
Do these steps:
$ ./configure --enable-debug (plus whatever extra options you need)
$ make
$ ./src/curl --verbose --negotiate -u : http://hostname:8080/manager/html
core dump
If you get a core dump there, you can analyze it with gdb like:
$ gdb src/curl core
(gdb) where
... where shows the stack trace and is super interesting.
If you don't get a core dump, you can catch the crash without it like this:
$ gdb --args ./src/curl --verbose --negotiate -u : http://hostname:8080/manager/html
(gdb) run
(BOOM)
(gdb) where
As expected?
The stack trace is fine, but the problem is not expected to me. The crash is clearly within libkrb5.so.10 but it isn't so clear why or what input libcurl passes in that causes this!
Did this work in a previous version? Can we bisect to an offending change?
Daniel, I have tried:
They all crash. I have the feeling that it did not work at all. I do know that this is not related to the Heimdal setup because I am co-testing libserf's serf_get and it works as expected.
Could just as well be the GSSAPI lib that causes this. Closing for someone to research at some point in time.
It's not because I use libserf on the same machine with GSS-API and it works flawlessly.
Hi Daniel, I do have an update on the issue. It turned out that this is NOT a bug in curl but the base version in FreeBSD, Heimdal 1.1.0 is broken. The very same error has been observed in serf by me recently. This should apply to curl too. One would need to check in the configure script for the Heimdal version. See reference for serf: https://groups.google.com/forum/#!topic/serf-dev/6J3StLWgGIo
Sorry, but what would configure do if it finds heimdal? It seems like a user choice to use that, besides how can configure know if it is a broken version or not?
If it finds Heimdal, It would check for the version, of course I cannot say when the issue was fixed but 1.1.0 is base on FreeBSD and is broken. So it would be a simple version match with krb5-config --version.
FYI, I have just compiled curl from the ports tree against MIT Kerberos and it perfectly works.