rayon-rs / rayon

Rayon: A data parallelism library for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extremely deep call stack on MacOS

federicomenaquintero opened this issue · comments

From a librsvg issue, rayon_core seems to be creating extremely deep call stacks; this one is 510 frames deep. This is on M1 Ventura MacOS:

    1 Thread_27416763
    + 1 rayon_core::sleep::Sleep::sleep::h86f8a9d05521a830  (in librsvg-2.2.dylib) + 592  [0x10b02d640]
    +   1 rayon_core::sleep::Sleep::sleep::h86f8a9d05521a830  (in librsvg-2.2.dylib) + 592  [0x10b02d640]
    +     1 rayon_core::sleep::Sleep::sleep::h86f8a9d05521a830  (in librsvg-2.2.dylib) + 592  [0x10b02d640]
    +       1 rayon_core::sleep::Sleep::sleep::h86f8a9d05521a830  (in librsvg-2.2.dylib) + 592  [0x10b02d640]
    +         1 rayon_core::sleep::Sleep::sleep::h86f8a9d05521a830  (in librsvg-2.2.dylib) + 592  [0x10b02d640]
    +           1 rayon_core::sleep::Sleep::sleep::h86f8a9d05521a830  (in librsvg-2.2.dylib) + 592  [0x10b02d640]
    +             1 rayon_core::sleep::Sleep::sleep::h86f8a9d05521a830  (in librsvg-2.2.dylib) + 592  [0x10b02d640]
    +               1 rayon_core::sleep::Sleep::sleep::h86f8a9d05521a830  (in librsvg-2.2.dylib) + 592  [0x10b02d640]
... subsequent lines elided, scroll right to see the Condvar::wait at the end ...
    +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       1 rayon_core::sleep::Sleep::sleep::h86f8a9d05521a830  (in librsvg-2.2.dylib) + 592  [0x10b02d640]
    +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         1 std::sync::condvar::Condvar::wait::ha179af0cba2a2f35  (in librsvg-2.2.dylib) + 136  [0x10af28034]
    +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           1 _pthread_cond_wait  (in libsystem_pthread.dylib) + 1232  [0x1851a8574]
    +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             1 __psynch_cvwait  (in libsystem_kernel.dylib) + 8  [0x18516b710]

There are 10 threads like that.

Any ideas if this is normal? Librsvg just uses rayon::scope() in a single place.

That's not a recursive function. My guess is that the unwinder is getting confused somehow, not actually able to move up to the next call frame, and the depth seen in this report is just how many times the unwinder repeated before giving up.

Yeah, I assumed as much; thanks for confirming 😃 I'll close the bug until we get more info; so far the downstream bug doesn't indicate any actual trouble.