1. 29 Jun, 2018 3 commits
  2. 27 Jun, 2018 2 commits
  3. 25 Jun, 2018 9 commits
  4. 23 Jun, 2018 2 commits
  5. 22 Jun, 2018 10 commits
  6. 21 Jun, 2018 14 commits
    • Philip Withnall's avatar
      Revert "build: Look for copied Objective-C files in builddir again" · 04c86912
      Philip Withnall authored
      This reverts commit fe72b877.
      
      It still fails on GNOME Continuous:
      http://build.gnome.org/continuous/buildmaster/builds/2018/06/21/44/build/.
      
      See GNOME/glib!129 for
      discussion.
      04c86912
    • Philip Withnall's avatar
      Merge branch 'fix-objc-build' into 'master' · bdb6af93
      Philip Withnall authored
      build: Look for copied Objective-C files in builddir again
      
      See merge request GNOME/glib!129
      bdb6af93
    • Philip Chimento's avatar
      build: Look for copied Objective-C files in builddir again · fe72b877
      Philip Chimento authored
      This reverts commit 03c324c6 and fixes
      the original problem with e004d5f3 that
      caused the revert.
      
      We use $(builddir) instead of $(abs_builddir) so that Automake's
      dependency generation works correctly.
      
      See !127.
      fe72b877
    • Philip Withnall's avatar
      Merge branch 'master' into 'master' · ca98ce42
      Philip Withnall authored
      Use posix_spawn for optimized process launching
      
      See merge request GNOME/glib!95
      ca98ce42
    • Daniel Drake's avatar
      gspawn: use sane_open() for stdin · 2b560457
      Daniel Drake authored
      sane_open() is used for stdout and stderr, but regular open() was being
      used for stdin. Spotted by Philip Withnall.
      2b560457
    • Daniel Drake's avatar
      gspawn: document FD_CLOEXEC behaviour · 86e2b8d4
      Daniel Drake authored
      G_SPAWN_LEAVE_DESCRIPTORS_OPEN must be set to enable the optimized
      posix_spawn codepath, so this flag is likely to see more usage now.
      
      Document that FD_CLOEXEC can be used to cause file descriptors to be
      automatically closed while this flag is used.
      86e2b8d4
    • Daniel Drake's avatar
      gdesktopappinfo: add g_desktop_app_info_launch_uris_as_manager_with_fds variant · 156d0096
      Daniel Drake authored
      Add an app-launching function which allows standard file descriptors
      to be passed to the child process.
      
      This will be used by gnome-shell to pass systemd journal descriptors
      as stdout/stderr. gnome-shell's child_setup function can then be
      eliminated, which will enable use of the posix_spawn optimized
      gspawn codepath for desktop app launching.
      156d0096
    • Daniel Drake's avatar
      gdesktopappinfo: enable fast posix_spawn gspawn codepath · 742efe62
      Daniel Drake authored
      In order to use the new posix_spawn gspawn codepath, for more robust
      app launching when available memory is low, we need to meet some
      conditions.
      
      child_setup needs to be NULL for this optimization to work, so drop
      the internal child_setup that is used here. Replace it with a lightweight
      wrapper binary (gio-launch-desktop) that sets GIO_LAUNCHED_DESKTOP_FILE_PID
      before executing the app.
      
      Adjust PATH for gio tests so that it can execute the new binary from the
      build directory.
      742efe62
    • Daniel Drake's avatar
      gspawn: Optimize with posix_spawn codepath · 61f54591
      Daniel Drake authored
      When the amount of free memory on the system is somewhat low, gnome-shell
      will sometimes fail to launch apps, reporting the error:
        fork(): Cannot allocate memory
      
      fork() is failing here because while cloning the process virtual address
      space, Linux worries that the thread being forked may end up COWing the
      entire address space of the parent process (gnome-shell, which is
      memory-hungry), and there is not enough free memory to permit that to
      happen.
      
      In this case we are simply calling fork() in order to quickly call exec(),
      which will throw away the entirity of the duplicated VM, so we should
      look for ways to avoid the overcommit check.
      
      The well known solution to this is to use clone(CLONE_VM) or vfork(), which
      completely avoids creating a new memory address space for the child.
      However, that comes with a bunch of caveats and complications:
      
        https://gist.github.com/nicowilliams/a8a07b0fc75df05f684c23c18d7db234
        https://ewontfix.com/7/
      
      In 2016, glibc's posix_spawn() was rewritten to use this approach
      while also resolving the concerns.
      https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9ff72da471a509a8c19791efe469f47fa6977410
      
      I experimented with a similar approach in glib, but it was not practical
      because glibc has several items of important internal knowledge (such as
      knowing which signals should be given special treatment because they are
      NPTL implementation details) that are not cleanly exposed elsewhere.
      
      Instead, this patch adapts the gspawn code to use posix_spawn() where
      possible, which will reap the benefits of that implementation.
      The posix_spawn API is more limited than the gspawn API though,
      partly due to natural limitations of using CLONE_VM, so the posix_spawn
      path is added as a separate codepath which is only executed when the
      conditions are right. Callers such as gnome-shell will have to be modified
      to meet these conditions, such as not having a child_setup function.
      
      In addition to allowing for the gnome-shell "Cannot allocate memory"
      failure to be avoided, this should result in a general speedup in this
      area, because fork()'s behaviour of cloning the entire VM space
      has a cost which is now avoided. posix_spawn() has also recently
      been optimized on OpenSolaris as the most performant way to spawn
      a child process.
      61f54591
    • Daniel Drake's avatar
      gspawn: Add g_spawn_async_with_fds variant · 3524de16
      Daniel Drake authored
      Add a new process spawning function variant which allows the caller
      to pass specific file descriptors for stdin, stdout and stderr.
      It is otherwise identical to g_spawn_async_with_pipes.
      
      Allow the same fd to be passed in multiple parameters. To make this
      workable, the child process logic that closes the fd after the first time
      it has been dup2'ed needed tweaking; we now just set those fds to be
      closed upon exec using the CLOEXEC flag. Add a test for this case.
      
      This will be used by gnome-shell to avoid performing equivalent
      dup2 actions in a child_setup function. Dropping use of child_setup will
      enable use of an upcoming optimized process spawning codepath.
      3524de16
    • Philip Withnall's avatar
      Merge branch 'support-tcrypt' into 'master' · 67001014
      Philip Withnall authored
      Add support for TCRYPT volumes to GMountOperation
      
      See merge request GNOME/glib!120
      67001014
    • segfault3's avatar
      Add support for TCRYPT volumes to GMountOperation · 76b4d0ab
      segfault3 authored
      Add G_ASK_PASSWORD_TCRYPT flag to GAskPasswordFlags and add the
      following properties to GMountOperation:
      
      - hidden_volume [1]
      - system_volume [2]
      - pim [3]
      
      [1] https://www.veracrypt.fr/en/Hidden%20Volume.html
      [2] https://www.veracrypt.fr/en/System%20Encryption.html
      [3] https://www.veracrypt.fr/en/Personal%20Iterations%20Multiplier%20(PIM).html
      76b4d0ab
    • Jehan's avatar
      glib: Win32 does not accept "wb+" mode for fopen(). · 2b6bfdb1
      Jehan authored
      Nevertheless it accepts "w+b".
      When checking the Win32 documentation of fopen()/_wfopen(), it clearly
      states:
      > In addition to the earlier values, the following characters can be
      > appended to mode to specify the translation mode for newline
      > characters.
      
      This implementation expects 'b' or 't' to be appended, and therefore
      "wb+" ends up with an error, whereas the alias "w+b" works perfectly
      while it is exactly the same thing. So let's just have glib "translate"
      the mode when it can to have it working transparently the same way on
      every platform.
      2b6bfdb1
    • Philip Withnall's avatar
      Revert "build: Look for copied Objective-C files in builddir" · 03c324c6
      Philip Withnall authored
      This reverts commit e004d5f3.
      
      It broke the GNOME Continuous build, which uses autotools. This wasn’t
      caught by CI because we don’t do an autotools CI build.
      
      http://build.gnome.org/continuous/buildmaster/builds/2018/06/21/19/build/
      
      Discussion in GNOME/glib!127.
      03c324c6