Opened 2 months ago

Closed 2 months ago

#9 closed defect (fixed)

[Rust 1.20.0 port] Crashes when building 1.20.0 in memory allocation/deallocation code

Reported by: nielx Owned by: nielx
Priority: major Milestone:
Component: rustc Version: 1.20.0
Keywords: Cc:

Description

When trying to build Rust 1.20.0, I run into an issue. During the stage 1 process, Rustc crashes while compiling rustc.

The error is Invalid opcode exception in the __rust_alloc function. See the rustc-56192-debug-13-05-2018-14-59-00.report attachment for a log.

One of the changes is that Rust now implements the stack probes llvm function, see below. If I disable this, I still get a crash while compiling, though it is in a different part of the process, but it still crashes. See rustc-78845-debug-13-05-2018-22-40-19.report.

Switching llvm to the version that can be found in Rust 1.21.0 did not change the crash.

Possible related changes:

  • #42727 rustc: Implement the #[global_allocator] attribute
  • #42816 rustc: Implement stack probes for x86

Attachments (4)

rustc-56192-debug-13-05-2018-14-59-00.report (22.4 KB) - added by nielx 2 months ago.
Crash with invalid opcode
rustc-78845-debug-13-05-2018-22-40-19.report (59.8 KB) - added by nielx 2 months ago.
Segmentation fault (stack probes disabled)
VirtualBox_Haiku x86_gcc2_19_05_2018_09_04_51.png (161.9 KB) - added by nielx 2 months ago.
VirtualBox_Haiku x86_gcc2_19_05_2018_09_05_55.png (155.9 KB) - added by nielx 2 months ago.
Virtual Memory

Download all attachments as: .zip

Change History (9)

Changed 2 months ago by nielx

Crash with invalid opcode

Changed 2 months ago by nielx

Segmentation fault (stack probes disabled)

comment:1 Changed 2 months ago by nielx

The invalid opcode is the UD2 opcode: https://x86.puri.sm/html/file_module_x86_id_318.html

This one is called explicitly by the code to generate this fault. Who is calling it? LLVM or Rust?

Last edited 2 months ago by nielx (previous) (diff)

comment:2 Changed 2 months ago by nielx

X86_64 build was succesful. I am now trying to increase the memory to the VM that is building Rust. Maybe we are just running out of memory.

comment:3 Changed 2 months ago by nielx

Resolution: fixed
Status: newclosed

It turns out we are running out of memory...

comment:4 Changed 2 months ago by nielx

Resolution: fixed
Status: closedreopened

Reopening as the OOM error is blocking compiling Rust 1.20.0

Changed 2 months ago by nielx

Virtual Memory

comment:5 Changed 2 months ago by nielx

Resolution: fixed
Status: reopenedclosed

On 32bit there is a per process limit of 2 GB. ASLR decreases the available space. Building with DISABLE_ASLR works.

Note: See TracTickets for help on using tickets.