X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-yk0-f172.google.com (mail-yk0-f172.google.com [209.85.160.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 1BA89DC0191 for ; Wed, 9 Apr 2014 22:16:15 +0000 (UTC) Received: by mail-yk0-f172.google.com with SMTP id 200so2797773ykr.31 for ; Wed, 09 Apr 2014 15:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=jDC+aQnGA6b3iY4YKL6qM9X+zLR8Gbr3m59BMb8ms+U=; b=L5alMQ602gRzoXmVA63q8o2kSUFaipFjnnVdDEMH2ZXrRiyrjiqE8z+Sace0sOoiQy dy5hp9eJNZUzWnRhJ3D1Ddrh3VOtEu7CnA8Fe3L09QTo757i/qjpr0teSpf11Skn7xhf 33vIZSW6gIdO2K7P56wRWjL2er1e5YsHgQX/73jNfvBbZEWZoG/CcQI8li4fNYLqWp3b M1qNONtXXbJ2fTQ7fiGcLaRJI6y3d9IMzfGw2IQjVB0dHnp39iC+M0isc/MeHiUxG7U5 YQIaXF5iEVAEad2VEBPf61QZtf1U8wV7uHtQyjVE6QompzDSCR5/t+8BUDd/MFwmfFPC 5kJg== X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 X-Received: by 10.236.113.69 with SMTP id z45mr18013008yhg.0.1397081774402; Wed, 09 Apr 2014 15:16:14 -0700 (PDT) Received: by 10.170.94.8 with HTTP; Wed, 9 Apr 2014 15:16:14 -0700 (PDT) Date: Wed, 9 Apr 2014 17:16:14 -0500 Message-ID: Subject: [alpine-devel] Segfault in hwclock From: Jeff Pohlmeyer To: Alpine Content-Type: text/plain; charset=ISO-8859-1 The "hwclock" program from util-linux is crashing with musl. The problem is on line 393 of util-linux-2.23.2/sys-utils/hwclock.c: setenv("TZ", getenv("TZUTC"), TRUE); Apparently musl's version of setenv() doesn't like it when the second argument is NULL. ( The crash only happens if the "TZUTC" environment variable is unset. ) Here is a simple test app: /*********************************/ #include int main(int argc, char*argv[]) { setenv("FOO",NULL,1); return 0; } /*********************************/ Compiling with gcc -Wall on ArchLinux/GNU-libc, I get a warning: warning: null argument where non-null required (argument 2) [-Wnonnull] But the program doesn't crash at run time. With Alpine/musl, there is no compile time warning, but the program crashes. So it looks like musl's setenv() could stand to be a bit more robust, but hwclock really shouldn't be passing it a null, either. - Jeff --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---