Skip to content

Commit 222c5cc

Browse files
committed
Merge branch '2.9'
# Conflicts: # .github/workflows/ci.yml # debian/changelog # debian/configure # debian/rules.in # scripts/runtests.in
2 parents 9274bb5 + 0eab8f8 commit 222c5cc

7 files changed

Lines changed: 59 additions & 33 deletions

File tree

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Just a couple of buttons to invoke a manual - xdg-open is a recommended dependency via xdg-utils
2-
linuxcnc-doc-de: desktop-command-not-in-package usr/share/applications/linuxcnc-documentation-de.desktop xdg-open
3-
linuxcnc-doc-de: desktop-command-not-in-package usr/share/applications/linuxcnc-gettingstarted-de.desktop xdg-open
4-
linuxcnc-doc-de: desktop-command-not-in-package usr/share/applications/linuxcnc-integratorinfo-de.desktop xdg-open
2+
linuxcnc-doc-de: desktop-command-not-in-package xdg-open [usr/share/applications/linuxcnc-integratorinfo_de.desktop]
3+
linuxcnc-doc-de: desktop-command-not-in-package xdg-open [usr/share/applications/linuxcnc-documentation_de.desktop]
4+
linuxcnc-doc-de: desktop-command-not-in-package x-www-browser [usr/share/applications/linuxcnc-gcoderef_de.desktop]
5+
linuxcnc-doc-de: desktop-command-not-in-package xdg-open [usr/share/applications/linuxcnc-gettingstarted_de.desktop]
6+

debian/linuxcnc.lintian-overrides.in

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,8 @@ linuxcnc-uspace: elevated-privileges 4755 root/root [usr/bin/rtapi_app]
1111
# that is intentional - for now
1212
linuxcnc-uspace: package-name-doesnt-match-sonames liblinuxcnchal0 liblinuxcncini0 libnml0 libposemath0 libpyplugin0 librs274-0 libtooldata0
1313

14-
# The man pages / documentation is likely to see an overhaul in a not too far future, prefer no to distract ourselves with these
15-
linuxcnc-uspace: groff-message 19: can't open '../man/images/toggle.ps': No such file or directory [usr/share/man/man9/toggle.9.gz:1]
16-
linuxcnc-uspace: groff-message 28: can't open '../man/images/toggle2nist.ps': No such file or directory [usr/share/man/man9/toggle2nist.9.gz:1]
17-
1814
# These are dlopened by rtapi_app, which is already linked against libc.
19-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/bldc.so]
20-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/lineardeltakins.so]
21-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/maxkins.so]
22-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/pentakins.so]
23-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/plasmac.so]
24-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/rosekins.so]
25-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/rotarydeltakins.so]
26-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/rotatekins.so]
27-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/scorbot-kins.so]
28-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/siggen.so]
29-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/tpmod.so]
30-
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/tripodkins.so]
15+
linuxcnc-uspace: library-not-linked-against-libc [usr/lib/linuxcnc/modules/*.so]
3116

17+
# Not of immediate concern - https://lintian.debian.org/tags/shared-library-lacks-prerequisites.html
18+
linuxcnc-uspace: shared-library-lacks-prerequisites [usr/lib/linuxcnc/modules/*.so]

scripts/runtests.in

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,41 @@ clean () {
5656
-print0 | xargs -0 rm -f
5757
}
5858

59+
wait_for_result_close() {
60+
# Test for the 'result' and 'stderr' files in the current testdir to be
61+
# closed. The 'checkresult' script cannot be run if these files are still
62+
# in use and would cause a race condition.
63+
# This function should be called with the test's directory as CWD.
64+
presult="$(realpath -e -q "./result")"
65+
pstderr="$(realpath -e -q "./stderr")"
66+
if [ -z "$presult" ] || [ -z "$pstderr" ]; then
67+
echo "Internal error: Missing 'result' or 'stderr' in wait_for_result_close()"
68+
exit 2
69+
fi
70+
timeoutcnt=0
71+
while true; do
72+
lsof -- "$presult" > /dev/null 2>&1; resresult=$?
73+
lsof -- "$pstderr" > /dev/null 2>&1; resstderr=$?
74+
if [ $resresult -ne 0 ] && [ $resstderr -ne 0 ]; then
75+
# Neither 'result' nor 'stderr' are open anymore
76+
break
77+
fi
78+
if [ $timeoutcnt -ge 30 ]; then
79+
if [ $resresult -eq 0 ]; then
80+
echo "*** Timeout waiting for 'result' file to close"
81+
fi
82+
if [ $resstderr -eq 0 ]; then
83+
echo "*** Timeout waiting for 'stderr' file to close"
84+
fi
85+
echo "*** Test results may be invalid when checked."
86+
return 1
87+
fi
88+
sleep 1
89+
timeoutcnt=$((timeoutcnt + 1))
90+
done
91+
return 0
92+
}
93+
5994
run_shell_script () {
6095
testname=$(basename "$1")
6196
testdir=$(dirname "$1")
@@ -67,6 +102,7 @@ run_shell_script () {
67102
bash -x "$testname" > result 2> stderr
68103
fi
69104
exitcode=$?
105+
wait_for_result_close
70106
popd > /dev/null || exit 2
71107
return "$exitcode"
72108
}
@@ -82,6 +118,7 @@ run_executable () {
82118
./"$testname" > result 2> stderr
83119
fi
84120
exitcode=$?
121+
wait_for_result_close
85122
popd > /dev/null || exit 2
86123
return "$exitcode"
87124
}
@@ -99,6 +136,7 @@ run_without_overruns () {
99136
halrun -f "$testname" > result 2> stderr
100137
fi
101138
exitcode=$?
139+
wait_for_result_close
102140
popd > /dev/null || exit 2
103141

104142
if ! grep -q '^overrun$' "$testdir/result"; then return "$exitcode"; fi
@@ -175,7 +213,7 @@ run_tests () {
175213
exit 1;
176214
fi
177215

178-
find "$*" -name test.hal -or -name test.sh -or -name test \
216+
find "$@" -name test.hal -or -name test.sh -or -name test \
179217
| sort > "$TMPDIR/alltests"
180218

181219
while read -r testname; do
@@ -194,7 +232,6 @@ run_tests () {
194232
# skip test if there's a "skip" file
195233
if [ -e "$testdir/skip" ]; then
196234
if ! [ -x "$testdir/skip" ] || ! "$testdir/skip"; then
197-
198235
echo "Skipping disabled test: $testdir" 1>&2
199236
SKIP=$((SKIP + 1))
200237
continue

src/hal/components/Submakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ PYFLAGS := $(PYTHON_EXTRA_LDFLAGS) $(BOOST_PYTHON_LIB) $(PYTHON_LIBS) $(PYTHON_E
107107

108108
../bin/panelui: $(call TOOBJS, $(PYSAMPLERSRCS)) ../lib/liblinuxcnchal.so.0
109109
$(ECHO) Linking $(notdir $@)
110-
$(Q)$(CC) -o $@ $^ $(PYFLAGS)
110+
$(Q)$(CC) -Wl,-z,relro -o $@ $^ $(PYFLAGS)
111111
TARGETS += ../bin/panelui
112112

113113
hal/components/conv_float_s32.comp: hal/components/conv.comp.in hal/components/mkconv.sh hal/components/Submakefile

src/hal/user_comps/mb2hal/mb2hal.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ int main(int argc, char **argv)
8181
ERR(gbl.init_dbg, "Unable to create HAL pins");
8282
goto QUIT_CLEANUP;
8383
}
84-
hal_ready(gbl.hal_mod_id);
85-
OK(gbl.init_dbg, "HAL components created OK");
86-
87-
gbl.quit_flag = 0; //tell the threads to quit (SIGTERM o SIGQUIT) (unloadusr mb2hal).
84+
gbl.quit_flag = 0; //tell the threads to quit (SIGTERM or SIGINT) (unloadusr mb2hal).
8885
signal(SIGINT, quit_signal);
8986
//unloadusr and unload commands of halrun
9087
signal(SIGTERM, quit_signal);
9188

89+
hal_ready(gbl.hal_mod_id);
90+
OK(gbl.init_dbg, "HAL components created OK");
91+
9292
/* Each link has it's own thread */
9393
pthread_attr_init(&thrd_attr);
9494
for (counter = 0; counter < gbl.tot_mb_links; counter++) {
@@ -149,7 +149,7 @@ void *link_loop_and_logic(void *thrd_link_num)
149149

150150
for (tx_counter = 0; tx_counter < gbl.tot_mb_tx; tx_counter++) {
151151

152-
if (gbl.quit_flag != 0) { //tell the threads to quit (SIGTERM o SGIQUIT) (unloadusr mb2hal).
152+
if (gbl.quit_flag != 0) {
153153
return NULL;
154154
}
155155

@@ -225,7 +225,7 @@ void *link_loop_and_logic(void *thrd_link_num)
225225
break;
226226
}
227227

228-
if (gbl.quit_flag != 0) { //tell the threads to quit (SIGTERM o SGIQUIT) (unloadusr mb2hal).
228+
if (gbl.quit_flag != 0) {
229229
return NULL;
230230
}
231231

@@ -441,7 +441,7 @@ void quit_signal(int signal)
441441
{
442442
char *fnct_name = "quit_signal";
443443

444-
gbl.quit_flag = 1; //tell the threads to quit (SIGTERM o SIGQUIT) (unloadusr mb2hal).
444+
gbl.quit_flag = 1; //tell the threads to quit (SIGTERM or SIGINT) (unloadusr mb2hal).
445445
DBG(gbl.init_dbg, "signal [%d] received", signal);
446446
}
447447

src/hal/user_comps/mb2hal/mb2hal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ typedef struct {
153153
int tot_mb_links;
154154
//others
155155
const char *mb_tx_fncts[mbtxMAX];
156-
int quit_flag;
156+
volatile int quit_flag;
157157
} gbl_t;
158158

159159
extern gbl_t gbl;

src/module_helper/Submakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ MODULE_HELPERSRCS := \
44
USERSRCS += $(MODULE_HELPERSRCS)
55

66
ifneq ($(rip_moduledir),)
7-
$(call TOOBJSDEPS, $(MODULE_HELPERSRCS)) : EXTRAFLAGS = -Wall -Werror
7+
$(call TOOBJSDEPS, $(MODULE_HELPERSRCS)) : EXTRAFLAGS = -Wall -Werror -Wformat -Wformat-security
88
else
9-
$(call TOOBJSDEPS, $(MODULE_HELPERSRCS)) : EXTRAFLAGS = -Wall -Werror
9+
$(call TOOBJSDEPS, $(MODULE_HELPERSRCS)) : EXTRAFLAGS = -Wall -Werror -Wformat -Wformat-security
1010
endif
1111

1212
../bin/linuxcnc_module_helper: $(call TOOBJS, $(MODULE_HELPERSRCS))
1313
$(ECHO) Linking $(notdir $@)
14-
@$(CC) -o $@ $^
14+
$(CC) -Wl,-z,relro -o $@ $^
1515

1616
TARGETS += ../bin/linuxcnc_module_helper
1717
endif

0 commit comments

Comments
 (0)