Parallel and time macro segfault 7261 Closed pfitzseb opened this Issue on Jun 14, 2014 ยท 6 comments Projects None yet Labels parallel windows Milestone No milestone Assignees No one assigned 5 participants pfitzseb vtjnash JeffBezanson jiahao ihnorton Notifications pfitzseb pfitzseb commented on Jun 14, 2014 Hey everyone, I found a kinda strange problem. Suppose there's some code that times a parallel loop as follows: time begin a zeros 100_000_000 parallel for i 1:100_000_000 a i i end end FIrst problem: The time macro returns wrong values I think , since it clearly takes a lot more time until the REPL responds than indicated. Second problem: After hitting Enter, elapsed time: will be displayed as output, but it takes some time until the actual time can be seen. Now, if during that time the evaluation is interrupted ,the following is displayed: elapsed time: exception on 0.1257680236: seconds ERROR: interrupt in anonymous at no file:4 in anonymous at multi-jl:1261 in run_work_thunk at multi-jl:613 in run_work_thunk at multi-jl:622 800003120 bytes allocated If the exact same loop is then started again, Julia segfaults: elapsed time: 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 0x6dba0333 ---jl_profile_is_running at ???:1840907059-jl_profile_is_running at ???:1840907059-jl_profile_is_running at ???:1840906724-jl_profile_is_running at ???:1840906906-jl_gc_collect at ???:1840909837 alloc_2w at ???:1840913957-jl_box_int64 at ???:1840821383 anonymous at no file:4 anonymous at multi-jl:1261 run_work_thunk at multi-jl:613 run_work_thunk at multi-jl:622-jlcall_run_work_thunk;1114 at ???:52354747 ??? at ???:2 ??? at ???:76992432 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 0x6dba0333 ---jl_profile_is_running at ???:1840907059 ??? at ???:76992432 the last five lines will be repeated several times . Without the parallel macro the loop works flawlessly. I'm using the latest prebuilt Julia binary for Windows, versioninfo below: Julia Version 0.3.0-prerelease+3675 Commit 253cbac 2014-06-13 21:49 UTC Platform Info: System: Windows x86_64-w64-mingw32 CPU: Intel R Core TM i7-3517U CPU 1.90GHz WORD_SIZE: 64 BLAS: libopenblas USE64BITINT DYNAMIC_ARCH NO_AFFINITY LAPACK: libopenblas LIBM: libopenlib Edit: After reading a bit about parallel in the docs, I realize that what I did above is not very... correct, but it still shouldn't segfault, right?! And, furthermore, above code seems to produce the correct result: Doing the same operation with parallel and without leads to the exact same array although memory consumption predictably doubles with a parallel loop . Edit No 2: Oookay, this happens without time, too, so it most likely is just because of my wrong usage of parallel. Still, I'll leave the issue open because segfaults should be adressed imo. vtjnash The Julia Language member vtjnash commented on Jun 14, 2014 JeffBezanson adding sync makes the time work as expected, but is this expected behavior? jiahao jiahao added the parallel label on Jun 15, 2014 JeffBezanson The Julia Language member JeffBezanson commented on Jun 16, 2014 parallel with no reduction does not return a result so it is asynchronous; you have to wait for it explicitly. JeffBezanson The Julia Language member JeffBezanson commented on Jun 16, 2014 see also 6752 for problems combining Clanguage and parallelism. JeffBezanson The Julia Language member JeffBezanson commented on Jun 16, 2014 I don't get the segfault on linux. pfitzseb pfitzseb commented on Jun 17, 2014 Yeah, I can't reproduce it on linux either, although it's running in a VM and on a different machine. And about time in conjuction with parallel: Wouldn't it still be desirable to get accurate measuremeants of the longest running process? ihnorton ihnorton added the windows label on Jan 11, 2015 pfitzseb pfitzseb commented on May 21 Just found this issue again, and can't reproduce the segfault anymore. Closing. pfitzseb pfitzseb closed this on May 21