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

Abort at program exist with RUST_LOG=debug and SIngleThreaded task #10405

Closed
MicahChalmer opened this issue Nov 10, 2013 · 1 comment · Fixed by #10406
Closed

Abort at program exist with RUST_LOG=debug and SIngleThreaded task #10405

MicahChalmer opened this issue Nov 10, 2013 · 1 comment · Fixed by #10406

Comments

@MicahChalmer
Copy link
Contributor

If you set RUST_LOG=debug and run a program that spawns a task in SingleThreaded mode, the program will abort at the end with a lovecraft quote and the message "thread-local pointer is null. bogus!" This program is sufficient to see the crash:

use std::task;

fn main() {
    let mut t = task::task();
    t.sched_mode(task::SingleThreaded);
    t.spawn(|| ());
}

The output, if run with RUST_LOG=debug:

spawn calling run_task
boostrapping a 1:1 scheduler


The ocean ate the last of the land and poured into the smoking gulf, thereby
giving up all it had ever conquered. From the new-flooded lands it flowed
again, uncovering death and decay; and from its ancient and immemorial bed it
trickled loathsomely, uncovering nighted secrets of the years when Time was
young and the gods unborn. Above the waves rose weedy remembered spires. The
moon laid pale lilies of light on dead London, and Paris stood up from its damp
grave to be sanctified with star-dust. Then rose spires and monoliths that were
weedy but not remembered; terrible spires and monoliths of lands that men never
knew were lands...

fatal runtime error: thread-local pointer is null. bogus!

without RUST_LOG=debug it runs fine.

@alexcrichton
Copy link
Member

Hm, this appears to be my fault as part of 8b4423b. Before that commit these components were using rtdebug which uses blocking native I/O instead of libuv I/O. I think that these blocks of code are running too soon for libuv I/O to work, so they should probably just get removed.

bors added a commit that referenced this issue Nov 11, 2013
The logging macros all use libuv-based I/O, and there was one stray debug
statement in task::spawn which was executing before the I/O context was ready.
Remove it and add a test to make sure that we can continue to debug this sort of
code.

Closes #10405
flip1995 pushed a commit to flip1995/rust that referenced this issue Mar 10, 2023
Fix ICE in `multiple_unsafe_ops_per_block`

fixes rust-lang#10367

changelog: [`multiple_unsafe_ops_per_block`]: Fix ICE when calling a function-like object in an unsafe block
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 a pull request may close this issue.

2 participants