[GH-ISSUE #296] Fails on targets without threading support #131

Closed
opened 2026-06-08 11:25:49 +03:00 by zhus · 8 comments
Owner

Originally created by @omentic on GitHub (Jan 16, 2023).
Original GitHub issue: https://github.com/bootandy/dust/issues/296

Hi, upon running a compiled binary on my university's SSH servers, I'm greeted with the following panic:

Indexing ""... - - 0 0B filesthread 'main' panicked at 'The global thread pool has not been initialized.: ThreadPoolBuildError { kind: GlobalPoolAlreadyInitialized }', /home/a/apropos/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.3/src/registry.rs:170:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Originally created by @omentic on GitHub (Jan 16, 2023). Original GitHub issue: https://github.com/bootandy/dust/issues/296 Hi, upon running a compiled binary on my university's SSH servers, I'm greeted with the following panic: ```bash Indexing ""... - - 0 0B filesthread 'main' panicked at 'The global thread pool has not been initialized.: ThreadPoolBuildError { kind: GlobalPoolAlreadyInitialized }', /home/a/apropos/.cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.3/src/registry.rs:170:10 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ```
zhus closed this issue 2026-06-08 11:25:49 +03:00
Author
Owner

@bootandy commented on GitHub (Jan 18, 2023):

Interesting thanks.
Does running this beforehand make any difference?

export RAYON_NUM_THREADS=1

How about if we use build here https://rust-lang.github.io/hashbrown/rayon_core/struct.ThreadPoolBuilder.html#method.build
in the init_rayon() method in main.rs instead of build_global - does that make any difference ?

<!-- gh-comment-id:1386241502 --> @bootandy commented on GitHub (Jan 18, 2023): Interesting thanks. Does running this beforehand make any difference? `export RAYON_NUM_THREADS=1 ` How about if we use build here https://rust-lang.github.io/hashbrown/rayon_core/struct.ThreadPoolBuilder.html#method.build in the init_rayon() method in main.rs instead of build_global - does that make any difference ?
Author
Owner

@bootandy commented on GitHub (Jan 18, 2023):

I don't know how this would happen - you could also try wrapping the rayon build code in init_rayon and just ignoring the error - it would probably work fine if you did this.

<!-- gh-comment-id:1386246915 --> @bootandy commented on GitHub (Jan 18, 2023): I don't know how this would happen - you could also try wrapping the rayon build code in init_rayon and just ignoring the error - it would probably work fine if you did this.
Author
Owner

@omentic commented on GitHub (Jan 18, 2023):

export RAYON_NUM_THREADS=1 works! And is probably a better solution, given how unlikely it is to not have a threadpool.

<!-- gh-comment-id:1386290175 --> @omentic commented on GitHub (Jan 18, 2023): `export RAYON_NUM_THREADS=1` works! And is probably a better solution, given how unlikely it is to not have a threadpool.
Author
Owner

@kenden commented on GitHub (Feb 6, 2023):

Fist time dust usage:

$ RUST_BACKTRACE=full dust
thread 'main' panicked at 'The global thread pool has not been initialized.: ThreadPoolBuildError { kind: GlobalPoolAlreadyInitialized }', /cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.3/src/registry.rs:170:10
stack backtrace:
   0: 0x567847e6 - <unknown>
   1: 0x566f44b0 - <unknown>
   2: 0x5676131b - <unknown>
   3: 0x56785c2e - <unknown>
   4: 0x5678584d - <unknown>
   5: 0x56786803 - <unknown>
   6: 0x5678630b - <unknown>
   7: 0x5678626a - <unknown>
   8: 0x5678623a - <unknown>
   9: 0x56664487 - <unknown>
  10: 0x566648e7 - <unknown>
  11: 0x5670a097 - <unknown>
  12: 0x5668af11 - <unknown>
  13: 0x5667079b - <unknown>
  14: 0x56699a28 - <unknown>
  15: 0x56672392 - <unknown>
  16: 0x566a0be7 - main
  17: 0xf7c38519 - <unknown>
  18: 0xf7c385f3 - __libc_start_main
  19: 0x5666fa51 - <unknown>


$ dust --version
Dust 0.8.4

Linux info:
5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Setting
export RAYON_NUM_THREADS=1
works, but it is not the most welcoming message.

<!-- gh-comment-id:1418264231 --> @kenden commented on GitHub (Feb 6, 2023): Fist time dust usage: ```bash $ RUST_BACKTRACE=full dust thread 'main' panicked at 'The global thread pool has not been initialized.: ThreadPoolBuildError { kind: GlobalPoolAlreadyInitialized }', /cargo/registry/src/github.com-1ecc6299db9ec823/rayon-core-1.9.3/src/registry.rs:170:10 stack backtrace: 0: 0x567847e6 - <unknown> 1: 0x566f44b0 - <unknown> 2: 0x5676131b - <unknown> 3: 0x56785c2e - <unknown> 4: 0x5678584d - <unknown> 5: 0x56786803 - <unknown> 6: 0x5678630b - <unknown> 7: 0x5678626a - <unknown> 8: 0x5678623a - <unknown> 9: 0x56664487 - <unknown> 10: 0x566648e7 - <unknown> 11: 0x5670a097 - <unknown> 12: 0x5668af11 - <unknown> 13: 0x5667079b - <unknown> 14: 0x56699a28 - <unknown> 15: 0x56672392 - <unknown> 16: 0x566a0be7 - main 17: 0xf7c38519 - <unknown> 18: 0xf7c385f3 - __libc_start_main 19: 0x5666fa51 - <unknown> $ dust --version Dust 0.8.4 ``` Linux info: 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux Setting `export RAYON_NUM_THREADS=1` works, but it is not the most welcoming message.
Author
Owner

@bootandy commented on GitHub (Feb 13, 2023):

I'm not sure why this happens, but I don't see why I can't catch the exception.

I'm not sure where the global thread pool is being initialised from.

Does this branch fix the problem if you use that? @kenden / @j-james

https://github.com/bootandy/dust/pull/310

<!-- gh-comment-id:1428527031 --> @bootandy commented on GitHub (Feb 13, 2023): I'm not sure why this happens, but I don't see why I can't catch the exception. I'm not sure where the global thread pool is being initialised from. Does this branch fix the problem if you use that? @kenden / @j-james https://github.com/bootandy/dust/pull/310
Author
Owner

@omentic commented on GitHub (Feb 13, 2023):

Seems to fix it, yes.

<!-- gh-comment-id:1428563868 --> @omentic commented on GitHub (Feb 13, 2023): Seems to fix it, yes.
Author
Owner

@bootandy commented on GitHub (Feb 19, 2023):

Great I'll clean it up and merge it in and re-release

<!-- gh-comment-id:1435968268 --> @bootandy commented on GitHub (Feb 19, 2023): Great I'll clean it up and merge it in and re-release
Author
Owner

@bootandy commented on GitHub (Mar 14, 2023):

https://github.com/bootandy/dust/pull/310

<!-- gh-comment-id:1467637501 --> @bootandy commented on GitHub (Mar 14, 2023): https://github.com/bootandy/dust/pull/310
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#131