But that would disable mmap IO on systems that don't support fallocate. I'm not sure if OpenBSD people are for example happy about that. On Mon, Oct 30, 2017 at 2:03 PM, Rafael Avila de Espindola < rafael.espindola at gmail.com> wrote:> Rui Ueyama via llvm-dev <llvm-dev at lists.llvm.org> writes: > > > If your system does not support fallocate(2), we use ftruncate(2) to > create > > an output file. fallocate(2) succeeds even if your disk have less space > > than the requested size, because it creates a sparse file. If you mmap > such > > sparse file, you'll receive a SIGBUS when the disk actually becomes full. > > > > So, lld can die suddenly with SIGBUS when your disk becomes full, and > > currently we are not doing anything about it. It's sometimes hard to > notice > > that that was caused by the lack of disk space. > > > > I wonder if we should print out a hint (e.g. "Bus error -- disk full?") > > when we receive a SIGBUS. Any opinions? > > I think we should change the llvm implementation of resize_file to fail > if it cannot allocate the space. That is, it should only use ftruncate > on OS X where apparently HFS allocates space with it. > > If resize_file fails than lld can fail gracefully or use annonymous > memory and a plain write instead of mmap for producing the output. > > Cheers, > Rafael >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171030/4c21b6e2/attachment.html>
Rafael Avila de Espindola via llvm-dev
2017-Oct-30 23:31 UTC
[llvm-dev] lld: sigbus error handling
Rui Ueyama <ruiu at google.com> writes:> But that would disable mmap IO on systems that don't support fallocate. I'm > not sure if OpenBSD people are for example happy about that.Only for output. It is hard to guess the preference of others, but if it was the system I was using I would prefer a more reliable linker until something like fallocate was provided by the file system. I remember trying to switch lld to always use an anonymous buffer, and it was really not that bad. Cheers, Rafael
On Mon, Oct 30, 2017 at 4:31 PM, Rafael Avila de Espindola < rafael.espindola at gmail.com> wrote:> Rui Ueyama <ruiu at google.com> writes: > > > But that would disable mmap IO on systems that don't support fallocate. > I'm > > not sure if OpenBSD people are for example happy about that. > > Only for output. It is hard to guess the preference of others, but if it > was the system I was using I would prefer a more reliable linker until > something like fallocate was provided by the file system. > > I remember trying to switch lld to always use an anonymous buffer, and > it was really not that bad. >Fair. I'll try to do that first before exploring the idea of setting a signal handler. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171030/e49a9900/attachment.html>