Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Plot caused "stack smashing" #2742

Closed
anandijain opened this issue May 30, 2020 · 9 comments
Closed

[BUG] Plot caused "stack smashing" #2742

anandijain opened this issue May 30, 2020 · 9 comments
Labels

Comments

@anandijain
Copy link

This plot shouldn't work, but I'm not quite sure why it causes a SIGABRT, couldn't find an open issue with "stack smashing".

cs is a DataFrame, with the :symbol column of type String, and the :x1 column of type Int.

Details

julia> plot(cs.symbol[1:50], cs.x1[1:50], yscale=:log10, label=cs.symbol[1:50])
*** stack smashing detected ***: <unknown> terminated

signal (6): Aborted
in expression starting at REPL[17]:0
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7fa577016896)
unknown function (ip: 0x7fa5770c1cd0)
__stack_chk_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
process_glyphs at /home//.julia/packages/GR/cRdXQ/src/../deps/gr/lib/libGR.so (unknown line)
unknown function (ip: 0x5600000048)
Allocations: 127171138 (Pool: 127073353; Big: 97785); GC: 86
fish:/home//Downloads/Appli” terminated by signal SIGABRT (Abort)

Backends

Backend yes no untested
gr (default) X

Versions

Plots version: 1.3.3
Julia Version 1.4.0
Commit b8e9a9ecc6 (2020-03-21 16:36 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, skylake)

@anandijain anandijain added the bug label May 30, 2020
@BeastyBlacksmith
Copy link
Member

Can you give some DataFrame data, that reproduces this bug?

@BeastyBlacksmith
Copy link
Member

BeastyBlacksmith commented May 31, 2020

Also which version of DataFrames is this?
I can't reproduce on julia 1.4.2, Plots 1.3.5 and DataFrames 0.21.1

df = DataFrame([(a = i, b = Symbol(i)) for i in 1:10])
plot(df.b[1:3], df.a[1:3], yscale = :log10, label=df.b[1:3])
ERROR: Cannot convert Symbol to series data for plotting
Stacktrace:

@Seelengrab
Copy link

Seelengrab commented May 31, 2020

@BeastyBlacksmith , your code is not the original example - this crashes julia 1.4.2 and 1.5.0-dev:

julia> versioninfo()
Julia Version 1.5.0-DEV.876
Commit 0c388fc340* (2020-05-07 20:12 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4

(GRsmashing) pkg> st
Status `/c/Users/valentin/Documents/Projects/GRsmashing/Project.toml`
  [a93c6f00] DataFrames v0.21.1
  [91a5bcdd] Plots v1.3.5

julia> using Plots, DataFrames

julia> cs = DataFrame([(x1 = i, symbol = string(i)) for i in 1:50]);

julia> plot(cs.symbol[1:50], cs.x1[1:50], yscale=:log10, label=cs.symbol[1:50])
*** stack smashing detected ***: <unknown> terminated

signal (6): Aborted
in expression starting at none:0
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f32d122038d)
unknown function (ip: 0x7f32d12c2e28)
__stack_chk_fail at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
process_glyphs at /home/vbogad/.julia/packages/GR/cRdXQ/src/../deps/gr/lib/libGR.so (unknown line)
unknown function (ip: 0x3400000021)
Allocations: 80212338 (Pool: 80182132; Big: 30206); GC: 75
Aborted (core dumped)

The GR version, according to the Manifest, is 0.49.1. I think this is a GR problem though, I'll see if I can step through and locate the error. Not having a line number makes this harder though...

@BeastyBlacksmith
Copy link
Member

cc: @jheinen

@anandijain
Copy link
Author

Also which version of DataFrames is this?
I can't reproduce on julia 1.4.2, Plots 1.3.5 and DataFrames 0.21.1

df = DataFrame([(a = i, b = Symbol(i)) for i in 1:10])
plot(df.b[1:3], df.a[1:3], yscale = :log10, label=df.b[1:3])
ERROR: Cannot convert Symbol to series data for plotting
Stacktrace:

Sorry, confusingly, the symbol column is type string, not Symbol.

@stev47
Copy link

stev47 commented Jul 8, 2020

another example that crashes GR in a similar way for me: plot(1.1.^(1:10000)) (on Julia 1.4.2, Plots 1.5.2, GR 0.50.1)

@jheinen
Copy link
Member

jheinen commented Jul 8, 2020

1.1 .^ (1:10000)
10000-element Array{Float64,1}:
  1.1
  1.2100000000000002
  1.3310000000000004
  1.4641000000000004
  1.6105100000000006
  1.7715610000000008
  1.9487171000000012
  2.1435888100000016
  2.357947691000002
  2.5937424601000023
  ⋮
 Inf
 Inf
 Inf
 Inf
 Inf
 Inf
 Inf
 Inf
 Inf

What should happen with the Infs?

@stev47
Copy link

stev47 commented Jul 8, 2020

They should not lead to a core-dump:

julia> using Plots
julia> plot(1.1.^(1:10000))
┌ Warning: No strict ticks found
└ @ PlotUtils ~/.julia/packages/PlotUtils/nCtbM/src/ticks.jl:283
*** stack smashing detected ***: terminated

signal (6): Aborted
in expression starting at REPL[1]:0
gsignal at /usr/bin/../lib/libc.so.6 (unknown line)
abort at /usr/bin/../lib/libc.so.6 (unknown line)
__libc_message at /usr/bin/../lib/libc.so.6 (unknown line)
__fortify_fail at /usr/bin/../lib/libc.so.6 (unknown line)
__stack_chk_fail at /usr/bin/../lib/libc.so.6 (unknown line)
process_glyphs at /home/stev47/.julia/packages/GR/Atztx/src/../deps/gr/lib/libGR.so (unknown line)
unknown function (ip: 0x3500000032)
Allocations: 31575277 (Pool: 31568762; Big: 6515); GC: 27
Aborted (core dumped)

Even though the error is most probably in GR, I cannot reproduce this with the GR package, only when calling through Plots.

@BeastyBlacksmith
Copy link
Member

Probably Plots converts this in many empty series, since it treats Infs the same as NaNs

@t-bltg t-bltg closed this as completed Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants