Skip to content

Julia 1.2 crashes with try/catch invalid rational #33085

Closed
@siroccal

Description

@siroccal
let
    for i = 1:2
        try 0//0 catch; end
    end
    if false; a = 0; end
    +a
end

or one-line let;for i=1:2;try 0//0 catch;end;end;if false;a=0;end;+a;end

This crashes with

Unreachable reached at 0x7f1cde7c33c3
signal (4): Illegal instruction
[...]
__libc_start_main at /lib64/libc.so.6 (unknown line)
unknown function (ip: 0x4015d4)

Removing or changing almost anything makes the bug disappear, including:

  • removing the let block (a function still crashes)
  • changing i=1:2 to i=1:1
  • changing 0//0 to 0//1 or 0/0 (but 0/(0//1) still crashes)
  • removing the try-catch
  • changing false to true
  • not assigning a in the if
  • not doing something with a after the if
Julia Version 1.2.0
Commit c6da87ff4b (2019-08-20 00:03 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: AMD Phenom(tm) II X4 955 Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, amdfam10)

I'm using the tarball downloaded from julialang.org.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions