[vlc-commits] [Git][videolan/vlc][master] 2 commits: bin: do not override SIGPIPE in debug builds
Rémi Denis-Courmont (@Courmisch)
gitlab at videolan.org
Sun Jan 25 07:37:46 UTC 2026
Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC
Commits:
1ef3754d by Rémi Denis-Courmont at 2026-01-25T09:22:30+02:00
bin: do not override SIGPIPE in debug builds
This should have no effects. This is potentially hiding LibVLC bugs.
- - - - -
e2355530 by Rémi Denis-Courmont at 2026-01-25T09:22:30+02:00
posix: add $VLC_LIBEXEC_PATH
We already track $pkglibexecdir separately from $pkglibdir when VLC is
installed. This adds it in the build tree.
- - - - -
2 changed files:
- bin/vlc.c
- src/posix/dirs.c
Changes:
=====================================
bin/vlc.c
=====================================
@@ -116,15 +116,22 @@ static void exit_timeout (int signum)
*****************************************************************************/
int main(int argc, const char *argv[])
{
- /* The so-called POSIX-compliant MacOS X reportedly processes SIGPIPE even
- * if it is blocked in all thread.
- * Note: this is NOT an excuse for not protecting against SIGPIPE. If
- * LibVLC runs outside of VLC, we cannot rely on this code snippet. */
- signal (SIGPIPE, SIG_IGN);
- /* Restore SIGCHLD in case our parent process ignores it. */
+ /*
+ * Contrary to popular belief, `execl()`, `execv()` et al. do **not** reset
+ * signal handling to `SIG_DFL` default from `SIG_IGN`. So we restore the
+ * `SIGCHLD` handler to `SIG_DFL` here in the unlikely case that the parent
+ * had it set to `SIG_IGN`. Otherwise `waitpid()` will not work properly.
+ * NOTE WELL: This is a documented requirement of `libvlc_new()`.
+ */
signal (SIGCHLD, SIG_DFL);
-
-#ifndef NDEBUG
+#ifdef NDEBUG
+ /*
+ * Writing to a pipe with no open read end will raise `SIGPIPE` and kill
+ * the process *unless* proper care is taken. In principles, our code does
+ * take said care, but we are better safe than sorry in non-debug builds.
+ */
+ signal (SIGPIPE, SIG_IGN);
+#else
/* Activate malloc checking routines to detect heap corruptions. */
setenv ("MALLOC_CHECK_", "2", 1);
@@ -136,6 +143,7 @@ int main(int argc, const char *argv[])
setenv ("VLC_PLUGIN_PATH", TOP_BUILDDIR"/modules", 1);
setenv ("VLC_DATA_PATH", TOP_SRCDIR"/share", 1);
setenv ("VLC_LIB_PATH", TOP_BUILDDIR"/modules", 1);
+ setenv ("VLC_LIBEXEC_PATH", TOP_BUILDDIR"/modules", 1);
#endif
/* Clear the X.Org startup notification ID. Otherwise the UI might try to
=====================================
src/posix/dirs.c
=====================================
@@ -50,7 +50,7 @@ char *config_GetSysPath(vlc_sysdir_t type, const char *filename)
static const char env_vars[][16] = {
[VLC_PKG_DATA_DIR] = "VLC_DATA_PATH",
[VLC_PKG_LIB_DIR] = "VLC_LIB_PATH",
- [VLC_PKG_LIBEXEC_DIR] = "VLC_LIB_PATH",
+ [VLC_PKG_LIBEXEC_DIR] = "VLC_LIBEXEC_PATH",
};
if (type < ARRAY_SIZE(env_vars)) {
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dc69496e8a7d273a29b095b94bea403cfac7c1f5...e23555302f928e3ad750e2c8c8960ccf9ecffd58
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/dc69496e8a7d273a29b095b94bea403cfac7c1f5...e23555302f928e3ad750e2c8c8960ccf9ecffd58
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list