Skip to contentSkip to conversation

rsyslog: use atomic builtins to avoid race issue

PATCH In review Chen Qi 2 participants 3 messages Dec 28, 2016 – Dec 29, 2016

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

PATCH 1/1 rsyslog: use atomic builtins to avoid race issue

rsyslog uses a small program to check if compiler has atomic builtins or not. This does not work when cross compiling, resulting in potential race issue. In fact, when running ptest on intel-x86-64 board, we have met the race problem.

As our compiler gcc, has atomic builtins, we force ap_cv_atomic_builtins to be 'yes' so that rsyslog could make use of the atomic builtins and avoid the race issue.

---
 meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb +1 -1
index 4e2c122..27162e1 100644
@@ -31,7 +31,7 @@ SRC_URI[sha256sum] = "06e2884181333dccecceaca82827ae24ca7a258b4fbf7b1e07a80d4caa
 
 inherit autotools pkgconfig systemd update-rc.d update-alternatives ptest
 
-EXTRA_OECONF += "--disable-generate-man-pages"
+EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes"
 
 # first line is default yes in configure
 PACKAGECONFIG ??= " \
Signature · 1 line
2.8.3
#1 lore raw
Quoted 19 lines · Chen Qi

rsyslog uses a small program to check if compiler has atomic builtins or not. This does not work when cross compiling, resulting in potential race issue. In fact, when running ptest on intel-x86-64 board, we have met the race problem.

As our compiler gcc, has atomic builtins, we force ap_cv_atomic_builtins to be 'yes' so that rsyslog could make use of the atomic builtins and avoid the race issue.

---
 meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb +0 -0
index 4e2c122..27162e1 100644

meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb SRC_URI[sha256sum] = "06e2884181333dccecceaca82827ae24ca7a258b4fbf7b1e07a80d4caa · line 34

Quoted 5 lines
meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb +1 -1
@@ -31,7 +31,7 @@ SRC_URI[sha256sum] = "06e2884181333dccecceaca82827ae24ca7a258b4fbf7b1e07a80d4caa
 
 inherit autotools pkgconfig systemd update-rc.d update-alternatives ptest
 
-EXTRA_OECONF += "--disable-generate-man-pages"
+EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes"

Does this also cover 64bit builtins ? secondly, a note for architectures not supporting atomics to disable this would be good.

Quoted 11 lines
meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb +0 -1
 # first line is default yes in configure
 PACKAGECONFIG ??= " \
--

2.8.3

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

author
#2 lore raw
Quoted 21 lines · Khem Raj
Quoted 20 lines · Chen Qi

rsyslog uses a small program to check if compiler has atomic builtins or not. This does not work when cross compiling, resulting in potential race issue. In fact, when running ptest on intel-x86-64 board, we have met the race problem.

As our compiler gcc, has atomic builtins, we force ap_cv_atomic_builtins to be 'yes' so that rsyslog could make use of the atomic builtins and avoid the race issue.

---
  meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb +0 -0
index 4e2c122..27162e1 100644
@@ -31,7 +31,7 @@ SRC_URI[sha256sum] = "06e2884181333dccecceaca82827ae24ca7a258b4fbf7b1e07a80d4caa
 
Quoted 6 lines

meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb SRC_URI[sha256sum] = "06e2884181333dccecceaca82827ae24ca7a258b4fbf7b1e07a80d4caa · line 34

Quoted 4 lines
meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb +1 -1
  inherit autotools pkgconfig systemd update-rc.d update-alternatives ptest
 
-EXTRA_OECONF += "--disable-generate-man-pages"
+EXTRA_OECONF += "--disable-generate-man-pages ap_cv_atomic_builtins=yes"

Does this also cover 64bit builtins ? secondly, a note for architectures not supporting atomics to disable this would be good.

No. When looking at the source, I think it's not critical.
When I made this patch, my criteria is:
1) ptest of rsyslog does not hang because of race issue on intel-x86-64 board
2) rsyslog works well on qemux86, qemux86-64, qemuarm, qemumips, qemumips64, qemuppc

I searched the doc and the internet, I could not find related information on which arch gcc does not support atomic builtins.

Best Regards,
Chen Qi

Quoted 10 lines
Quoted 10 lines
meta-oe/recipes-extended/rsyslog/rsyslog_8.22.0.bb +0 -1
  # first line is default yes in configure
  PACKAGECONFIG ??= " \
--

2.8.3

--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel