[PATCH] D13128: Fix backend crash on multiple close of stdout.

Dan Gohman via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 29 00:02:25 PDT 2015


sunfish added a comment.

> In any case, that's not how clang deal with usage or even internal unexpected errors. It asserts, print error messages but does not crash on purpose. Having clang crash here does not seem like a good solution and will result in this issue continue to surface again.


When clang has bugs, it is common for it to crash unceremoniously. That said, if you know of a reasonable way to assert here before the crash, that'd be great.

> The bad thing is that the same problem can be reproduced not only in frontend, but also in opt tool. The test I wrote (test/Other/empty.ll) also failed with the same message.


This could also be interpreted as opt failing to check for incompatible command-line options. One of the command-line options in this case is a hidden option, so this isn't especially surprising.

> And Yaron is right, I need to mix several outputs in stdout. What should I do in this case?


What's the context? It may be worth investigating whether there are other ways to address your need.

If you want to use -rewrite-map-file and -info-output-file in a testcase at the same time, see the documentation for '%t' in the TestingGuide for creating multiple temporary output files.


http://reviews.llvm.org/D13128





More information about the cfe-commits mailing list