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

stage0 compiler doesn't work on x86_64 debian wheezy #3641

Closed
brson opened this issue Oct 2, 2012 · 7 comments
Closed

stage0 compiler doesn't work on x86_64 debian wheezy #3641

brson opened this issue Oct 2, 2012 · 7 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. O-linux Operating system: Linux

Comments

@brson
Copy link
Contributor

brson commented Oct 2, 2012

It hangs before the Rust main function when building core.

@shizmob
Copy link
Contributor

shizmob commented Oct 2, 2012

Runtime log (RUST_LOG=::rt):

rust: new dom 0x1fbfbb0
rust: created task thread: 0x1fbfba0, id: 0, live_threads: 1
rust: Disallowing osmain scheduler to exit
rust: new dom 0x1fc1150
rust: created task thread: 0x1fc1140, id: 0, live_threads: 1
rust: Creating task main, on thread 0.
rust: Registering task
rust: New non-weak tasks 1
rust: new task 0x1fc25b0
rust: sizeof(task) = 736 (0x2e0)
rust: creating new stack for task 1fc25b0
rust: calculating new stack size for 0x1fc25b0
rust: min: 768 current: 0 requested: 768
rust: next stack size: 768
rust: new stk 0x1fc28f0
rust: stk end 0x1fc3420
rust: created task: 0x1fc25b0, spawner: (none), name: main
rust: startup: 8 args in 0x1fc3460
rust: startup: arg[0] = 'x86_64-unknown-linux-gnu/stage0/bin/rustc'
rust: startup: arg[1] = '--cfg'
rust: startup: arg[2] = 'stage0'
rust: startup: arg[3] = '-O'
rust: startup: arg[4] = '--target=x86_64-unknown-linux-gnu'
rust: startup: arg[5] = '-o'
rust: startup: arg[6] = 'x86_64-unknown-linux-gnu/stage0/lib/rustc/x86_64-unknown-linux-gnu/lib/libcore.so'
rust: startup: arg[7] = '/root/rust/rust/src/libcore/core.rc'
rust: starting task from fn 0x4110a0 with env 0x0 and arg 0x1fc3460
rust: task main 0x1fc1150 state change 'newborn' -> 'running' while in 'newborn'
rust: pumping scheduler
rust: scheduler 0 resuming ...
rust: worker 0, number_of_live_tasks = 0
rust: all tasks are blocked, scheduler id 0 yielding ...
rust: blocking scheduler

It seems to be some kind of deadlock as the only thread is hanging in pthread_wait.

@shizmob
Copy link
Contributor

shizmob commented Oct 3, 2012

The machine is also running on a GRSecurity-patched kernel, although I don't get any grsec kernel logs during the compilation progress it might be an obscure intervention.

@brson
Copy link
Contributor Author

brson commented Oct 3, 2012

Oh, that's interesting. We have another report that rustc doesn't work with PAX kernels.

@brson
Copy link
Contributor Author

brson commented Oct 3, 2012

I guess GRSecurity and PAX are the same thing? #1708

@shizmob
Copy link
Contributor

shizmob commented Oct 3, 2012

PaX is generally a part of GRSecurity, yes.
Marking the rustc binary with MPROTECT disabled (paxctl -cm /path/to/rustc) causes the compiler to work fine. :)

I'd recommend detecting if paxctl is installed and if GRSecurity is activated (you could try probing if /proc/sys/kernel/grsecurity exists) and then mark appropriately? You do need root privileges to use paxctl.

@graydon
Copy link
Contributor

graydon commented Oct 3, 2012

We should fix this in general. I'll try to remember to put a grsec kernel into the buildbot cluster for part of the breadth testing. It's common enough and we really ought to be able to live with it.

@graydon
Copy link
Contributor

graydon commented Oct 4, 2012

Fixed.

@graydon graydon closed this as completed Oct 4, 2012
RalfJung pushed a commit to RalfJung/rust that referenced this issue Jun 9, 2024
move ./miri environment variables to CONTRIBUTING

The README should discuss `cargo miri`, i.e. what users usually use, not the developer-only `./miri`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. O-linux Operating system: Linux
Projects
None yet
Development

No branches or pull requests

3 participants