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

crashes in profiler #17386

Closed
tmptrash opened this issue Jul 12, 2016 · 9 comments
Closed

crashes in profiler #17386

tmptrash opened this issue Jul 12, 2016 · 9 comments
Labels
system:windows Affects only Windows

Comments

@tmptrash
Copy link

tmptrash commented Jul 12, 2016

Hello everybody,

Yesterday i tried to use embedded profile (@profile macro) and ProfileView package to measure performance. I found it impossible, because of stable crashes (at least on my machine). A have two types of them. First is reproducible with this code:

type T
  f::Function
  inF::Function
  t::Task
  T(f) = new(f)
end

function main()
    amount = 2
    tasks  = T[]
    for i = 1:amount
      t     = T(function(t) function() while true produce(); t.inF() end end end)
      t.inF = function() produce(); produce(); produce() end
      t.t   = Task(t.f(t))
      push!(tasks, t)
    end

    while true
      for i = 1:amount
        t = tasks[i]
        if rand(1:5) == 3
          t.inF = eval(:(function() produce(); produce(); produce() end))
        end
        consume(t.t)
      end
    end
end

@profile main()

This is an error, which i get with code above:

>julia tmp\\consume.jl
failed to get context from main thread. aborting profiling.

Second one is only reproducible on my project and it looks really asynchronous. I added special code, which produces the bug, but it depends on my sources. So, you have to clone my repo first ;) You may run it like this:

>julia --color=yes -q -i src/AppManagerBug.jl recover quiet

Code above produces this error:

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ffe99794a71 -- RtlVirtualUnwind at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
RtlVirtualUnwind at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
RtlVirtualUnwind at C:\WINDOWS\system32\KERNEL32.DLL (unknown line)
rec_backtrace_ctx at c:\Users\User\AppData\Local\Julia-0.4.6\bin\libjulia.dll (unknown line)
jl_typeof at c:\Users\User\AppData\Local\Julia-0.4.6\bin\libjulia.dll (unknown line)
BaseThreadInitThunk at C:\WINDOWS\system32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
@tmptrash
Copy link
Author

No thoughts about this?

@vtjnash
Copy link
Member

vtjnash commented Jul 15, 2016

I can say for certain the backtrack will be better in 0.5 :P

I suspect it's failing if it gets stopped in the setjmp code. Quick fix hack might be to just set/clear jl_in_stackwalk in ctx_switch (and start_task)

@tmptrash
Copy link
Author

Better, or fixed? :)

@vtjnash
Copy link
Member

vtjnash commented Jul 16, 2016

The backtrace should contain the actual function names instead of random ones, but with an unchanged probability of segfaulting instead.

@tmptrash
Copy link
Author

So, in this case this is actual issue. To be onest it works 2 times from 10 on my pc :(

If you need more details, i may provide them ;)

@KristofferC
Copy link
Member

Please comment if this still happens.

@pfitzseb
Copy link
Member

This seems similar:

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.4690 (2018-03-23 22:25 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 78c7d87369* (23 days old master)
|__/                   |  x86_64-w64-mingw32

julia> using Profile

julia> @profile gcd(BigInt(2)^165622200+2, BigInt(2)^14404211+5)

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x6b5dd650 -- jl_unw_step at /home/Administrator/buildbot/worker/package_win64/build/src\stackwalk.c:326 [inlined]
jl_unw_stepn at /home/Administrator/buildbot/worker/package_win64/build/src\stackwalk.c:51 [inlined]
rec_backtrace_ctx at /home/Administrator/buildbot/worker/package_win64/build/src\stackwalk.c:86
in expression starting at no file:0

@BioTurboNick
Copy link
Contributor

Just came across this researching an EXCEPTION_ACCESS_VIOLATION in 1.1. Just noting for the record that 1.3.0-rc3 has fixed this.

@joseortiz3
Copy link

joseortiz3 commented Dec 3, 2019

I also found this in Julia 1.2.0. Will move to 1.3.0 now per @BioTurboNick's recommendation

               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.2.0 (2019-08-20)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Profile

julia> @profile gcd(BigInt(2)^165622200+2, BigInt(2)^14404211+5)

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x6b5e709d -- rec_backtrace_ctx at /home/Administrator/buildbot/worker/package_win64/build/src/home/Administrator/buildbot/worker/package_win64/build/src\stackwalk.c:372
in expression starting at none:0

That's weird, 1.3.0 appears to work with the above gcd example, but in my other code I am still getting an EXCEPTION_ACCESS_VIOLATION.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:windows Affects only Windows
Projects
None yet
Development

No branches or pull requests

7 participants