NetBSD Problem Report #54627

From  Fri Oct 18 13:01:05 2019
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id CB2347A173
	for <>; Fri, 18 Oct 2019 13:01:05 +0000 (UTC)
Message-Id: <>
Date: Fri, 18 Oct 2019 13:31:16 +0200 (CEST)
Subject: MySql-5.7 - bad pkgsrc-patch
X-Send-Pr-Version: 3.95

>Number:         54627
>Category:       pkg
>Synopsis:       mysql57: current-pkgsrc-patch lead to random data passed to kqueue call
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 18 13:05:00 +0000 2019
>Last-Modified:  Fri Aug 14 01:21:47 +0000 2020
>Originator:     Wolfgang Stukenbrock
>Release:        NetBSD 8.1_STABLE / pkgsrc-2019Q2
Dr. Nagler & Comapny GmbH


System: NetBSD s048 8.1_STABLE NetBSD 8.1_STABLE (NSW-S050) #19: Thu Oct 17 10:04:17 CEST 2019 cawinkle@s012:/export2/NetBSD-8.0/N+C-build/.OBJDIR_amd64/export2/NetBSD-8.0/src/sys/arch/amd64/compile/NSW-S050 amd64
Architecture: x86_64
Machine: amd64
	netbsd does not support EVFILT_USER macro in contents kernel-queue.
	Someone has added a patch to mysql57-server (and client) that simply avoids use of the macro.
	Accedently now some uninitializd data is passsed to kqueue() call.
	Here (one of) the affected code parts: (from mysys/kqueue_timers.c)

static int
  struct kevent kev;

  EV_SET(&kev, 0, EVFILT_USER, EV_ADD, 0, 0, 0);

  if (kevent(kq_fd, &kev, 1, NULL, 0, NULL) < 0)
    my_message_local(ERROR_LEVEL, "Failed to create event (errno= %d).", errno);
    return -1;

  return mysql_thread_create(key_thread_timer_notifier, &timer_notify_thread,
                             NULL, timer_notify_thread_func, NULL);

	The patch added the #ifdef and now variable kev is not initialized anymore ...
	In most cases this will simply lead to errno = 22 message, but it may do 'something' if the
	random data is not invalid.
	Compile and install mysql57-server. start it. you will see the ERROR messages with errno = 22
	Do not simply include setup-macro with patch, make shure that whole routine is disabled.
	(or implement EVFILT_USER in NetBSD ...)



Responsible-Changed-From-To: gnats-admin->pkg-manager
Responsible-Changed-When: Fri, 14 Aug 2020 01:21:47 +0000
PR landed in "pending" for no visible reason


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: gnats-precook-prs,v 1.4 2018/12/21 14:20:20 maya Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.