llvm.org GIT mirror llvm / 8b6be36
New document git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6275 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 16 years ago
1 changed file(s) with 197 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0
1 How to submit an LLVM bug report
2
3
4
5
6
  How to submit an LLVM bug report
7
8
9
10
11

12
13
  • Introduction - Got bugs?
  • 14
  • Crashing Bugs
  • 15
    16
  • Front-end bugs
  • 17
  • GCCAS bugs
  • 18
  • GCCLD bugs
  • 19
  • Bugs in LLVM passes
  • 20
    21
  • Miscompilations
  • 22
    23

    Written by Chris Lattner

    24

    25
    26
    27
    28
    29
    30
    31
    32
    33
    34 Introduction - Got bugs?
    35
    36
    37
    38 If you're working with LLVM and run into a bug, we definitely want to know about
    39 it. This document describes what you can do to increase the odds of getting it
    40 fixed quickly.

    41
    42 Basically you have to do two things at a minimum. First, decide whether the bug
    43 crashes the compiler (or an LLVM pass), or if the
    44 compiler is miscompiling the program. Based on
    45 what type of bug it is, follow the instructions in the linked section to narrow
    46 down the bug so that the person who fixes it will be able to find the problem
    47 more easily.

    48
    49 Once you have a reduced test-case, email information about the bug to:
    50 href="mailto:llvmbugs@cs.uiuc.edu">llvmbugs@cs.uiuc.edu. This should
    51 include all of the information necessary to reproduce the problem, including
    52 where you got the LLVM tree from (if you're not working out of CVS).

    53
    54 Thanks for helping us make LLVM better!

    55
    56
    57
    58
    59
    60 Crashing Bugs
    61
    62
    63
    64 More often than not, bugs in the compiler cause it to crash - often due to an
    65 assertion failure of some sort. If you are running opt or
    66 analyze directly, and something crashes, jump to the section on
    67 bugs in LLVM passes. Otherwise, the most important
    68 piece of the puzzle is to figure out if it is the GCC-based front-end that is
    69 buggy or if it's one of the LLVM tools that has problems.

    70
    71 To figure out which program is crashing (the front-end, gccas,
    72 or gccld), run the llvm-gcc command line as you
    73 were when the crash occurred, but add a -v option to the command line.
    74 The compiler will print out a bunch of stuff, and should end with telling you
    75 that one of cc1, gccas, or gccld
    76 crashed.

    77
    78
    79
  • If cc1 crashed, you found a problem with the front-end.
  • 80 Jump ahead to the section on front-end bugs.
    81
  • If gccas crashed, you found a bug in one of
  • 82 the passes in gccas.
    83
  • If gccld crashed, you found a bug in one
  • 84 of the passes in gccld.
    85
  • Otherwise, something really weird happened. Email the list with what you
  • 86 have at this point.
    87

    88
    89
    90
    91
    92
      
    93
    94 Front-end bugs
    95
    96
    97 If the problem is in the front-end, pretty much the only thing you can do is
    98 preprocess the input (compile with the -E option) and send us the
    99 results. There is no good way to reduce source-level test-cases that I know
    100 of... if you do know, send me information and we can extend this section. :)

    101
    102
    103
    104
    105
      
    106
    107 GCCAS bugs
    108
    109
    110 If you find that a bug crashes in the gccas stage of
    111 compilation, compile your test-case to a .s file with the -S
    112 option to llvm-gcc. Then run:

    113
    114
    
                      
                    
    115 gccas -debug-pass=Arguments < /dev/null -o - > /dev/null
    116

    117
    118 ... which will print a list of arguments, indicating the list of passes that
    119 gccas runs. Once you have the input file and the list of
    120 passes, go to the section on debugging bugs in LLVM
    121 passes.

    122
    123
    124
    125
    126
      
    127
    128 GCCLD bugs
    129
    130
    131 If you find that a bug crashes in the gccld stage of
    132 compilation, gather all of the .o bytecode files and libraries that are
    133 being linked together (the "llvm-gcc -v" output should include
    134 the full list of objects linked). Then run:

    135
    136
    
                      
                    
    137 gccld -debug-pass=Arguments < /dev/null -o - > /dev/null
    138

    139
    140 ... which will print a list of arguments, indicating the list of passes that
    141 gccld runs. Once you have the input files and the list of
    142 passes, go to the section on debugging bugs in LLVM
    143 passes.

    144
    145
    146
    147
      
    148
    149 Bugs in LLVM passes
    150
    151
    152 At this point, you should have some number of LLVM assembly files or bytecode
    153 files and a list of passes which crash when run on the specified input. In
    154 order to reduce the list of passes (which is probably large) and the input to
    155 something tractable, use the bugpoint tool as follows:

    156
    157
    
                      
                    
    158 bugpoint <input files> <list of passes>
    159

    160
    161 bugpoint will print a bunch of output as it reduces the
    162 test-case, but it should eventually print something like this:

    163
    164
    
                      
                    
    165 ...
    166 Emitted bytecode to 'bugpoint-reduced-simplified.bc'
    167
    168 *** You can reproduce the problem with: opt bugpoint-reduced-simplified.bc -licm
    169

    170
    171 Once you complete this, please send the LLVM bytecode file and the command line
    172 to reproduce the problem to the llvmbugs mailing list.

    173
    174
    175
    176
    177
    178 Miscompilations
    179
    180
    181
    182 Fortunately we haven't had to many miscompilations. Because of this, this
    183 section is a TODO. Basically, use bugpoint to track down the problem.

    184
    185
    186
    187
    188
    189
    190
    191
    Chris Lattner
    192
    193
    194 Last modified: Wed May 21 17:20:13 CDT 2003
    195
    196