From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A5C967A1A for ; Tue, 16 Apr 2024 09:49:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713260979; cv=none; b=BPpzIwWWU8QHXTw9FdVUXvLoZey6vKMb+WcKtr8SFdYkfI301oYNqqFC4JGyLEHodt7vSWJtCSxFa63qjIyMfTy7BbYJktuMR1sb5o0/zJKU51OVn0Z1y2078JXhkP+439oAwV/HJKMuNTsRg487XZ6wC3JByIkrBDnCZEHRB38= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713260979; c=relaxed/simple; bh=IfUar5t2OTWqKroocB+WahFM5JBPnaKjumkXVNiY+nU=; h=Message-ID:Date:From:To:Subject:MIME-Version:Content-Type; b=Tq3odjtwiPoJrFFPTtr6i9BcHaDHYxiffW97mkdXIheulqYu/SL5wy/Nuk7kfBtV5YMvGxIUpne1IFwbQ5Iq8L7w+mcHlncE4gujn4Twcvz8WaaCKa2yI3xIjCsUtuVrCgOsUjv3DOETob+1O3Gpm27WH65gFugX3bKvqMPsdl0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=drotek.com; spf=pass smtp.mailfrom=drotek.com; dkim=pass (2048-bit key) header.d=drotek-com.20230601.gappssmtp.com header.i=@drotek-com.20230601.gappssmtp.com header.b=mqPZBr5r; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=drotek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=drotek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=drotek-com.20230601.gappssmtp.com header.i=@drotek-com.20230601.gappssmtp.com header.b="mqPZBr5r" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-516d4d80d00so5130027e87.0 for ; Tue, 16 Apr 2024 02:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=drotek-com.20230601.gappssmtp.com; s=20230601; t=1713260976; x=1713865776; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:user-agent:subject:to:from :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=xkKFwVBNrkGrs1Z32pLYXtn2mqyARDa53STNPWGzJZE=; b=mqPZBr5rKBRJmVuNSrNTB8LUTXG03pFJex6Gp89AHxS/UWr8KeEBYfyJDgQlgax1sb Wka35cEG9m098tHMzm8W2Cc9VAlpNOUa/J93sdcvT5wa14HSi6v0+4DT2IqSMckqlOi9 DYbrIzmrlt6wjtrEIhkKsdzBeIR4YomeoSelsK0QwsgxqgWD4BZw8IPdLAqxHvK0yxLN DFbCfJ4pdi86ympLPkTt5kNaF2l8vNMRFoh8rSBWWcuqtOx+Cn+6eGpc0Q9TLGf+/fDq okTFKuUhLT0AQnn0mN9WB49lHQBMEfJPtdlFs7GijTkKzMGzL4FvHeJmXNlOyUCS/Bav jjtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713260976; x=1713865776; h=content-transfer-encoding:mime-version:user-agent:subject:to:from :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=xkKFwVBNrkGrs1Z32pLYXtn2mqyARDa53STNPWGzJZE=; b=Uv5wJkxNmmmjjrOvyi48AYKSshVcEL7iZJ3/7XDtowSINCXlG9yFO0YCRQac+w7gQ3 vkbPGjHJXYi0am6Yal0WXCqyIPtrQ5IDJozSlty54lMcsFF7ZpZRwTbFxz8RELOjOEa+ fgEcdaZuTj1RN7ECSB0crdU4obleAloycXBq5nPZ3++fJJ4e4sy3dqyjFUk6JB1pstqS duiK4knX2+F0SYZZLnwYCUL1Y7jP1yVzgiASqnPo413qn1webMh3S9V2t+ro+/4f3BPN UccQ0DJzg7bTTV1T90Q/mYaYsEdqe1z8vP3RxNt05HJAtaWC8+31FVUXU0oTjsvWFYBG 0iAw== X-Gm-Message-State: AOJu0YymzXbx0c6RIuBViPoaSm8COgIE6ASuGkc7QUSa+/Xc+qCe6cxU CgBGma7MuxBP4w9BxnxlbGtyUC6hEAFQ58JN7CVBk6poCjphR1gKiTyq8oeb6CT7F8Ii0+Fj5sl Q X-Google-Smtp-Source: AGHT+IHVobv+b24DDxy2iSoAsQHcBDFizPk2Ur8cWdlvwn6qSTvYMAV4bRduxk5EcqLC4jwRnullhA== X-Received: by 2002:a05:6512:3d28:b0:518:d85a:adf6 with SMTP id d40-20020a0565123d2800b00518d85aadf6mr5642721lfv.26.1713260975673; Tue, 16 Apr 2024 02:49:35 -0700 (PDT) Received: from Edoras.gmail.com (apoitiers-259-1-37-199.w90-55.abo.wanadoo.fr. [90.55.220.199]) by smtp.gmail.com with ESMTPSA id d16-20020adff2d0000000b003418364032asm14389811wrp.112.2024.04.16.02.49.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 02:49:35 -0700 (PDT) Message-ID: <661e49af.df0a0220.ffef6.a7bc@mx.google.com> Date: Tue, 16 Apr 2024 11:49:51 +0200 From: =?ISO-8859-1?Q?C=E9dric_Ch=E9pied?= To: xenomai@lists.linux.dev Subject: Posix timer creation failure User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: xenomai@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Hi all, I'm trying to execute a simple posix timer example (see code below). When I compile it "normally", it works fine but when I add xeno-config generated flags (to add RT tasks later) the create_timer function fails (invalid argument). Can somebody tell me what I am doing wrong please ? I'm running it on a 32 bit arm (imx6), could it be the "-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" options ? Thanks, Here is the code : static unsigned int pass_value_by_pointer = 42; void Timer_has_expired(union sigval timer_data) { printf("Timer expiration handler function; %d\n", *(int*) timer_data.sival_ptr); } int main(void) { struct sigevent timer_signal_event; timer_t timer; struct itimerspec timer_period; printf("Create timer\n"); timer_signal_event.sigev_notify = SIGEV_THREAD; timer_signal_event.sigev_notify_function = Timer_has_expired; timer_signal_event.sigev_value.sival_ptr = (void*) &pass_value_by_pointer; // as will this (both in a structure) timer_signal_event.sigev_notify_attributes = NULL; int ret = timer_create(CLOCK_MONOTONIC, &timer_signal_event, &timer); if (ret) { perror("timer_create"); exit(EXIT_FAILURE); } printf("Start timer\n"); timer_period.it_value.tv_sec = 1; // 1 second timer timer_period.it_value.tv_nsec = 0; // no nano-seconds timer_period.it_interval.tv_sec = 0; // non-repeating timer timer_period.it_interval.tv_nsec = 0; timer_settime(timer, 0, &timer_period, NULL); sleep(2); printf("----------------------------\n"); printf("Start timer a second time\n"); timer_settime(timer, 0, &timer_period, NULL); sleep(2); printf("----------------------------\n"); printf("Start timer a third time\n"); timer_settime(timer, 0, &timer_period, NULL); printf("Cancel timer\n"); timer_delete(timer); sleep(2); printf( "The timer expiration handler function should not have been called\n"); return EXIT_SUCCESS; } Here are compilation flags : sdk/sysroots/x86_64-fslcsdk-linux/usr/bin/arm-fslc-linux-gnueabi/arm-fslc-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi --sysroot=sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi -O2 -pipe -g -feliminate-unused-debug-types -Isdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi/usr/include/xenomai/cobalt -Isdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi/usr/include/xenomai -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map=/workdir/build/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/xenomai/3.2.4-r0=/usr/src/debug/xenomai/3.2.4-r0 -fdebug-prefix-map=/workdir/build/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/xenomai/3.2.4-r0=/usr/src/debug/xenomai/3.2.4-r0 -fdebug-prefix-map=sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi= -fdebug-prefix-map=sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi-native= -D_GNU_SOURCE -D_REENTRANT -fasynchronous-unwind-tables -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 -D__COBALT__ -Isdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi/usr/include/xenomai/alchemy -MD -MT CMakeFiles/timer.dir/timer.c.o -MF CMakeFiles/timer.dir/timer.c.o.d -o CMakeFiles/timer.dir/timer.c.o -c Tests/posixTimer/timer.c sdk/sysroots/x86_64-fslcsdk-linux/usr/bin/arm-fslc-linux-gnueabi/arm-fslc-linux-gnueabi-gcc -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi --sysroot=sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,--no-as-needed -Wl,@sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi/usr/lib/modechk.wrappers -lalchemy -lcopperplate sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi/usr/lib/xenomai/bootstrap.o -Wl,--wrap=main -Wl,--dynamic-list=sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi/usr/lib/dynlist.ld -Lsdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi/usr/lib -lcobalt -lmodechk -lpthread -lrt -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fmacro-prefix-map=/workdir/build/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/xenomai/3.2.4-r0=/usr/src/debug/xenomai/3.2.4-r0 -fdebug-prefix-map=/workdir/build/tmp/work/cortexa7t2hf-neon-fslc-linux-gnueabi/xenomai/3.2.4-r0=/usr/src/debug/xenomai/3.2.4-r0 -fdebug-prefix-map=sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi= -fdebug-prefix-map=sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi-native= -Wl,-z,relro,-z,now -Wl,@sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi/usr/lib/cobalt.wrappers -Wl,@sdk/sysroots/cortexa7t2hf-neon-fslc-linux-gnueabi/usr/lib/cobalt-glibc-time64.wrappers CMakeFiles/timer.dir/timer.c.o -o timer -- Cédric Chépied