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

Avoid segfault when ptls->safepoint is NULL #27020

Closed
wants to merge 1 commit into from

Conversation

bluesmoon
Copy link
Contributor

When using the snowflake connector through PyCall, we end up with a segfault due to ptls->safepoint being NULL when dereferenced via maybe_collect. This patch checks for nullness before dereferencing the pointer.

To reproduce:

  1. Start with julia 0.6.x, python 3.4+ and PyCall installed to use the system python 3.4 (not Conda).
  2. Install the snowflake connector: sudo pip3 install --upgrade snowflake-connector-python
  3. In julia, run the following code:
julia> using PyCall
julia> @pyimport snowflake.connector as snowflake
julia> snowflake.connect(account="snowflake", user="foo", password="bar")

The values for account, user and password are not important, but all three must be present. At this point the snowflake connector attempts to connect to the snowflake server, and we get a segfault with the following stack trace:

#0  jl_unw_step (sp=0x7f48ddac2f10, ip=0x0, cursor=0x7f48ddac3020) at /buildworker/worker/package_linux64/build/src/stackwalk.c:318
318 /buildworker/worker/package_linux64/build/src/stackwalk.c: No such file or directory.
(gdb) bt
#0  jl_unw_step (sp=0x7f48ddac2f10, ip=0x0, cursor=0x7f48ddac3020) at /buildworker/worker/package_linux64/build/src/stackwalk.c:318
#1  jl_unw_stepn (cursor=cursor@entry=0x7f48ddac3020, ip=ip@entry=0x0, sp=sp@entry=0x0, maxsize=maxsize@entry=80000)
    at /buildworker/worker/package_linux64/build/src/stackwalk.c:47
#2  0x00007f48ed49285c in rec_backtrace_ctx (data=data@entry=0x0, maxsize=maxsize@entry=80000, context=context@entry=0x7f48ddac35c0)
    at /buildworker/worker/package_linux64/build/src/stackwalk.c:76
#3  0x00007f48ed4a1404 in jl_critical_error (bt_size=0x7f48ddac8db0, bt_data=0x0, context=0x7f48ddac35c0, sig=11)
    at /buildworker/worker/package_linux64/build/src/signal-handling.c:108
#4  sigdie_handler (sig=11, info=<optimized out>, context=0x7f48ddac35c0) at /buildworker/worker/package_linux64/build/src/signals-unix.c:180
#5  0x00007f48ed4a1937 in segv_handler (sig=11, info=0x7f48ddac36f0, context=0x7f48ddac35c0)
    at /buildworker/worker/package_linux64/build/src/signals-unix.c:264
#6  <signal handler called>
#7  0x00007f48ed49bc33 in maybe_collect (ptls=<optimized out>) at /buildworker/worker/package_linux64/build/src/gc.c:653
#8  jl_gc_counted_malloc (sz=24) at /buildworker/worker/package_linux64/build/src/gc.c:2182
#9  0x00007f48e18a5148 in __gmpz_init () from /opt/julia-0.6.2/bin/../lib/julia/libgmp.so
#10 0x00007f48cf921c7c in ffi_call_unix64 () from /usr/lib/x86_64-linux-gnu/libffi.so.6
#11 0x00007f48cf9215ac in ffi_call () from /usr/lib/x86_64-linux-gnu/libffi.so.6
#12 0x00007f48cc5bb26f in cdata_call (cd=0x7f48c8fb7990, args=<optimized out>, kwds=<optimized out>) at c/_cffi_backend.c:3025
#13 0x00007f48d069a758 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#14 0x00007f48d0732f3d in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#15 0x00007f48d0738976 in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#16 0x00007f48d0738fa6 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#17 0x00007f48d069a758 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#18 0x00007f48d068059d in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#19 0x00007f48d069a758 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#20 0x00007f48d05f9bf9 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#21 0x00007f48d06a3636 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#22 0x00007f48d069a758 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#23 0x00007f48d0732f3d in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#24 0x00007f48d0738976 in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#25 0x00007f48d07351b2 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#26 0x00007f48d0738976 in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#27 0x00007f48d07351b2 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#28 0x00007f48d07356cc in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#29 0x00007f48d0738976 in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#30 0x00007f48d07351b2 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#31 0x00007f48d07356cc in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#32 0x00007f48d07356cc in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#33 0x00007f48d0738976 in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#34 0x00007f48d0739083 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#35 0x00007f48d069a758 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#36 0x00007f48d0731704 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#37 0x00007f48d0738976 in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#38 0x00007f48d0739083 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#39 0x00007f48d069a758 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#40 0x00007f48d0731704 in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#41 0x00007f48d07356cc in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#42 0x00007f48d07356cc in PyEval_EvalFrameEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#43 0x00007f48d0738976 in PyEval_EvalCodeEx () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#44 0x00007f48d0738fa6 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#45 0x00007f48d069a758 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#46 0x00007f48d068059d in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#47 0x00007f48d069a758 in PyObject_Call () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#48 0x00007f48d07109b7 in PyEval_CallObjectWithKeywords () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#49 0x00007f48d0777e32 in ?? () from /usr/lib/x86_64-linux-gnu/libpython3.4m.so
#50 0x00007f48ecdf1184 in start_thread (arg=0x7f48ddacb700) at pthread_create.c:312
#51 0x00007f48ecb1e37d in eventfd (count=-504087184, flags=-940641344) at ../sysdeps/unix/sysv/linux/eventfd.c:55
#52 0x0000000000000000 in ?? ()

The problem appears to be in maybe_collect where it calls jl_gc_safepoint_(ptls), which is a macro that tries to dereference ptls->safepoint, which at this point is NULL.

I don't know why this value is NULL, but wrapping it in a nullcheck avoids the segfault and my code executes correctly after that.

Copy link
Contributor

@yuyichao yuyichao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely because you are calling Julia from the wrong thread. It should be fixed properly instead. This change is actually not a step in the right direction.

@bluesmoon
Copy link
Contributor Author

I don't understand. I'm running Julia from the command line repl. How am I using the wrong thread?

@yuyichao
Copy link
Contributor

yuyichao commented May 7, 2018

From the backtrace the thread is started by Python.

@bluesmoon
Copy link
Contributor Author

The 3 lines of code I pasted above are the only lines I've executed. Are you saying that after julia calls python, python is calling julia again? There is no julia code in the python library.

@yuyichao
Copy link
Contributor

yuyichao commented May 7, 2018

python is calling julia again?

Yes. From the backtrace it's done through gmp. In this case, the simplest fix would be to use this check to skip the gc collection and the throw.

@bluesmoon
Copy link
Contributor Author

Hmm, so is my code fix correct or do I need to add additional checks or move it elsewhere, eg, should I move the if condition into maybe_collect?

@ararslan
Copy link
Member

ararslan commented May 7, 2018

FYI the PR should target master rather than release-0.6.

@bluesmoon
Copy link
Contributor Author

I can do that, will it also be backported to 0.6?

@bluesmoon bluesmoon changed the base branch from release-0.6 to master May 7, 2018 18:56
@yuyichao
Copy link
Contributor

yuyichao commented May 7, 2018

should I move the if condition into maybe_collect?

Yes, and also the throw part.

@ararslan
Copy link
Member

ararslan commented May 7, 2018

will it also be backported to 0.6?

Depends on whether it has the potential to break existing code.

@yuyichao
Copy link
Contributor

yuyichao commented May 7, 2018

And also other related functions (realloc, calloc) free seems fine. calloc isn't used by gmp but is basically the same as malloc and doesn't hurt.

@bluesmoon
Copy link
Contributor Author

Ok I'm confused again. What's the throw part?

@bluesmoon
Copy link
Contributor Author

@ararslan i'm currently using it with 0.6. I don't know if it works with 0.7.

@yuyichao
Copy link
Contributor

yuyichao commented May 7, 2018

Oh, actually, no you shouldn't move this into maybe_collect. You should move it to where GMP calls back in (i.e. you move it around maybe_collect). That function appears in your backtrace: #8 jl_gc_counted_malloc (sz=24) at /buildworker/worker/package_linux64/build/src/gc.c:2182 and in general the functions that needs fix are https://github.com/JuliaLang/julia/blob/master/src/gc.c#L2744-L2794. The check should be on all the calls to julia runtime, mostly gc collect and throw.

@bluesmoon
Copy link
Contributor Author

Ok thanks

@bluesmoon
Copy link
Contributor Author

@yuyichao updated the PR, let me know if I'm on the right track and what else is needed.

Copy link
Contributor

@yuyichao yuyichao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct, though you still didn't put the condition on the throw.

@bluesmoon
Copy link
Contributor Author

Thanks, I think I got it this time.

@ararslan
Copy link
Member

ararslan commented May 7, 2018

Would it be possible to reduce the underlying issue into a test that we can run on CI to ensure this issue doesn't reoccur in the future?

@bluesmoon
Copy link
Contributor Author

can that be a julia file?

@ararslan
Copy link
Member

ararslan commented May 7, 2018

Yes, all of our tests are at the Julia level.

Copy link
Contributor

@yuyichao yuyichao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I also realized that our calloc doesn't actually handle sz == 0.

If by julia file you mean your repro then no. PyCall is too much a dependency. You could use @threadcall to write something though it'll still be not very relevant (can easily miss breakage).

@bluesmoon
Copy link
Contributor Author

bluesmoon commented May 7, 2018

I'll try to create a julia repro that doesn't use PyCall, but so far I haven't been successful with that

@bluesmoon
Copy link
Contributor Author

@yuyichao do you want me to handle the sz==0 case as well? I would think that that should return NULL without throwing in all cases (since that's what calloc would do)

@yuyichao
Copy link
Contributor

yuyichao commented May 8, 2018

but so far I haven't been successful with that

You need to trigger a GC on another thread while calling one of these functions. That wouldn't be easy and will be highly system dependent (you can easily have a verion of the code that runs without triggering anything on one machine and OOM another). There's also basically no way to test that throw branch without messing with libc.

do you want me to handle the sz==0 case as well? I would think that that should return NULL without throwing in all cases (since that's what calloc would do)

Yes that's what I'm talking about. You don't have to add that but it'll be nice. Do note that if you want to fix this one you also need to fix jl_realloc and gc_managed_realloc_ (or jl_gc_managed_realloc) below.

@bluesmoon
Copy link
Contributor Author

I have been trying this:

julia> x = BigInt()
julia> @threadcall((:__gmpz_init,:libgmp), Void, (Ptr{BigInt},), &x)

ERROR: unsupported or misplaced expression &

The same call works with ccall, but not with @threadcall. Not sure what to do, but pretty much any case where I need to trigger gc in a c library will need me to pass a pointer.

@bluesmoon
Copy link
Contributor Author

I don't understand. How do you have a merge commit before doing a merge? Or are you saying that the test code merges the branch locally and then runs tests?

@KristofferC
Copy link
Sponsor Member

It tests on a commit that would have occurred if the branch was merged.

@bluesmoon
Copy link
Contributor Author

Can anyone help me understand why the tests are failing?

There are cases (eg: when __gmpz_init is called from python via PyCall in a
secondary thread) where ptls->safepoint is NULL when maybe_collect is called,
and *ptls->safepoint causes a NULL pointer dereference and a segfault.  This
change fixes that case.

Included test in test/threads.jl that will reproduce this issue.

See JuliaLang#27020 for backtrace and more details
@ararslan
Copy link
Member

On all platforms (oddly with the exception of FreeBSD), the test case you've written triggers a SIGABRT:

/home/travis/build/JuliaLang/julia/deps/srccache/llvm-6.0.0/lib/IR/Type.cpp:619: static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int): Assertion isValidElementType(EltTy) && "Invalid type for pointer element!" failed.

I'm not sure it's correct to declare the input type in @threadcall to be a Ptr then pass it a Ref, but I could be mistaken.

@StefanKarpinski
Copy link
Sponsor Member

I'm going to try pushing this change rebased onto the current master and see if it helps.

@bluesmoon
Copy link
Contributor Author

@ararslan I wrote the test that way because it's what I narrowed down the failing code to (ie, the PyCall call to snowflake)

@StefanKarpinski
Copy link
Sponsor Member

StefanKarpinski commented Jul 11, 2018

I've pushed a rebased version of this, so we'll see how CI does. I'm a bit confused about the state of affairs, however: @bluesmoon, it seems that you have put an assert in your code which fails on all platforms and you're asking why CI fails... it fails because of the failing assert. It seems like you're the person in the best position to understand how to fix that. The possible solutions seem to be one of: remove the assertion because it's incorrect or fix the code so the assertion passes. Are you asking for help with the latter? And again, does this patch pass on Julia 0.6?

@bluesmoon
Copy link
Contributor Author

Ok, now I'm confused because I just rechecked the diff and there are no assertions in my code. I'll rerun the tests against the latest 0.6 branch and report here when it's done.

@bluesmoon
Copy link
Contributor Author

I've now completed running all tests against the release-0.6 branch with my patch applied and this is the result. In short, all the threads tests pass (which is what I've touched) while there are failures in other areas that I'm not familiar with:

Test Summary:           |     Pass  Fail  Error   Broken     Total
  Overall               | 21631604     5     14  1311352  22942975
    ambiguous           |       51                              51
    linalg/schur        |      330                             330
    linalg/special      |      942                             942
    linalg/eigen        |      381                             381
    linalg/svd          |      244                             244
    linalg/bunchkaufman |     2520                            2520
    linalg/qr           |     3057                            3057
    linalg/lapack       |      628                             628
    linalg/matmul       |      527                             527
    linalg/tridiag      |      845                             845
    linalg/pinv         |      232                             232
    linalg/givens       |     1552                            1552
    linalg/bidiag       |     1594                            1594
    linalg/dense        |     6324                            6324
    linalg/generic      |      206                             206
    linalg/symmetric    |     1391                            1391
    linalg/uniformscaling |      247                             247
    linalg/hessenberg   |       40                              40
    linalg/lu           |     1149                            1149
    linalg/conjarray    |       10                              10
    linalg/diagonal     |     1196                            1196
    linalg/rowvector    |      136                             136
    linalg/cholesky     |     2104                            2104
    linalg/arnoldi      |       76                              76
    linalg/lq           |     1374                            1374
    sparse/umfpack      |      137                             137
    sparse/cholmod      |      359                             359
    sparse/spqr         |       53                              53
    strings/basic       |    26981                           26981
    strings/search      |      549                             549
    strings/util        |      341                             341
    strings/io          |    12536                           12536
    strings/types       |     8905                            8905
    unicode/UnicodeError |        1                               1
    unicode/utf8proc    |      768                             768
    unicode/utf8        |  1048595                         1048595
    dates/accessors     |  7723858                         7723858
    dates/adjusters     |     3147                            3147
    dates/query         |      988                             988
    sparse/sparse       |     1518                            1518
    dates/periods       |      316                             316
    dates/rounding      |      157                             157
    sparse/sparsevector |     8163                            8163
    dates/types         |      167                             167
    dates/ranges        |   348530                          348530
    dates/conversions   |      159                             159
    dates/arithmetic    |      312                             312
    dates/io            |      241                             241
    worlds              |       61                              61
    linalg/triangular   |    33634                           33634
    inference           |      255                             255
    keywordargs         |      109                             109
    printf              |      596                             596
    char                |     1707                            1707
    triplequote         |       28                              28
    intrinsics          |       34                              34
    core                |    35542                           35542
    subtype             |   337304                    15    337319
    hashing             |    14453                           14453
    iobuffer            |      179                             179
    staged              |       47                              47
    sparse/higherorderfns |     6377                   584      6961
    tuple               |      383                             383
    reduce              |      242                             242
    dict                |   134174                          134174
    random              |   200711                          200711
    reducedim           |      461                             461
    intfuncs            |     4335                            4335
    simdloop            |      207                             207
    vecelement          |      533                             533
    numbers             |  1477169            1            1477170
    blas                |      486                             486
    copy                |      312                             312
    offsetarray         |      733                             733
    fastmath            |      791                             791
    subarray            |      200                             200
    functional          |       61                              61
    abstractarray       |     2431                            2431
    path                |      219                    12       231
    operators           |       59                              59
    math                |   551279                          551279
    loading             |       23                              23
    parse               |     1098                            1098
    bigfloat            |       24                              24
    bigint              |     2396                            2396
    arrayops            |     1572                            1572
    ccall               |     3852                            3852
    backtrace           |       22                     1        23
    iterators           |      918                             918
    statistics          |      367                             367
    file                |      807                             807
    read                |     2056           11               2067
    mmap                |      130            1                131
    version             |   124465                          124465
    pollfd              |      344                             344
    spawn               |      108     1               4       113
    mpfr                |      702                             702
    socket              |       57            1                 58
    floatapprox         |       49                              49
    sorting             |     4864                            4864
    datafmt             |       83                              83
    regex               |       38                              38
    float16             |      124                             124
    combinatorics       |       44                              44
    reflection          |      277                             277
    sysinfo             |        2                               2
    env                 |       42                              42
    complex             |     1094                            1094
    rounding            |      327                             327
    mod2pi              |        9                               9
    resolve             |     2648                            2648
    euler               |       12                              12
    replcompletions     |      268                     2       270
    lineedit            |      175                             175
    broadcast           |      312                             312
    replutil            |      167                             167
    sets                |      216                             216
    goto                |       13                              13
    llvmcall            |       13                              13
    llvmcall2           |        6                               6
    repl                |      113                             113
    show                |      144     3                       147
    grisu               |      683                             683
    meta                |       38                              38
    stacktraces         |       42                              42
    profile             |        7                               7
    test                |      201                    14       215
    docs                |      196                             196
    base64              |        9                               9
    markdown            |      210                             210
    serialize           |       91                              91
    nullable            |    98030                           98030
    enums               |       79                              79
    threads             |   190563                          190563
    i18n                |        2                               2
    workspace           |        1                               1
    libdl               |       62                              62
    ranges              |  6981917     1         1310720   8292638
    libgit2             |      385                             385
    int                 |    10140                           10140
    intset              |      154                             154
    checked             |     1211                            1211
    inline              |       23                              23
    floatfuncs          |      126                             126
    error               |       28                              28
    cartesian           |        2                               2
    asmvariant          |        3                               3
    osutils             |       21                              21
    boundscheck         |                                 No tests
    iostream            |       21                              21
    specificity         |      114                             114
    channels            |      187                             187
    misc                |  1279537                         1279537
    dsp                 |      365                             365
    fft                 |     2026                            2026
    examples            |       22                              22
    cmdlineargs         |      137                             137
    distributed         |                                 No tests
    bitarray            |   895853                          895853
    compile             |       88                              88
    FAILURE
Error in testset numbers:
Error During Test
  Test threw an exception of type DivideError
  Expression: powermod(1, -1, big(1)) == 0
  DivideError: integer division error
Error in testset read:
Error During Test
  Test threw an exception of type SystemError
  Expression: readuntil(io(), "\n") == readuntil(filename, "\n")
  SystemError: opening file /tmp/tmpq0YUx1/file.txt: Too many open files in system
Error in testset read:
Error During Test
  Test threw an exception of type SystemError
  Expression: readuntil(io(), ',') == readuntil(IOBuffer(text), ',')
  SystemError: opening file /tmp/tmpq0YUx1/file.txt: Too many open files in system
Error in testset read:
Error During Test
  Test threw an exception of type SystemError
  Expression: readuntil(io(), ',') == readuntil(filename, ',')
  SystemError: opening file /tmp/tmpq0YUx1/file.txt: Too many open files in system
Error in testset read:
Error During Test
  Test threw an exception of type SystemError
  Expression: readline(io(), chomp=false) == readline(IOBuffer(text), chomp=false)
  SystemError: opening file /tmp/tmpq0YUx1/file.txt: Too many open files in system
Error in testset read:
Error During Test
  Test threw an exception of type SystemError
  Expression: readline(io(), chomp=false) == readline(filename, chomp=false)
  SystemError: opening file /tmp/tmpq0YUx1/file.txt: Too many open files in system
Error in testset read:
Error During Test
  Test threw an exception of type SystemError
  Expression: readlines(io(), chomp=false) == readlines(IOBuffer(text), chomp=false)
  SystemError: opening file /tmp/tmpq0YUx1/file.txt: Too many open files in system
Error in testset read:
Error During Test
  Test threw an exception of type SystemError
  Expression: readlines(io(), chomp=false) == readlines(filename, chomp=false)
  SystemError: opening file /tmp/tmpq0YUx1/file.txt: Too many open files in system
Error in testset read:
Error During Test
  Test threw an exception of type SystemError
  Expression: readlines(io()) == readlines(IOBuffer(text))
  SystemError: opening file /tmp/tmpq0YUx1/file.txt: Too many open files in system
Error in testset read:
Error During Test
  Test threw an exception of type SystemError
  Expression: readlines(io()) == readlines(filename)
  SystemError: opening file /tmp/tmpq0YUx1/file.txt: Too many open files in system
Error in testset read:
Error During Test
  Test threw an exception of type SystemError
  Expression: collect(eachline(io(), chomp=false)) == collect(eachline(IOBuffer(text), chomp=false))
  SystemError: opening file /tmp/tmpq0YUx1/file.txt: Too many open files in system
Error in testset read:
Error During Test
  Test threw an exception of type SystemError
  Expression: collect(eachline(io(), chomp=false)) == collect(eachline(filename, chomp=false))
  SystemError: opening file /tmp/tmpq0YUx1/file.txt: Too many open files in system
Error in testset mmap:
Error During Test
  Test threw an exception of type SystemError
  Expression: Mmap.mmap(file, Array{UInt8, 2}, (1, 11)) == t'
  SystemError: opening file /tmp/juliagOs3bh: Too many open files in system
Error in testset spawn:
Test Failed
  Expression: ex.code == Base.UV_EMFILE
   Evaluated: -23 == -24
Error in testset socket:
Error During Test
  Got an exception of type LoadError outside of a @test
  LoadError: UDP send failed: address not available (EADDRNOTAVAIL)
  while loading /usr/src/julia/test/socket.jl, in expression starting on line 191
Error in testset show:
Test Failed
  Expression: replstr(collect(1.0:100.0)) == "100-element Array{Float64,1}:\n   1.0\n   2.0\n   3.0\n   4.0\n   5.0\n   6.0\n   7.0\n   8.0\n   9.0\n  10.0\n   ⋮  \n  92.0\n  93.0\n  94.0\n  95.0\n  96.0\n  97.0\n  98.0\n  99.0\n 100.0"
   Evaluated: "100-element Array{Float64,1}:\n   1.0\n   2.0\n   3.0\n   4.0\n   5.0\n   6.0\n   7.0\n   8.0\n   9.0\n  10.0\n  11.0\n  12.0\n  13.0\n  14.0\n  15.0\n  16.0\n  17.0\n  18.0\n  19.0\n  20.0\n  21.0\n  22.0\n  23.0\n   ⋮  \n  79.0\n  80.0\n  81.0\n  82.0\n  83.0\n  84.0\n  85.0\n  86.0\n  87.0\n  88.0\n  89.0\n  90.0\n  91.0\n  92.0\n  93.0\n  94.0\n  95.0\n  96.0\n  97.0\n  98.0\n  99.0\n 100.0" == "100-element Array{Float64,1}:\n   1.0\n   2.0\n   3.0\n   4.0\n   5.0\n   6.0\n   7.0\n   8.0\n   9.0\n  10.0\n   ⋮  \n  92.0\n  93.0\n  94.0\n  95.0\n  96.0\n  97.0\n  98.0\n  99.0\n 100.0"
Error in testset show:
Test Failed
  Expression: replstr((collect(1.0:100.0))') == "1×100 RowVector{Float64,Array{Float64,1}}:\n 1.0  2.0  3.0  4.0  5.0  6.0  7.0  …  95.0  96.0  97.0  98.0  99.0  100.0"
   Evaluated: "1×100 RowVector{Float64,Array{Float64,1}}:\n 1.0  2.0  3.0  4.0  5.0  6.0  7.0  8.0  9.0  10.0  11.0  12.0  13.0  14.0  15.0  16.0  17.0  …  85.0  86.0  87.0  88.0  89.0  90.0  91.0  92.0  93.0  94.0  95.0  96.0  97.0  98.0  99.0  100.0" == "1×100 RowVector{Float64,Array{Float64,1}}:\n 1.0  2.0  3.0  4.0  5.0  6.0  7.0  …  95.0  96.0  97.0  98.0  99.0  100.0"
Error in testset show:
Test Failed
  Expression: replstr((1.0:100.0) * (1:100)') == "100×100 Array{Float64,2}:\n   1.0    2.0    3.0    4.0    5.0    6.0  …    97.0    98.0    99.0    100.0\n   2.0    4.0    6.0    8.0   10.0   12.0      194.0   196.0   198.0    200.0\n   3.0    6.0    9.0   12.0   15.0   18.0      291.0   294.0   297.0    300.0\n   4.0    8.0   12.0   16.0   20.0   24.0      388.0   392.0   396.0    400.0\n   5.0   10.0   15.0   20.0   25.0   30.0      485.0   490.0   495.0    500.0\n   6.0   12.0   18.0   24.0   30.0   36.0  …   582.0   588.0   594.0    600.0\n   7.0   14.0   21.0   28.0   35.0   42.0      679.0   686.0   693.0    700.0\n   8.0   16.0   24.0   32.0   40.0   48.0      776.0   784.0   792.0    800.0\n   9.0   18.0   27.0   36.0   45.0   54.0      873.0   882.0   891.0    900.0\n  10.0   20.0   30.0   40.0   50.0   60.0      970.0   980.0   990.0   1000.0\n   ⋮                                  ⋮    ⋱                                 \n  92.0  184.0  276.0  368.0  460.0  552.0     8924.0  9016.0  9108.0   9200.0\n  93.0  186.0  279.0  372.0  465.0  558.0     9021.0  9114.0  9207.0   9300.0\n  94.0  188.0  282.0  376.0  470.0  564.0     9118.0  9212.0  9306.0   9400.0\n  95.0  190.0  285.0  380.0  475.0  570.0     9215.0  9310.0  9405.0   9500.0\n  96.0  192.0  288.0  384.0  480.0  576.0  …  9312.0  9408.0  9504.0   9600.0\n  97.0  194.0  291.0  388.0  485.0  582.0     9409.0  9506.0  9603.0   9700.0\n  98.0  196.0  294.0  392.0  490.0  588.0     9506.0  9604.0  9702.0   9800.0\n  99.0  198.0  297.0  396.0  495.0  594.0     9603.0  9702.0  9801.0   9900.0\n 100.0  200.0  300.0  400.0  500.0  600.0     9700.0  9800.0  9900.0  10000.0"
   Evaluated: "100×100 Array{Float64,2}:\n   1.0    2.0    3.0    4.0    5.0    6.0    7.0    8.0    9.0    10.0    11.0    12.0    13.0  …    89.0    90.0    91.0    92.0    93.0    94.0    95.0    96.0    97.0    98.0    99.0    100.0\n   2.0    4.0    6.0    8.0   10.0   12.0   14.0   16.0   18.0    20.0    22.0    24.0    26.0      178.0   180.0   182.0   184.0   186.0   188.0   190.0   192.0   194.0   196.0   198.0    200.0\n   3.0    6.0    9.0   12.0   15.0   18.0   21.0   24.0   27.0    30.0    33.0    36.0    39.0      267.0   270.0   273.0   276.0   279.0   282.0   285.0   288.0   291.0   294.0   297.0    300.0\n   4.0    8.0   12.0   16.0   20.0   24.0   28.0   32.0   36.0    40.0    44.0    48.0    52.0      356.0   360.0   364.0   368.0   372.0   376.0   380.0   384.0   388.0   392.0   396.0    400.0\n   5.0   10.0   15.0   20.0   25.0   30.0   35.0   40.0   45.0    50.0    55.0    60.0    65.0      445.0   450.0   455.0   460.0   465.0   470.0   475.0   480.0   485.0   490.0   495.0    500.0\n   6.0   12.0   18.0   24.0   30.0   36.0   42.0   48.0   54.0    60.0    66.0    72.0    78.0  …   534.0   540.0   546.0   552.0   558.0   564.0   570.0   576.0   582.0   588.0   594.0    600.0\n   7.0   14.0   21.0   28.0   35.0   42.0   49.0   56.0   63.0    70.0    77.0    84.0    91.0      623.0   630.0   637.0   644.0   651.0   658.0   665.0   672.0   679.0   686.0   693.0    700.0\n   8.0   16.0   24.0   32.0   40.0   48.0   56.0   64.0   72.0    80.0    88.0    96.0   104.0      712.0   720.0   728.0   736.0   744.0   752.0   760.0   768.0   776.0   784.0   792.0    800.0\n   9.0   18.0   27.0   36.0   45.0   54.0   63.0   72.0   81.0    90.0    99.0   108.0   117.0      801.0   810.0   819.0   828.0   837.0   846.0   855.0   864.0   873.0   882.0   891.0    900.0\n  10.0   20.0   30.0   40.0   50.0   60.0   70.0   80.0   90.0   100.0   110.0   120.0   130.0      890.0   900.0   910.0   920.0   930.0   940.0   950.0   960.0   970.0   980.0   990.0   1000.0\n  11.0   22.0   33.0   44.0   55.0   66.0   77.0   88.0   99.0   110.0   121.0   132.0   143.0  …   979.0   990.0  1001.0  1012.0  1023.0  1034.0  1045.0  1056.0  1067.0  1078.0  1089.0   1100.0\n  12.0   24.0   36.0   48.0   60.0   72.0   84.0   96.0  108.0   120.0   132.0   144.0   156.0     1068.0  1080.0  1092.0  1104.0  1116.0  1128.0  1140.0  1152.0  1164.0  1176.0  1188.0   1200.0\n  13.0   26.0   39.0   52.0   65.0   78.0   91.0  104.0  117.0   130.0   143.0   156.0   169.0     1157.0  1170.0  1183.0  1196.0  1209.0  1222.0  1235.0  1248.0  1261.0  1274.0  1287.0   1300.0\n  14.0   28.0   42.0   56.0   70.0   84.0   98.0  112.0  126.0   140.0   154.0   168.0   182.0     1246.0  1260.0  1274.0  1288.0  1302.0  1316.0  1330.0  1344.0  1358.0  1372.0  1386.0   1400.0\n  15.0   30.0   45.0   60.0   75.0   90.0  105.0  120.0  135.0   150.0   165.0   180.0   195.0     1335.0  1350.0  1365.0  1380.0  1395.0  1410.0  1425.0  1440.0  1455.0  1470.0  1485.0   1500.0\n  16.0   32.0   48.0   64.0   80.0   96.0  112.0  128.0  144.0   160.0   176.0   192.0   208.0  …  1424.0  1440.0  1456.0  1472.0  1488.0  1504.0  1520.0  1536.0  1552.0  1568.0  1584.0   1600.0\n  17.0   34.0   51.0   68.0   85.0  102.0  119.0  136.0  153.0   170.0   187.0   204.0   221.0     1513.0  1530.0  1547.0  1564.0  1581.0  1598.0  1615.0  1632.0  1649.0  1666.0  1683.0   1700.0\n  18.0   36.0   54.0   72.0   90.0  108.0  126.0  144.0  162.0   180.0   198.0   216.0   234.0     1602.0  1620.0  1638.0  1656.0  1674.0  1692.0  1710.0  1728.0  1746.0  1764.0  1782.0   1800.0\n  19.0   38.0   57.0   76.0   95.0  114.0  133.0  152.0  171.0   190.0   209.0   228.0   247.0     1691.0  1710.0  1729.0  1748.0  1767.0  1786.0  1805.0  1824.0  1843.0  1862.0  1881.0   1900.0\n  20.0   40.0   60.0   80.0  100.0  120.0  140.0  160.0  180.0   200.0   220.0   240.0   260.0     1780.0  1800.0  1820.0  1840.0  1860.0  1880.0  1900.0  1920.0  1940.0  1960.0  1980.0   2000.0\n  21.0   42.0   63.0   84.0  105.0  126.0  147.0  168.0  189.0   210.0   231.0   252.0   273.0  …  1869.0  1890.0  1911.0  1932.0  1953.0  1974.0  1995.0  2016.0  2037.0  2058.0  2079.0   2100.0\n  22.0   44.0   66.0   88.0  110.0  132.0  154.0  176.0  198.0   220.0   242.0   264.0   286.0     1958.0  1980.0  2002.0  2024.0  2046.0  2068.0  2090.0  2112.0  2134.0  2156.0  2178.0   2200.0\n  23.0   46.0   69.0   92.0  115.0  138.0  161.0  184.0  207.0   230.0   253.0   276.0   299.0     2047.0  2070.0  2093.0  2116.0  2139.0  2162.0  2185.0  2208.0  2231.0  2254.0  2277.0   2300.0\n   ⋮                                  ⋮                                    ⋮                    ⋱                     ⋮                                       ⋮                                   \n  79.0  158.0  237.0  316.0  395.0  474.0  553.0  632.0  711.0   790.0   869.0   948.0  1027.0     7031.0  7110.0  7189.0  7268.0  7347.0  7426.0  7505.0  7584.0  7663.0  7742.0  7821.0   7900.0\n  80.0  160.0  240.0  320.0  400.0  480.0  560.0  640.0  720.0   800.0   880.0   960.0  1040.0     7120.0  7200.0  7280.0  7360.0  7440.0  7520.0  7600.0  7680.0  7760.0  7840.0  7920.0   8000.0\n  81.0  162.0  243.0  324.0  405.0  486.0  567.0  648.0  729.0   810.0   891.0   972.0  1053.0  …  7209.0  7290.0  7371.0  7452.0  7533.0  7614.0  7695.0  7776.0  7857.0  7938.0  8019.0   8100.0\n  82.0  164.0  246.0  328.0  410.0  492.0  574.0  656.0  738.0   820.0   902.0   984.0  1066.0     7298.0  7380.0  7462.0  7544.0  7626.0  7708.0  7790.0  7872.0  7954.0  8036.0  8118.0   8200.0\n  83.0  166.0  249.0  332.0  415.0  498.0  581.0  664.0  747.0   830.0   913.0   996.0  1079.0     7387.0  7470.0  7553.0  7636.0  7719.0  7802.0  7885.0  7968.0  8051.0  8134.0  8217.0   8300.0\n  84.0  168.0  252.0  336.0  420.0  504.0  588.0  672.0  756.0   840.0   924.0  1008.0  1092.0     7476.0  7560.0  7644.0  7728.0  7812.0  7896.0  7980.0  8064.0  8148.0  8232.0  8316.0   8400.0\n  85.0  170.0  255.0  340.0  425.0  510.0  595.0  680.0  765.0   850.0   935.0  1020.0  1105.0     7565.0  7650.0  7735.0  7820.0  7905.0  7990.0  8075.0  8160.0  8245.0  8330.0  8415.0   8500.0\n  86.0  172.0  258.0  344.0  430.0  516.0  602.0  688.0  774.0   860.0   946.0  1032.0  1118.0  …  7654.0  7740.0  7826.0  7912.0  7998.0  8084.0  8170.0  8256.0  8342.0  8428.0  8514.0   8600.0\n  87.0  174.0  261.0  348.0  435.0  522.0  609.0  696.0  783.0   870.0   957.0  1044.0  1131.0     7743.0  7830.0  7917.0  8004.0  8091.0  8178.0  8265.0  8352.0  8439.0  8526.0  8613.0   8700.0\n  88.0  176.0  264.0  352.0  440.0  528.0  616.0  704.0  792.0   880.0   968.0  1056.0  1144.0     7832.0  7920.0  8008.0  8096.0  8184.0  8272.0  8360.0  8448.0  8536.0  8624.0  8712.0   8800.0\n  89.0  178.0  267.0  356.0  445.0  534.0  623.0  712.0  801.0   890.0   979.0  1068.0  1157.0     7921.0  8010.0  8099.0  8188.0  8277.0  8366.0  8455.0  8544.0  8633.0  8722.0  8811.0   8900.0\n  90.0  180.0  270.0  360.0  450.0  540.0  630.0  720.0  810.0   900.0   990.0  1080.0  1170.0     8010.0  8100.0  8190.0  8280.0  8370.0  8460.0  8550.0  8640.0  8730.0  8820.0  8910.0   9000.0\n  91.0  182.0  273.0  364.0  455.0  546.0  637.0  728.0  819.0   910.0  1001.0  1092.0  1183.0  …  8099.0  8190.0  8281.0  8372.0  8463.0  8554.0  8645.0  8736.0  8827.0  8918.0  9009.0   9100.0\n  92.0  184.0  276.0  368.0  460.0  552.0  644.0  736.0  828.0   920.0  1012.0  1104.0  1196.0     8188.0  8280.0  8372.0  8464.0  8556.0  8648.0  8740.0  8832.0  8924.0  9016.0  9108.0   9200.0\n  93.0  186.0  279.0  372.0  465.0  558.0  651.0  744.0  837.0   930.0  1023.0  1116.0  1209.0     8277.0  8370.0  8463.0  8556.0  8649.0  8742.0  8835.0  8928.0  9021.0  9114.0  9207.0   9300.0\n  94.0  188.0  282.0  376.0  470.0  564.0  658.0  752.0  846.0   940.0  1034.0  1128.0  1222.0     8366.0  8460.0  8554.0  8648.0  8742.0  8836.0  8930.0  9024.0  9118.0  9212.0  9306.0   9400.0\n  95.0  190.0  285.0  380.0  475.0  570.0  665.0  760.0  855.0   950.0  1045.0  1140.0  1235.0     8455.0  8550.0  8645.0  8740.0  8835.0  8930.0  9025.0  9120.0  9215.0  9310.0  9405.0   9500.0\n  96.0  192.0  288.0  384.0  480.0  576.0  672.0  768.0  864.0   960.0  1056.0  1152.0  1248.0  …  8544.0  8640.0  8736.0  8832.0  8928.0  9024.0  9120.0  9216.0  9312.0  9408.0  9504.0   9600.0\n  97.0  194.0  291.0  388.0  485.0  582.0  679.0  776.0  873.0   970.0  1067.0  1164.0  1261.0     8633.0  8730.0  8827.0  8924.0  9021.0  9118.0  9215.0  9312.0  9409.0  9506.0  9603.0   9700.0\n  98.0  196.0  294.0  392.0  490.0  588.0  686.0  784.0  882.0   980.0  1078.0  1176.0  1274.0     8722.0  8820.0  8918.0  9016.0  9114.0  9212.0  9310.0  9408.0  9506.0  9604.0  9702.0   9800.0\n  99.0  198.0  297.0  396.0  495.0  594.0  693.0  792.0  891.0   990.0  1089.0  1188.0  1287.0     8811.0  8910.0  9009.0  9108.0  9207.0  9306.0  9405.0  9504.0  9603.0  9702.0  9801.0   9900.0\n 100.0  200.0  300.0  400.0  500.0  600.0  700.0  800.0  900.0  1000.0  1100.0  1200.0  1300.0     8900.0  9000.0  9100.0  9200.0  9300.0  9400.0  9500.0  9600.0  9700.0  9800.0  9900.0  10000.0" == "100×100 Array{Float64,2}:\n   1.0    2.0    3.0    4.0    5.0    6.0  …    97.0    98.0    99.0    100.0\n   2.0    4.0    6.0    8.0   10.0   12.0      194.0   196.0   198.0    200.0\n   3.0    6.0    9.0   12.0   15.0   18.0      291.0   294.0   297.0    300.0\n   4.0    8.0   12.0   16.0   20.0   24.0      388.0   392.0   396.0    400.0\n   5.0   10.0   15.0   20.0   25.0   30.0      485.0   490.0   495.0    500.0\n   6.0   12.0   18.0   24.0   30.0   36.0  …   582.0   588.0   594.0    600.0\n   7.0   14.0   21.0   28.0   35.0   42.0      679.0   686.0   693.0    700.0\n   8.0   16.0   24.0   32.0   40.0   48.0      776.0   784.0   792.0    800.0\n   9.0   18.0   27.0   36.0   45.0   54.0      873.0   882.0   891.0    900.0\n  10.0   20.0   30.0   40.0   50.0   60.0      970.0   980.0   990.0   1000.0\n   ⋮                                  ⋮    ⋱                                 \n  92.0  184.0  276.0  368.0  460.0  552.0     8924.0  9016.0  9108.0   9200.0\n  93.0  186.0  279.0  372.0  465.0  558.0     9021.0  9114.0  9207.0   9300.0\n  94.0  188.0  282.0  376.0  470.0  564.0     9118.0  9212.0  9306.0   9400.0\n  95.0  190.0  285.0  380.0  475.0  570.0     9215.0  9310.0  9405.0   9500.0\n  96.0  192.0  288.0  384.0  480.0  576.0  …  9312.0  9408.0  9504.0   9600.0\n  97.0  194.0  291.0  388.0  485.0  582.0     9409.0  9506.0  9603.0   9700.0\n  98.0  196.0  294.0  392.0  490.0  588.0     9506.0  9604.0  9702.0   9800.0\n  99.0  198.0  297.0  396.0  495.0  594.0     9603.0  9702.0  9801.0   9900.0\n 100.0  200.0  300.0  400.0  500.0  600.0     9700.0  9800.0  9900.0  10000.0"
Error in testset ranges:
Test Failed
  Expression: replstrmime(LinSpace{Float64}(0, 100, 10000)) == "10000-element LinSpace{Float64}:\n 0.0,0.010001,0.020002,0.030003,0.040004,…,99.95,99.96,99.97,99.98,99.99,100.0"
   Evaluated: "10000-element LinSpace{Float64}:\n 0.0,0.010001,0.020002,0.030003,0.040004,0.050005,0.060006,0.070007,0.080008,0.090009,0.10001,…,99.85,99.86,99.87,99.88,99.89,99.9,99.91,99.92,99.93,99.94,99.95,99.96,99.97,99.98,99.99,100.0" == "10000-element LinSpace{Float64}:\n 0.0,0.010001,0.020002,0.030003,0.040004,…,99.95,99.96,99.97,99.98,99.99,100.0"
ERROR: LoadError: Test run finished with errors

@StefanKarpinski
Copy link
Sponsor Member

Do those failures happen without this patch? Presumably not since it’s a release version and has been thoroughly CI’d. But who knows—we certainly want to know of it does.

@bluesmoon
Copy link
Contributor Author

Yup, though the failure count is different:

Test Summary:           |     Pass  Fail  Error   Broken     Total
  Overall               | 21628815     5      2  1311352  22940174
    ambiguous           |       51                              51
    linalg/schur        |      330                             330
    linalg/special      |      942                             942
    linalg/eigen        |      381                             381
    linalg/svd          |      244                             244
    linalg/bunchkaufman |     2520                            2520
    linalg/qr           |     3057                            3057
    linalg/lapack       |      628                             628
    linalg/matmul       |      527                             527
    linalg/tridiag      |      845                             845
    linalg/pinv         |      232                             232
    linalg/givens       |     1552                            1552
    linalg/bidiag       |     1594                            1594
    linalg/dense        |     6324                            6324
    linalg/generic      |      206                             206
    linalg/symmetric    |     1391                            1391
    linalg/uniformscaling |      247                             247
    linalg/hessenberg   |       40                              40
    linalg/lu           |     1149                            1149
    linalg/conjarray    |       10                              10
    linalg/diagonal     |     1196                            1196
    linalg/rowvector    |      136                             136
    linalg/cholesky     |     2104                            2104
    linalg/arnoldi      |       76                              76
    linalg/lq           |     1374                            1374
    sparse/umfpack      |      137                             137
    sparse/cholmod      |      359                             359
    sparse/spqr         |       53                              53
    strings/basic       |    26981                           26981
    strings/search      |      549                             549
    strings/util        |      341                             341
    strings/io          |    12536                           12536
    strings/types       |     8905                            8905
    unicode/UnicodeError |        1                               1
    unicode/utf8proc    |      768                             768
    unicode/utf8        |  1048595                         1048595
    dates/accessors     |  7723858                         7723858
    dates/adjusters     |     3147                            3147
    dates/query         |      988                             988
    sparse/sparse       |     1518                            1518
    dates/periods       |      316                             316
    dates/rounding      |      157                             157
    dates/types         |      167                             167
    dates/ranges        |   348530                          348530
    sparse/sparsevector |     8163                            8163
    dates/conversions   |      159                             159
    dates/arithmetic    |      312                             312
    dates/io            |      241                             241
    worlds              |       61                              61
    keywordargs         |      109                             109
    linalg/triangular   |    33634                           33634
    inference           |      255                             255
    printf              |      596                             596
    char                |     1707                            1707
    triplequote         |       28                              28
    core                |    35542                           35542
    intrinsics          |       34                              34
    subtype             |   337304                    15    337319
    hashing             |    14453                           14453
    iobuffer            |      179                             179
    staged              |       47                              47
    sparse/higherorderfns |     6377                   584      6961
    tuple               |      383                             383
    dict                |   134174                          134174
    reduce              |      242                             242
    random              |   200711                          200711
    reducedim           |      461                             461
    intfuncs            |     4335                            4335
    numbers             |  1477169            1            1477170
    simdloop            |      207                             207
    vecelement          |      533                             533
    blas                |      486                             486
    copy                |      312                             312
    offsetarray         |      733                             733
    subarray            |      200                             200
    fastmath            |      791                             791
    functional          |       61                              61
    abstractarray       |     2431                            2431
    math                |   551279                          551279
    path                |      219                    12       231
    operators           |       59                              59
    loading             |       23                              23
    bigint              |     2396                            2396
    parse               |     1098                            1098
    bigfloat            |       24                              24
    ccall               |     3852                            3852
    arrayops            |     1572                            1572
    backtrace           |       22                     1        23
    iterators           |      918                             918
    statistics          |      367                             367
    read                |     2067                            2067
    version             |   124465                          124465
    mmap                |      131                             131
    spawn               |      108     1               4       113
    pollfd              |      344                             344
    mpfr                |      702                             702
    sorting             |     4864                            4864
    file                |      807                             807
    socket              |       57            1                 58
    floatapprox         |       49                              49
    datafmt             |       83                              83
    regex               |       38                              38
    float16             |      124                             124
    reflection          |      277                             277
    resolve             |     2648                            2648
    sysinfo             |        2                               2
    combinatorics       |       44                              44
    env                 |       42                              42
    mod2pi              |        9                               9
    rounding            |      327                             327
    euler               |       12                              12
    complex             |     1094                            1094
    lineedit            |      175                             175
    replcompletions     |      268                     2       270
    replutil            |      167                             167
    repl                |      113                             113
    broadcast           |      312                             312
    goto                |       13                              13
    llvmcall            |       13                              13
    llvmcall2           |        6                               6
    sets                |      216                             216
    show                |      144     3                       147
    grisu               |      683                             683
    meta                |       38                              38
    stacktraces         |       42                              42
    profile             |        7                               7
    test                |      201                    14       215
    docs                |      196                             196
    base64              |        9                               9
    markdown            |      210                             210
    serialize           |       91                              91
    nullable            |    98030                           98030
    enums               |       79                              79
    threads             |   190563                          190563
    i18n                |        2                               2
    workspace           |        1                               1
    libdl               |       61                              61
    libgit2             |      385                             385
    int                 |    10140                           10140
    intset              |      154                             154
    checked             |     1211                            1211
    floatfuncs          |      126                             126
    inline              |       23                              23
    misc                |  1279537                         1279537
    error               |       28                              28
    cartesian           |        2                               2
    asmvariant          |        3                               3
    osutils             |       21                              21
    boundscheck         |                                 No tests
    iostream            |       21                              21
    specificity         |      114                             114
    ranges              |  6981917     1         1310720   8292638
    channels            |      187                             187
    bitarray            |   893053                          893053
    dsp                 |      365                             365
    fft                 |     2026                            2026
    examples            |       22                              22
    distributed         |                                 No tests
    cmdlineargs         |      137                             137
    compile             |       88                              88
    FAILURE
Error in testset numbers:
Error During Test
  Test threw an exception of type DivideError
  Expression: powermod(1, -1, big(1)) == 0
  DivideError: integer division error
Error in testset spawn:
Test Failed
  Expression: ex.code == Base.UV_EMFILE
   Evaluated: -23 == -24
Error in testset socket:
Error During Test
  Got an exception of type LoadError outside of a @test
  LoadError: UDP send failed: address not available (EADDRNOTAVAIL)
  while loading /usr/src/julia/test/socket.jl, in expression starting on line 191
Error in testset show:
Test Failed
  Expression: replstr(collect(1.0:100.0)) == "100-element Array{Float64,1}:\n   1.0\n   2.0\n   3.0\n   4.0\n   5.0\n   6.0\n   7.0\n   8.0\n   9.0\n  10.0\n   ⋮  \n  92.0\n  93.0\n  94.0\n  95.0\n  96.0\n  97.0\n  98.0\n  99.0\n 100.0"
   Evaluated: "100-element Array{Float64,1}:\n   1.0\n   2.0\n   3.0\n   4.0\n   5.0\n   6.0\n   7.0\n   8.0\n   9.0\n  10.0\n  11.0\n  12.0\n  13.0\n  14.0\n  15.0\n  16.0\n  17.0\n  18.0\n  19.0\n  20.0\n  21.0\n  22.0\n  23.0\n   ⋮  \n  79.0\n  80.0\n  81.0\n  82.0\n  83.0\n  84.0\n  85.0\n  86.0\n  87.0\n  88.0\n  89.0\n  90.0\n  91.0\n  92.0\n  93.0\n  94.0\n  95.0\n  96.0\n  97.0\n  98.0\n  99.0\n 100.0" == "100-element Array{Float64,1}:\n   1.0\n   2.0\n   3.0\n   4.0\n   5.0\n   6.0\n   7.0\n   8.0\n   9.0\n  10.0\n   ⋮  \n  92.0\n  93.0\n  94.0\n  95.0\n  96.0\n  97.0\n  98.0\n  99.0\n 100.0"
Error in testset show:
Test Failed
  Expression: replstr((collect(1.0:100.0))') == "1×100 RowVector{Float64,Array{Float64,1}}:\n 1.0  2.0  3.0  4.0  5.0  6.0  7.0  …  95.0  96.0  97.0  98.0  99.0  100.0"
   Evaluated: "1×100 RowVector{Float64,Array{Float64,1}}:\n 1.0  2.0  3.0  4.0  5.0  6.0  7.0  8.0  9.0  10.0  11.0  12.0  13.0  14.0  15.0  16.0  17.0  …  85.0  86.0  87.0  88.0  89.0  90.0  91.0  92.0  93.0  94.0  95.0  96.0  97.0  98.0  99.0  100.0" == "1×100 RowVector{Float64,Array{Float64,1}}:\n 1.0  2.0  3.0  4.0  5.0  6.0  7.0  …  95.0  96.0  97.0  98.0  99.0  100.0"
Error in testset show:
Test Failed
  Expression: replstr((1.0:100.0) * (1:100)') == "100×100 Array{Float64,2}:\n   1.0    2.0    3.0    4.0    5.0    6.0  …    97.0    98.0    99.0    100.0\n   2.0    4.0    6.0    8.0   10.0   12.0      194.0   196.0   198.0    200.0\n   3.0    6.0    9.0   12.0   15.0   18.0      291.0   294.0   297.0    300.0\n   4.0    8.0   12.0   16.0   20.0   24.0      388.0   392.0   396.0    400.0\n   5.0   10.0   15.0   20.0   25.0   30.0      485.0   490.0   495.0    500.0\n   6.0   12.0   18.0   24.0   30.0   36.0  …   582.0   588.0   594.0    600.0\n   7.0   14.0   21.0   28.0   35.0   42.0      679.0   686.0   693.0    700.0\n   8.0   16.0   24.0   32.0   40.0   48.0      776.0   784.0   792.0    800.0\n   9.0   18.0   27.0   36.0   45.0   54.0      873.0   882.0   891.0    900.0\n  10.0   20.0   30.0   40.0   50.0   60.0      970.0   980.0   990.0   1000.0\n   ⋮                                  ⋮    ⋱                                 \n  92.0  184.0  276.0  368.0  460.0  552.0     8924.0  9016.0  9108.0   9200.0\n  93.0  186.0  279.0  372.0  465.0  558.0     9021.0  9114.0  9207.0   9300.0\n  94.0  188.0  282.0  376.0  470.0  564.0     9118.0  9212.0  9306.0   9400.0\n  95.0  190.0  285.0  380.0  475.0  570.0     9215.0  9310.0  9405.0   9500.0\n  96.0  192.0  288.0  384.0  480.0  576.0  …  9312.0  9408.0  9504.0   9600.0\n  97.0  194.0  291.0  388.0  485.0  582.0     9409.0  9506.0  9603.0   9700.0\n  98.0  196.0  294.0  392.0  490.0  588.0     9506.0  9604.0  9702.0   9800.0\n  99.0  198.0  297.0  396.0  495.0  594.0     9603.0  9702.0  9801.0   9900.0\n 100.0  200.0  300.0  400.0  500.0  600.0     9700.0  9800.0  9900.0  10000.0"
   Evaluated: "100×100 Array{Float64,2}:\n   1.0    2.0    3.0    4.0    5.0    6.0    7.0    8.0    9.0    10.0    11.0    12.0    13.0  …    89.0    90.0    91.0    92.0    93.0    94.0    95.0    96.0    97.0    98.0    99.0    100.0\n   2.0    4.0    6.0    8.0   10.0   12.0   14.0   16.0   18.0    20.0    22.0    24.0    26.0      178.0   180.0   182.0   184.0   186.0   188.0   190.0   192.0   194.0   196.0   198.0    200.0\n   3.0    6.0    9.0   12.0   15.0   18.0   21.0   24.0   27.0    30.0    33.0    36.0    39.0      267.0   270.0   273.0   276.0   279.0   282.0   285.0   288.0   291.0   294.0   297.0    300.0\n   4.0    8.0   12.0   16.0   20.0   24.0   28.0   32.0   36.0    40.0    44.0    48.0    52.0      356.0   360.0   364.0   368.0   372.0   376.0   380.0   384.0   388.0   392.0   396.0    400.0\n   5.0   10.0   15.0   20.0   25.0   30.0   35.0   40.0   45.0    50.0    55.0    60.0    65.0      445.0   450.0   455.0   460.0   465.0   470.0   475.0   480.0   485.0   490.0   495.0    500.0\n   6.0   12.0   18.0   24.0   30.0   36.0   42.0   48.0   54.0    60.0    66.0    72.0    78.0  …   534.0   540.0   546.0   552.0   558.0   564.0   570.0   576.0   582.0   588.0   594.0    600.0\n   7.0   14.0   21.0   28.0   35.0   42.0   49.0   56.0   63.0    70.0    77.0    84.0    91.0      623.0   630.0   637.0   644.0   651.0   658.0   665.0   672.0   679.0   686.0   693.0    700.0\n   8.0   16.0   24.0   32.0   40.0   48.0   56.0   64.0   72.0    80.0    88.0    96.0   104.0      712.0   720.0   728.0   736.0   744.0   752.0   760.0   768.0   776.0   784.0   792.0    800.0\n   9.0   18.0   27.0   36.0   45.0   54.0   63.0   72.0   81.0    90.0    99.0   108.0   117.0      801.0   810.0   819.0   828.0   837.0   846.0   855.0   864.0   873.0   882.0   891.0    900.0\n  10.0   20.0   30.0   40.0   50.0   60.0   70.0   80.0   90.0   100.0   110.0   120.0   130.0      890.0   900.0   910.0   920.0   930.0   940.0   950.0   960.0   970.0   980.0   990.0   1000.0\n  11.0   22.0   33.0   44.0   55.0   66.0   77.0   88.0   99.0   110.0   121.0   132.0   143.0  …   979.0   990.0  1001.0  1012.0  1023.0  1034.0  1045.0  1056.0  1067.0  1078.0  1089.0   1100.0\n  12.0   24.0   36.0   48.0   60.0   72.0   84.0   96.0  108.0   120.0   132.0   144.0   156.0     1068.0  1080.0  1092.0  1104.0  1116.0  1128.0  1140.0  1152.0  1164.0  1176.0  1188.0   1200.0\n  13.0   26.0   39.0   52.0   65.0   78.0   91.0  104.0  117.0   130.0   143.0   156.0   169.0     1157.0  1170.0  1183.0  1196.0  1209.0  1222.0  1235.0  1248.0  1261.0  1274.0  1287.0   1300.0\n  14.0   28.0   42.0   56.0   70.0   84.0   98.0  112.0  126.0   140.0   154.0   168.0   182.0     1246.0  1260.0  1274.0  1288.0  1302.0  1316.0  1330.0  1344.0  1358.0  1372.0  1386.0   1400.0\n  15.0   30.0   45.0   60.0   75.0   90.0  105.0  120.0  135.0   150.0   165.0   180.0   195.0     1335.0  1350.0  1365.0  1380.0  1395.0  1410.0  1425.0  1440.0  1455.0  1470.0  1485.0   1500.0\n  16.0   32.0   48.0   64.0   80.0   96.0  112.0  128.0  144.0   160.0   176.0   192.0   208.0  …  1424.0  1440.0  1456.0  1472.0  1488.0  1504.0  1520.0  1536.0  1552.0  1568.0  1584.0   1600.0\n  17.0   34.0   51.0   68.0   85.0  102.0  119.0  136.0  153.0   170.0   187.0   204.0   221.0     1513.0  1530.0  1547.0  1564.0  1581.0  1598.0  1615.0  1632.0  1649.0  1666.0  1683.0   1700.0\n  18.0   36.0   54.0   72.0   90.0  108.0  126.0  144.0  162.0   180.0   198.0   216.0   234.0     1602.0  1620.0  1638.0  1656.0  1674.0  1692.0  1710.0  1728.0  1746.0  1764.0  1782.0   1800.0\n  19.0   38.0   57.0   76.0   95.0  114.0  133.0  152.0  171.0   190.0   209.0   228.0   247.0     1691.0  1710.0  1729.0  1748.0  1767.0  1786.0  1805.0  1824.0  1843.0  1862.0  1881.0   1900.0\n  20.0   40.0   60.0   80.0  100.0  120.0  140.0  160.0  180.0   200.0   220.0   240.0   260.0     1780.0  1800.0  1820.0  1840.0  1860.0  1880.0  1900.0  1920.0  1940.0  1960.0  1980.0   2000.0\n  21.0   42.0   63.0   84.0  105.0  126.0  147.0  168.0  189.0   210.0   231.0   252.0   273.0  …  1869.0  1890.0  1911.0  1932.0  1953.0  1974.0  1995.0  2016.0  2037.0  2058.0  2079.0   2100.0\n  22.0   44.0   66.0   88.0  110.0  132.0  154.0  176.0  198.0   220.0   242.0   264.0   286.0     1958.0  1980.0  2002.0  2024.0  2046.0  2068.0  2090.0  2112.0  2134.0  2156.0  2178.0   2200.0\n  23.0   46.0   69.0   92.0  115.0  138.0  161.0  184.0  207.0   230.0   253.0   276.0   299.0     2047.0  2070.0  2093.0  2116.0  2139.0  2162.0  2185.0  2208.0  2231.0  2254.0  2277.0   2300.0\n   ⋮                                  ⋮                                    ⋮                    ⋱                     ⋮                                       ⋮                                   \n  79.0  158.0  237.0  316.0  395.0  474.0  553.0  632.0  711.0   790.0   869.0   948.0  1027.0     7031.0  7110.0  7189.0  7268.0  7347.0  7426.0  7505.0  7584.0  7663.0  7742.0  7821.0   7900.0\n  80.0  160.0  240.0  320.0  400.0  480.0  560.0  640.0  720.0   800.0   880.0   960.0  1040.0     7120.0  7200.0  7280.0  7360.0  7440.0  7520.0  7600.0  7680.0  7760.0  7840.0  7920.0   8000.0\n  81.0  162.0  243.0  324.0  405.0  486.0  567.0  648.0  729.0   810.0   891.0   972.0  1053.0  …  7209.0  7290.0  7371.0  7452.0  7533.0  7614.0  7695.0  7776.0  7857.0  7938.0  8019.0   8100.0\n  82.0  164.0  246.0  328.0  410.0  492.0  574.0  656.0  738.0   820.0   902.0   984.0  1066.0     7298.0  7380.0  7462.0  7544.0  7626.0  7708.0  7790.0  7872.0  7954.0  8036.0  8118.0   8200.0\n  83.0  166.0  249.0  332.0  415.0  498.0  581.0  664.0  747.0   830.0   913.0   996.0  1079.0     7387.0  7470.0  7553.0  7636.0  7719.0  7802.0  7885.0  7968.0  8051.0  8134.0  8217.0   8300.0\n  84.0  168.0  252.0  336.0  420.0  504.0  588.0  672.0  756.0   840.0   924.0  1008.0  1092.0     7476.0  7560.0  7644.0  7728.0  7812.0  7896.0  7980.0  8064.0  8148.0  8232.0  8316.0   8400.0\n  85.0  170.0  255.0  340.0  425.0  510.0  595.0  680.0  765.0   850.0   935.0  1020.0  1105.0     7565.0  7650.0  7735.0  7820.0  7905.0  7990.0  8075.0  8160.0  8245.0  8330.0  8415.0   8500.0\n  86.0  172.0  258.0  344.0  430.0  516.0  602.0  688.0  774.0   860.0   946.0  1032.0  1118.0  …  7654.0  7740.0  7826.0  7912.0  7998.0  8084.0  8170.0  8256.0  8342.0  8428.0  8514.0   8600.0\n  87.0  174.0  261.0  348.0  435.0  522.0  609.0  696.0  783.0   870.0   957.0  1044.0  1131.0     7743.0  7830.0  7917.0  8004.0  8091.0  8178.0  8265.0  8352.0  8439.0  8526.0  8613.0   8700.0\n  88.0  176.0  264.0  352.0  440.0  528.0  616.0  704.0  792.0   880.0   968.0  1056.0  1144.0     7832.0  7920.0  8008.0  8096.0  8184.0  8272.0  8360.0  8448.0  8536.0  8624.0  8712.0   8800.0\n  89.0  178.0  267.0  356.0  445.0  534.0  623.0  712.0  801.0   890.0   979.0  1068.0  1157.0     7921.0  8010.0  8099.0  8188.0  8277.0  8366.0  8455.0  8544.0  8633.0  8722.0  8811.0   8900.0\n  90.0  180.0  270.0  360.0  450.0  540.0  630.0  720.0  810.0   900.0   990.0  1080.0  1170.0     8010.0  8100.0  8190.0  8280.0  8370.0  8460.0  8550.0  8640.0  8730.0  8820.0  8910.0   9000.0\n  91.0  182.0  273.0  364.0  455.0  546.0  637.0  728.0  819.0   910.0  1001.0  1092.0  1183.0  …  8099.0  8190.0  8281.0  8372.0  8463.0  8554.0  8645.0  8736.0  8827.0  8918.0  9009.0   9100.0\n  92.0  184.0  276.0  368.0  460.0  552.0  644.0  736.0  828.0   920.0  1012.0  1104.0  1196.0     8188.0  8280.0  8372.0  8464.0  8556.0  8648.0  8740.0  8832.0  8924.0  9016.0  9108.0   9200.0\n  93.0  186.0  279.0  372.0  465.0  558.0  651.0  744.0  837.0   930.0  1023.0  1116.0  1209.0     8277.0  8370.0  8463.0  8556.0  8649.0  8742.0  8835.0  8928.0  9021.0  9114.0  9207.0   9300.0\n  94.0  188.0  282.0  376.0  470.0  564.0  658.0  752.0  846.0   940.0  1034.0  1128.0  1222.0     8366.0  8460.0  8554.0  8648.0  8742.0  8836.0  8930.0  9024.0  9118.0  9212.0  9306.0   9400.0\n  95.0  190.0  285.0  380.0  475.0  570.0  665.0  760.0  855.0   950.0  1045.0  1140.0  1235.0     8455.0  8550.0  8645.0  8740.0  8835.0  8930.0  9025.0  9120.0  9215.0  9310.0  9405.0   9500.0\n  96.0  192.0  288.0  384.0  480.0  576.0  672.0  768.0  864.0   960.0  1056.0  1152.0  1248.0  …  8544.0  8640.0  8736.0  8832.0  8928.0  9024.0  9120.0  9216.0  9312.0  9408.0  9504.0   9600.0\n  97.0  194.0  291.0  388.0  485.0  582.0  679.0  776.0  873.0   970.0  1067.0  1164.0  1261.0     8633.0  8730.0  8827.0  8924.0  9021.0  9118.0  9215.0  9312.0  9409.0  9506.0  9603.0   9700.0\n  98.0  196.0  294.0  392.0  490.0  588.0  686.0  784.0  882.0   980.0  1078.0  1176.0  1274.0     8722.0  8820.0  8918.0  9016.0  9114.0  9212.0  9310.0  9408.0  9506.0  9604.0  9702.0   9800.0\n  99.0  198.0  297.0  396.0  495.0  594.0  693.0  792.0  891.0   990.0  1089.0  1188.0  1287.0     8811.0  8910.0  9009.0  9108.0  9207.0  9306.0  9405.0  9504.0  9603.0  9702.0  9801.0   9900.0\n 100.0  200.0  300.0  400.0  500.0  600.0  700.0  800.0  900.0  1000.0  1100.0  1200.0  1300.0     8900.0  9000.0  9100.0  9200.0  9300.0  9400.0  9500.0  9600.0  9700.0  9800.0  9900.0  10000.0" == "100×100 Array{Float64,2}:\n   1.0    2.0    3.0    4.0    5.0    6.0  …    97.0    98.0    99.0    100.0\n   2.0    4.0    6.0    8.0   10.0   12.0      194.0   196.0   198.0    200.0\n   3.0    6.0    9.0   12.0   15.0   18.0      291.0   294.0   297.0    300.0\n   4.0    8.0   12.0   16.0   20.0   24.0      388.0   392.0   396.0    400.0\n   5.0   10.0   15.0   20.0   25.0   30.0      485.0   490.0   495.0    500.0\n   6.0   12.0   18.0   24.0   30.0   36.0  …   582.0   588.0   594.0    600.0\n   7.0   14.0   21.0   28.0   35.0   42.0      679.0   686.0   693.0    700.0\n   8.0   16.0   24.0   32.0   40.0   48.0      776.0   784.0   792.0    800.0\n   9.0   18.0   27.0   36.0   45.0   54.0      873.0   882.0   891.0    900.0\n  10.0   20.0   30.0   40.0   50.0   60.0      970.0   980.0   990.0   1000.0\n   ⋮                                  ⋮    ⋱                                 \n  92.0  184.0  276.0  368.0  460.0  552.0     8924.0  9016.0  9108.0   9200.0\n  93.0  186.0  279.0  372.0  465.0  558.0     9021.0  9114.0  9207.0   9300.0\n  94.0  188.0  282.0  376.0  470.0  564.0     9118.0  9212.0  9306.0   9400.0\n  95.0  190.0  285.0  380.0  475.0  570.0     9215.0  9310.0  9405.0   9500.0\n  96.0  192.0  288.0  384.0  480.0  576.0  …  9312.0  9408.0  9504.0   9600.0\n  97.0  194.0  291.0  388.0  485.0  582.0     9409.0  9506.0  9603.0   9700.0\n  98.0  196.0  294.0  392.0  490.0  588.0     9506.0  9604.0  9702.0   9800.0\n  99.0  198.0  297.0  396.0  495.0  594.0     9603.0  9702.0  9801.0   9900.0\n 100.0  200.0  300.0  400.0  500.0  600.0     9700.0  9800.0  9900.0  10000.0"
Error in testset ranges:
Test Failed
  Expression: replstrmime(LinSpace{Float64}(0, 100, 10000)) == "10000-element LinSpace{Float64}:\n 0.0,0.010001,0.020002,0.030003,0.040004,…,99.95,99.96,99.97,99.98,99.99,100.0"
   Evaluated: "10000-element LinSpace{Float64}:\n 0.0,0.010001,0.020002,0.030003,0.040004,0.050005,0.060006,0.070007,0.080008,0.090009,0.10001,…,99.85,99.86,99.87,99.88,99.89,99.9,99.91,99.92,99.93,99.94,99.95,99.96,99.97,99.98,99.99,100.0" == "10000-element LinSpace{Float64}:\n 0.0,0.010001,0.020002,0.030003,0.040004,…,99.95,99.96,99.97,99.98,99.99,100.0"
ERROR: LoadError: Test run finished with errors

@StefanKarpinski
Copy link
Sponsor Member

Can you make a new PR against the release-0.6 branch so that we can see how this does in CI there?

bluesmoon added a commit to bluesmoon/julia that referenced this pull request Jul 13, 2018
There are cases (eg: when __gmpz_init is called from python via PyCall in a
secondary thread) where ptls->safepoint is NULL when maybe_collect is called,
and *ptls->safepoint causes a NULL pointer dereference and a segfault.  This
change fixes that case.

Included test in test/threads.jl that will reproduce this issue.

See JuliaLang#27020 for backtrace and more details
@bluesmoon
Copy link
Contributor Author

Added #28105

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jul 13, 2018

LGTM, just need to get CI passing

benlorenz pushed a commit to benlorenz/julia that referenced this pull request May 28, 2019
There are cases (eg: when __gmpz_init is called from python via PyCall in a
secondary thread) where ptls->safepoint is NULL when maybe_collect is called,
and *ptls->safepoint causes a NULL pointer dereference and a segfault.  This
change fixes that case.

Included test in test/threads.jl that will reproduce this issue.

See JuliaLang#27020 for backtrace and more details
benlorenz pushed a commit to benlorenz/julia that referenced this pull request May 28, 2019
There are cases (eg: when __gmpz_init is called from python via PyCall in a
secondary thread) where ptls->safepoint is NULL when maybe_collect is called,
and *ptls->safepoint causes a NULL pointer dereference and a segfault.  This
change fixes that case.

Included test in test/threads.jl that will reproduce this issue.

See JuliaLang#27020 for backtrace and more details
@benlorenz
Copy link
Contributor

This is still an issue (we just hit this with a library using openmp and gmp) and the patch still applies to the current master (except for some minor changes in the testcase). Can someone have a look at this please?
I have rebased it here: https://github.com/benlorenz/julia/tree/fix/gc-segfault-rebased

I have also tested the patch with release 1.1.1 and all tests seem to pass (except for some definitely unrelated things).

@JeffBezanson
Copy link
Sponsor Member

Please open a new PR against master (OP is also welcome to rebase this one).

benlorenz pushed a commit to benlorenz/julia that referenced this pull request Jun 6, 2019
There are cases (eg: when __gmpz_init is called from python via PyCall in a
secondary thread) where ptls->safepoint is NULL when maybe_collect is called,
and *ptls->safepoint causes a NULL pointer dereference and a segfault.  This
change fixes that case.

Included test in test/threads.jl that will reproduce this issue.

See JuliaLang#27020 for backtrace and more details
benlorenz pushed a commit to benlorenz/julia that referenced this pull request Jul 23, 2019
There are cases (eg: when __gmpz_init is called from python via PyCall in a
secondary thread) where ptls->safepoint is NULL when maybe_collect is called,
and *ptls->safepoint causes a NULL pointer dereference and a segfault.  This
change fixes that case.

Included test in test/threads.jl that will reproduce this issue.

See JuliaLang#27020 for backtrace and more details
benlorenz pushed a commit to benlorenz/julia that referenced this pull request Jul 23, 2019
There are cases (eg: when __gmpz_init is called from python via PyCall in a
secondary thread) where ptls->safepoint is NULL when maybe_collect is called,
and *ptls->safepoint causes a NULL pointer dereference and a segfault.  This
change fixes that case.

Included test in test/threads.jl that will reproduce this issue.

See JuliaLang#27020 for backtrace and more details
@vtjnash vtjnash closed this Sep 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants