Skip to content

nix-collect-garbage Bus error #58

Closed

Description

@aragnon

Assumptions:
-/nix is on the same file system as /
-the file system holding / has no space available

In this state, run nix-collect-garbage.

The result is:

Core was generated by `/usr/bin/nix-store --gc'.
Program terminated with signal 7, Bus error.
#0 0x00007fd87a46c939 in ?? ()

(gdb) bt
#0 0x00007fd87a46c939 in ?? ()
#1 0x0000000000d6b1f8 in ?? ()
#2 0x0000000000000000 in ?? ()

Activity

  1. edolstra commented on Oct 2, 2012

    @edolstra
    Member

    Can you run "nix-store --gc -vvvv"?

  2. edolstra commented on Oct 2, 2012

    @edolstra
    Member

    Also, what platform is this?

  3. aragnon commented on Oct 3, 2012

    @aragnon
    Author

    Do the following to reproduce this:

    dd if=/dev/urandom of=/x

    (this will exit when your file system is full)

    Now do: $ nix-store --gc -vvvv

    On my machine this gives no output other than the Bus error mentioned in my first message.

    Platform: Ubuntu Precise, x86-64

  4. edolstra commented on Oct 3, 2012

    @edolstra
    Member

    What Nix version is this? I've seen SQLite segfault if the disk is full, but Nix reserves some disk space (in /nix/var/nix/db/reserved) that it can delete prior to opening the SQLite DB for this reason.

  5. aragnon commented on Oct 3, 2012

    @aragnon
    Author

    (Nix) 1.1

    Have you actually followed my instructions?

  6. viric commented on Oct 20, 2012

    @viric
    Member

    SIGBUS should come mainly from misaligned memory accesses. In x86-64, I think that can happen only using SIMD instructions that require aligned memory pointers with unaligned memory pointers. I don't think there is any SIMD in all what nix runs, apart from glibc's memset or memcpy, that should be properly protected about alignments.

    Aragnon, can you disassemble in gdb at the sigbus location, and print 'info registers' to see what happened?

  7. edolstra commented on Feb 26, 2014

    @edolstra
    Member

    Closing because I can't reproduce. If the reserved file doesn't exist and the disk is full, I get error: setting synchronous mode: disk I/O error from SQLite.

  8. added a commit that references this issue on Aug 28, 2020
  9. added a commit that references this issue on Mar 5, 2025
  10. added a commit that references this issue on Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions