Bug 44277 - make: cannot open output sync mutex
Summary: make: cannot open output sync mutex
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: glibc-source (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-11 15:10 MSK by Ivan A. Melnikov
Modified: 2023-05-22 06:54 MSK (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan A. Melnikov 2022-11-11 15:10:27 MSK
При пересборке cross-toolchain-* обновлённым make получаем ошибку:

[...]
+ make -j8
make -r PARALLELMFLAGS="" -C ../glibc objdir=`pwd` all
make[1]: Entering directory '/usr/src/RPM/BUILD/cross-toolchain-arm-linux-gnueabihf-20220605/glibc'
make[1]: *** cannot open output sync mutex /usr/src/tmp/GmWR7CBxr: No such file or directory.  Stop.
make[1]: Leaving directory '/usr/src/RPM/BUILD/cross-toolchain-arm-linux-gnueabihf-20220605/glibc'
make: *** [Makefile:9: all] Error 2
[...]

Ошибка прекрасно воспроизводится в локальном hasher на моём рабочем ноуте (Сизиф).
Comment 1 Ivan A. Melnikov 2022-11-11 15:12:15 MSK
Запустил под strace'ом и вижу такое:

[builder@localhost obj_glibc]$ grep /usr/src/tmp/Gmhy *strace*
the_make.strace.2131235:11:00:33.693720 openat(AT_FDCWD, "/usr/src/tmp/Gmhyxom8", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
the_make.strace.2131235:11:00:33.723026 unlink("/usr/src/tmp/Gmhyxom8") = 0
the_make.strace.2131236:11:00:33.702617 openat(AT_FDCWD, "/usr/src/tmp/Gmhyxom8", O_WRONLY) = 3
the_make.strace.2131236:11:00:33.702734 openat(AT_FDCWD, "/usr/src/tmp/Gmhyxom8", O_WRONLY) = 4
the_make.strace.2131236:11:00:33.722006 openat(AT_FDCWD, "/usr/src/tmp/Gmhyxom8r", O_WRONLY) = -1 ENOENT (No such file or directory)


Откуда взялся это 'r' в конце?
Comment 2 Alexey Gladkov 2022-11-11 15:24:53 MSK
похоже на use-after-free или просто ошибка индекса буфера.
Comment 3 Ivan A. Melnikov 2022-11-11 15:33:37 MSK
Совсем забыл:

$ rpm -qa make
make-4.4.0-alt1.x86_64
Comment 4 Ivan A. Melnikov 2022-11-11 15:35:07 MSK
(In reply to Alexey Gladkov from comment #2)
> похоже на use-after-free или просто ошибка индекса буфера.

Угу. Я пробовал запускать под valgrind'ом, ничего интересного.
Comment 5 Alexey Gladkov 2022-11-11 15:39:45 MSK
Сообщение отсюда:

https://git.altlinux.org/gears/m/make.git?p=make.git;a=blob;f=make/src/posixos.c#l668
Comment 6 Ivan A. Melnikov 2022-11-11 15:42:49 MSK
(In reply to Ivan A. Melnikov from comment #0)
> При пересборке cross-toolchain-* обновлённым make получаем ошибку

Ещё веслее: если попытаться после этого зайти в hsh-shell и запустить make, получим другую ошибку:

make[2]: *** Cannot open jobserver /usr/src/tmp/GMfifo2236197r: No such file or directory.  Stop.

Тоже 'r', но в другом месте. Причём этот 'r' уже присутсвует в переданных процессу MFLAGS (посмотрел на /exec в strace --ff -tt -v -s 99999).
Comment 7 Alexey Gladkov 2022-11-11 15:48:27 MSK
Возможно связанная проблема https://savannah.gnu.org/bugs/?63333
Comment 8 Dmitry V. Levin 2022-11-11 16:20:17 MSK
А это случайно не та же самая проблема, которая вылезла в glibc:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2d7ed98add14f75041499ac189696c9bd3d757fe
?
Comment 9 Alexey Gladkov 2022-11-11 16:21:28 MSK
-MAKEFLAGS := $(MAKEFLAGS)r
+MAKEFLAGS := $(MAKEFLAGS) -r

очень похоже.
Comment 10 Dmitry V. Levin 2022-11-11 16:44:11 MSK
Тогда это надо в пакетах исправлять.
Comment 11 Gleb F-Malinovskiy 2022-11-11 16:52:13 MSK
Значит в этом случае проблема в glibc-source?
Comment 12 Ivan A. Melnikov 2022-11-11 17:53:28 MSK
(In reply to Dmitry V. Levin from comment #8)
> А это случайно не та же самая проблема, которая вылезла в glibc:
> https://sourceware.org/git/?p=glibc.git;a=commitdiff;
> h=2d7ed98add14f75041499ac189696c9bd3d757fe
> ?

Да, оно, спасибо.

(In reply to Gleb F-Malinovskiy from comment #11)
> Значит в этом случае проблема в glibc-source?

Да, пожалуй.
Comment 13 Repository Robot 2022-11-12 13:09:40 MSK
glibc-6:2.35.0.6.491f2e-alt2 -> sisyphus:

 Sat Nov 12 2022 Gleb F-Malinovskiy <glebfm@altlinux> 6:2.35.0.6.491f2e-alt2
 - Backported upstream commits:
   + "Makerules: fix MAKEFLAGS assignment for upcoming make-4.4" to fix build with
   make 4.4 (thx Sergei Trofimovich) (ALT#44277);
   + "Avoid undefined behaviour in ibm128 implementation of llroundl"
   (thx Aurelien Jarno) to fix test-ibm128-llround test regression on ppc64le.
 - ppc64le: xfailed test-ibm128-y1 test.
Comment 14 Mike Alley 2023-05-22 06:54:21 MSK
The mutex merely assures that no two goroutines write/read the count at the same time; it has no control over the sequence in which those goroutines are performed.
https://retrobowlgo.com/