Hi, I found there is a race condition between lttng destroy and lttng load commands in deleting and creating the shared memory path.
lttng -V lttng (LTTng Trace Control) 2.8.6 - Isseki Nicho - v2.8.6 The test commands are as following: 1) lttng create rcs --shm-path=/var/log/lttng/shm 2) lttng enable-event -s rcs -c ch1 -a -u 3) lttng start rcs 4) lttng save rcs ./Application 5) lttng stop rcs 6) lttng destroy rcs 7) lttng load Added some debug logs in the following function, 570 int mkdir_check_exists(const char *path, mode_t mode) 571 { 572 int ret = 0; 573 struct stat st; 574 575 fprintf(stderr, "Path %s\n", path); 576 ret = stat(path, &st); 577 if (ret == 0) { 578 fprintf(stderr, "path stat %s\n", path); 579 fprintf(stderr, "Link count: %ld\n", (long) st.st_nlink); 580 if (S_ISDIR(st.st_mode)) { 581 /* Directory exists, skip. */ 582 goto end; 583 } else { 584 /* Exists, but is not a directory. */ 585 errno = ENOTDIR; 586 ret = -1; 587 goto end; 588 } 589 } 590 591 /* 592 * Let mkdir handle other errors as the caller expects mkdir 593 * semantics. 594 */ 595 ret = mkdir(path, mode); 596 if (ret) 597 PERROR("Mkdir path %s", path); 598 end: 599 return ret; 600 } The LTTng log is as following: ... DEBUG3 - 05:49:55.357467 [30485/30489]: mkdir() recursive /var/log/lttng/shm//rcs-20180529-034348/ust/uid/0/32-bit with mode 504 for uid 0 and gid 0 (in run_as_mkdir_recursive() at runas.c:472) DEBUG1 - 05:49:55.357490 [30485/30489]: Using run_as worker (in run_as() at runas.c:451) Path /var path stat /var Link count: 11 Path /var/log path stat /var/log Link count: 3 Path /var/log/lttng path stat /var/log/lttng Link count: 3 Path /var/log/lttng/shm path stat /var/log/lttng/shm Link count: 3 Path /var/log/lttng/shm/ path stat /var/log/lttng/shm/ Link count: 3 Path /var/log/lttng/shm//rcs-20180529-034348 path stat /var/log/lttng/shm//rcs-20180529-034348 Link count: 3 Path /var/log/lttng/shm//rcs-20180529-034348/ust path stat /var/log/lttng/shm//rcs-20180529-034348/ust Link count: 3 Path /var/log/lttng/shm//rcs-20180529-034348/ust/uid path stat /var/log/lttng/shm//rcs-20180529-034348/ust/uid Link count: 3 Path /var/log/lttng/shm//rcs-20180529-034348/ust/uid/0 path stat /var/log/lttng/shm//rcs-20180529-034348/ust/uid/0 Link count: 3 Path /var/log/lttng/shm//rcs-20180529-034348/ust/uid/0/32-bit PERROR - 05:49:55.363127 [30486/30486]: Mkdir path /var/log/lttng/shm//rcs-20180529-034348/ust/uid/0/32-bit: No such file or directory (in mkdir_check_exists() at utils.c:607) PERROR - 05:49:55.363156 [30486/30486]: mkdir recursive last element: No such file or directory (in _utils_mkdir_recursive_unsafe() at utils.c:692) PERROR - 05:49:55.363221 [30485/30489]: run_as_mkdir_recursive: No such file or directory (in ust_registry_session_init() at ust-registry.c:893) DEBUG3 - 05:49:55.363261 [30485/30489]: rmdir_recursive() /var/log/lttng/shm//rcs-20180529-034348 with for uid 0 and gid 0 (in run_as_rmdir_recursive() at runas.c:528) DEBUG1 - 05:49:55.363285 [30485/30489]: Using run_as worker (in run_as() at runas.c:451) DEBUG3 - 05:49:55.364605 [30486/30486]: Attempting rmdir /var/log/lttng/shm//rcs-20180529-034348 (in utils_recursive_rmdir() at utils.c:1343) DEBUG3 - 05:49:55.365543 [30485/30489]: Buffer registry per UID destroy with id: 2, ABI: 32, uid: 0 (in buffer_reg_uid_destroy() at buffer-registry.c:678) DEBUG3 - 05:49:55.365590 [30485/30489]: Buffer registry per UID find id: 2, ABI: 32, uid: 0 (in buffer_reg_uid_find() at buffer-registry.c:203) DEBUG3 - 05:49:55.365639 [30485/30487]: [ht-thread] Returning from poll on 2 fds. (in thread_ht_cleanup() at ht-cleanup.c:73) DEBUG1 - 05:49:55.365647 [30485/30489]: Sending response (size: 20, retcode: UST create channel failed (58)) (in thread_manage_clients() at main.c:4588) Regards, Liguang _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev