Skip to content

Instantly share code, notes, and snippets.

@cmundi
Last active August 29, 2015 13:58
Show Gist options
  • Save cmundi/9927252 to your computer and use it in GitHub Desktop.
Save cmundi/9927252 to your computer and use it in GitHub Desktop.
Segfault with Julia compiled with LLVM 3.4
cmundi@space ~/julia-llvm34 $ gdb --ex run --args ./julia test_gadfly.jl
GNU gdb (GDB) 7.6.1 (Debian 7.6.1-1)
Copyright (C) 2013 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-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/kyle/julia-llvm34/usr/bin/julia...(no debugging symbols found)...done.
Starting program: /home/kyle/julia-llvm34/./julia test_gadfly.jl
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff2e31700 (LWP 17144)]
[Thread 0x7ffff2e31700 (LWP 17144) exited]
INFO: Nothing to be done
INFO: Nothing to be done
INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove
[New Thread 0x7ffff2e31700 (LWP 21974)]
[Thread 0x7ffff2e31700 (LWP 21974) exited]
[New Thread 0x7ffff2e31700 (LWP 22001)]
Program received signal SIGSEGV, Segmentation fault.
0x00007fffe7366000 in julia_write_to_ios_callback18825 ()
(gdb) bt
#0 0x00007fffe7366000 in julia_write_to_ios_callback18825 ()
#1 0x00007fffee02059e in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#2 0x00007ffff1147e19 in ?? () from /lib/x86_64-linux-gnu/libpng12.so.0
#3 0x00007ffff114dfa5 in png_write_info_before_PLTE () from /lib/x86_64-linux-gnu/libpng12.so.0
#4 0x00007ffff114e20d in png_write_info () from /lib/x86_64-linux-gnu/libpng12.so.0
#5 0x00007fffee02086b in ?? () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#6 0x00007fffee021169 in cairo_surface_write_to_png_stream () from /usr/lib/x86_64-linux-gnu/libcairo.so.2
#7 0x00007fffe7367084 in julia_write_to_png18824 () at /home/kyle/.julia/v0.3/Cairo/src/Cairo.jl:279
#8 0x00007fffe73670d7 in jlcall_julia_write_to_png18824 ()
#9 0x00007ffff6d4f8cf in jl_apply_generic () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#10 0x00007fffe739d81f in julia_finish18769 () at /home/kyle/.julia/v0.3/Compose/src/cairo_backends.jl:185
#11 0x00007fffe739d088 in julia_draw18761 () at /home/kyle/.julia/v0.3/Compose/src/canvas.jl:266
#12 0x00007ffff6d4f8cf in jl_apply_generic () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#13 0x00007fffe739e077 in julia_draw18760 () at /home/kyle/.julia/v0.3/Gadfly/src/Gadfly.jl:728
#14 0x00007ffff6d4f8cf in jl_apply_generic () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#15 0x00007ffff6d91ad8 in do_call () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#16 0x00007ffff6d90c20 in eval () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#17 0x00007ffff6da0c3a in jl_toplevel_eval_flex.part.2 () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#18 0x00007ffff6da16cd in jl_parse_eval_all () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#19 0x00007ffff6da188e in jl_load () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#20 0x00007ffff4c31d90 in julia_include1838 () at boot.jl:244
#21 0x00007ffff6d4f8cf in jl_apply_generic () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#22 0x00007ffff4373254 in julia_include_from_node116124 () at loading.jl:120
#23 0x00007ffff6d4f8cf in jl_apply_generic () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#24 0x00007ffff4d6235b in julia_process_options14691 () at client.jl:245
#25 0x00007ffff4d5f3e5 in julia__start14618 () at client.jl:310
#26 0x00007ffff4d5fa69 in jlcall_julia__start14618 () from /home/kyle/julia-llvm34/usr/bin/../lib/julia/sys.so
#27 0x00007ffff6d4f8cf in jl_apply_generic () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#28 0x0000000000401d4f in true_main ()
---Type <return> to continue, or q <return> to quit---
#29 0x00007ffff6d96d07 in julia_trampoline () from /home/kyle/julia-llvm34/usr/bin/../lib/libjulia.so
#30 0x000000000040196d in main ()
(gdb)
This appears to have *nothing* to do with Gadfly.
Platform is debian jessie (gcc 4.8.2)
Architecture is Core2 Duo (CONROE) -- yes, really, *that* old. :/ Have not repeated on newer hardware.
According to `dpkg -l` I have the following installed:
```
libcairo2 1.12.16-2
libpango-1.0-0 1.36.0-1
libpng12-0 1.2.49-5
libfontconfig1 2.11.0-2
```
I started with
```
$ git describe
v0.2.0-2305-g4def095
```
and did a completely squeaky clean build of Julia, with exactly three variances from `v0.2.0-2305-g4def095`:
1. `OPENBLAS_DYNAMIC_ARCH=0` in `Make.inc`
2. `LLVM_VER = 3.4` (see `deps/Versions.make` file below)
3. `OPENBLAS_VER = v0.2.9.rc2` (see `deps/Versions.make` file below)
The build is smooth, and `make testall` produces `SUCCESS` for all tests.
Note (log below) that I purged `~/.julia` cache in its entirety before running my test with Gadfly.
I've been having this problem with julia for several days up to and including `g4def095`.
If I build against LLVM 3.3 there is no segfault.
Again, for the tl;dr skimmers: the segfault seems to have nothing to do with Gadfly, and I haven't been clever enough or unlucky enough to trigger the fault any other way.
cmundi@space ~/julia-llvm34 $ rm -rf ~/.julia
cmundi@space ~/julia-llvm34 $ ./julia test_gadfly.jl
INFO: Initializing package repository /home/llvm34/.julia/v0.3
INFO: Cloning METADATA from git://github.com/JuliaLang/METADATA.jl
INFO: Cloning cache of BinDeps from git://github.com/JuliaLang/BinDeps.jl.git
INFO: Cloning cache of Cairo from git://github.com/JuliaLang/Cairo.jl.git
INFO: Cloning cache of Color from git://github.com/JuliaLang/Color.jl.git
INFO: Cloning cache of URIParser from git://github.com/loladiro/URIParser.jl.git
INFO: Installing BinDeps v0.2.12
INFO: Installing Cairo v0.2.12
INFO: Installing Color v0.2.9
INFO: Installing URIParser v0.0.1
INFO: Building Cairo
INFO: Package database updated
INFO: Cloning cache of ArrayViews from git://github.com/lindahua/ArrayViews.jl.git
INFO: Cloning cache of Blocks from git://github.com/tanmaykm/Blocks.jl.git
INFO: Cloning cache of Codecs from git://github.com/dcjones/Codecs.jl.git
INFO: Cloning cache of Compose from git://github.com/dcjones/Compose.jl.git
INFO: Cloning cache of DataArrays from git://github.com/JuliaStats/DataArrays.jl.git
INFO: Cloning cache of DataFrames from git://github.com/JuliaStats/DataFrames.jl.git
INFO: Cloning cache of Datetime from git://github.com/karbarcca/Datetime.jl.git
INFO: Cloning cache of Distance from git://github.com/JuliaStats/Distance.jl.git
INFO: Cloning cache of Distributions from git://github.com/JuliaStats/Distributions.jl.git
INFO: Cloning cache of GZip from git://github.com/kmsquire/GZip.jl.git
INFO: Cloning cache of Gadfly from git://github.com/dcjones/Gadfly.jl.git
INFO: Cloning cache of Hexagons from git://github.com/dcjones/Hexagons.jl.git
INFO: Cloning cache of Iterators from git://github.com/JuliaLang/Iterators.jl.git
INFO: Cloning cache of JSON from git://github.com/JuliaLang/JSON.jl.git
INFO: Cloning cache of Loess from git://github.com/dcjones/Loess.jl.git
INFO: Cloning cache of NumericExtensions from git://github.com/lindahua/NumericExtensions.jl.git
INFO: Cloning cache of NumericFuns from git://github.com/lindahua/NumericFuns.jl.git
INFO: Cloning cache of PDMats from git://github.com/lindahua/PDMats.jl.git
INFO: Cloning cache of SortingAlgorithms from git://github.com/JuliaLang/SortingAlgorithms.jl.git
INFO: Cloning cache of StatsBase from git://github.com/JuliaStats/StatsBase.jl.git
INFO: Installing ArrayViews v0.4.2
INFO: Installing Blocks v0.0.2
INFO: Installing Codecs v0.1.0
INFO: Installing Compose v0.1.28
INFO: Installing DataArrays v0.1.5
INFO: Installing DataFrames v0.5.3
INFO: Installing Datetime v0.1.2
INFO: Installing Distance v0.3.1
INFO: Installing Distributions v0.4.2
INFO: Installing GZip v0.2.12
INFO: Installing Gadfly v0.2.6
INFO: Installing Hexagons v0.0.1
INFO: Installing Iterators v0.1.2
INFO: Installing JSON v0.3.5
INFO: Installing Loess v0.0.2
INFO: Installing NumericExtensions v0.6.0
INFO: Installing NumericFuns v0.2.1
INFO: Installing PDMats v0.1.1
INFO: Installing SortingAlgorithms v0.0.1
INFO: Installing StatsBase v0.3.9
INFO: Package database updated
INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove
Segmentation fault
Pkg.add("Cairo")
Pkg.add("Gadfly")
Pkg.update()
using Gadfly
myplot = plot(x=randn(10), y=randn(10))
draw(SVG("test.svg", 3inch, 3inch), myplot) # ok
draw(PNG("test.png", 3inch, 3inch), myplot) # segfault on julia_write_to_ios_callback
LLVM_VER = 3.4
LLVM_LIB_SUFFIX =
PCRE_VER = 8.31
GRISU_VER = 1.1.1
DSFMT_VER = 2.2
ifeq ($(OS),WINNT)
OPENBLAS_VER = v0.2.9.rc2
else
OPENBLAS_VER = v0.2.9.rc2
endif
LAPACK_VER = 3.4.2
ARPACK_VER = 3.1.3
FFTW_VER = 3.3.3
SUITESPARSE_VER = 4.2.1
UNWIND_VER = 1.1
OSXUNWIND_VER = 0.0.1-rc3
GMP_VER=5.1.3
MPFR_VER=3.1.2
ZLIB_VER = 1.2.8
PATCHELF_VER = 0.6
GIT_VER = 1.8.2.3
UTF8PROC_VER = 1.1.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment