Open adambom opened 11 years ago
Do you have the xcode command line tools installed?
and what do you get for Curl $ ls /usr/lib/libcurl* ? I have several libcurl libraries there. Sounds like you need to get it installed. Im not sure if I installed it myself, maybe via macports.
I installed curl via macports and now when I run $ ls /usr/lib/libcurl*
I get:
/usr/lib/libcurl.2.dylib /usr/lib/libcurl.4.dylib
/usr/lib/libcurl.3.dylib /usr/lib/libcurl.dylib
But still I get the Illegal instruction message. Don't know if I have xcode command line tools installed. How can I tell?
Open xcode and then go to preferences -> downloads. Mine looks like this:
Hmm... running old school snow leopard over here. No downloads tab. (Xcode 3.2.6). I think they are bundled by default in all versions prior to 4.3.
What does dlopen("libcurl")
produce in the julia console?
Ptr{Void} @0x0000000100f8045
What about when you do this?
julia> p = ccall( (:curl_version, "libcurl"), Ptr{Uint8}, ())
Ptr{Uint8} @0x00007fff7f7a8ca0
julia> bytestring(p)
"libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5"
This is a different computer, but when I do that I get "libcurl/7.19.7 OpenSSL/0.9.8r zlib/1.2.3"
However, running Curl.get causes the process to hang indefinitely. When I get home I'll check on my other computer and post the results.
Building Julia 0.1 on Snow Leopard thinking that may fix the issue. Will indicate here if that fixes the problem.
Didn't fix it. Also tried running the build_constants shell script. Didn't help.
I'm running into exactly the same problem on a Centos 6 system:
julia> p = ccall( (:curl_version, "libcurl"), Ptr{Uint8}, ())
Ptr{Uint8} @0x0000003516c52a40
julia> bytestring(p)
"libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2"
$ julia -e 'using Curl; Curl.get("http://norvig.com/big.txt")'
Segmentation fault
(Sometimes it shows "Illegal instruction" instead.)
In gdb:
$ gdb --args julia -e 'using Curl; Curl.get("http://norvig.com/big.txt"); nothing'
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-56.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/kmsquire/bin/julia...done.
(gdb) run
Starting program: /home/kmsquire/bin/julia -e using\ Curl\;\ Curl.get\(\"http://norvig.com/big.txt\"\)\;\ nothing
...
<snip>
...
Program received signal SIGSEGV, Segmentation fault.
0x0000003516a2c390 in curl_easy_reset () from /usr/lib64/libcurl.so
So, this clearly seems to be a problem with the curl library that I have installed. curl itself seems to work fine, though.
Running on Ubuntu 12.04 (curl 7.22.0), I have no problem, so I'm wondering if perhaps the interface to one of the functions changed between 7.19 and 7.22...
It sometimes also happens in a different function:
Program received signal SIGSEGV, Segmentation fault.
0x0000003fcb62c40d in curl_easy_duphandle () from /usr/lib64/libcurl.so
julia> using Curl julia> Curl.get("http://jsonip.com") --Process exits-- Illegal instruction
Is this because I don't have libcurl? I didn't install this as a package either. Just git cloned and ran Julia.