* [PATCH] tst-tls6.sh: Replace space with ':' in LD_PRELOAD
@ 2024-02-06 12:42 H.J. Lu
2024-02-06 12:58 ` Andreas Schwab
2024-02-06 14:00 ` Florian Weimer
0 siblings, 2 replies; 7+ messages in thread
From: H.J. Lu @ 2024-02-06 12:42 UTC (permalink / raw)
To: libc-alpha; +Cc: jakub
Replace space with ':' in LD_PRELOAD. This fixes [BZ #31344].
---
nptl/tst-tls6.sh | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/nptl/tst-tls6.sh b/nptl/tst-tls6.sh
index 450ee7870a..9dbb9495c1 100755
--- a/nptl/tst-tls6.sh
+++ b/nptl/tst-tls6.sh
@@ -38,7 +38,8 @@ for aligned in a e f; do
${test_wrapper_env} \
${run_program_env} \
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
- | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
+ | sed 's/:$//;s/: /:/g;s/ /:/g'`" ${tst_tls5} >> $logfile \
+ || fail=1
echo >> $logfile
echo "preload tst-tls5mod{b,$aligned,c,d}.so" >> $logfile
@@ -46,7 +47,8 @@ for aligned in a e f; do
${test_wrapper_env} \
${run_program_env} \
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{b,$aligned,c,d}.so \
- | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
+ | sed 's/:$//;s/: /:/g;s/ /:/g'`" ${tst_tls5} >> $logfile \
+ || fail=1
echo >> $logfile
echo "preload tst-tls5mod{b,c,d,$aligned}.so" >> $logfile
@@ -54,7 +56,8 @@ for aligned in a e f; do
${test_wrapper_env} \
${run_program_env} \
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{b,c,d,$aligned}.so \
- | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
+ | sed 's/:$//;s/: /:/g;s/ /:/g'`" ${tst_tls5} >> $logfile \
+ || fail=1
echo >> $logfile
done
@@ -63,7 +66,8 @@ echo "===============" >> $logfile
${test_wrapper_env} \
${run_program_env} \
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,c,e}.so \
- | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
+ | sed 's/:$//;s/: /:/g;s/ /:/g'`" ${tst_tls5} >> $logfile \
+|| fail=1
echo >> $logfile
echo "preload tst-tls5mod{d,a,b,e,f}" >> $logfile
@@ -71,7 +75,8 @@ echo "===============" >> $logfile
${test_wrapper_env} \
${run_program_env} \
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,e,f}.so \
- | sed 's/:$//;s/: /:/g'`" ${tst_tls5} >> $logfile || fail=1
+ | sed 's/:$//;s/: /:/g;s/ /:/g'`" ${tst_tls5} >> $logfile \
+|| fail=1
echo >> $logfile
exit $fail
--
2.43.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tst-tls6.sh: Replace space with ':' in LD_PRELOAD
2024-02-06 12:42 [PATCH] tst-tls6.sh: Replace space with ':' in LD_PRELOAD H.J. Lu
@ 2024-02-06 12:58 ` Andreas Schwab
2024-02-06 13:11 ` H.J. Lu
2024-02-06 14:00 ` Florian Weimer
1 sibling, 1 reply; 7+ messages in thread
From: Andreas Schwab @ 2024-02-06 12:58 UTC (permalink / raw)
To: H.J. Lu; +Cc: libc-alpha, jakub
On Feb 06 2024, H.J. Lu wrote:
> Replace space with ':' in LD_PRELOAD. This fixes [BZ #31344].
What does it fix?
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tst-tls6.sh: Replace space with ':' in LD_PRELOAD
2024-02-06 12:58 ` Andreas Schwab
@ 2024-02-06 13:11 ` H.J. Lu
2024-02-06 13:17 ` Andreas Schwab
0 siblings, 1 reply; 7+ messages in thread
From: H.J. Lu @ 2024-02-06 13:11 UTC (permalink / raw)
To: Andreas Schwab; +Cc: libc-alpha, jakub
On Tue, Feb 6, 2024 at 4:58 AM Andreas Schwab <schwab@suse.de> wrote:
>
> On Feb 06 2024, H.J. Lu wrote:
>
> > Replace space with ':' in LD_PRELOAD. This fixes [BZ #31344].
>
> What does it fix?
Intel SDE only supports ':' in LD_PRELOAD.
--
H.J.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tst-tls6.sh: Replace space with ':' in LD_PRELOAD
2024-02-06 13:11 ` H.J. Lu
@ 2024-02-06 13:17 ` Andreas Schwab
0 siblings, 0 replies; 7+ messages in thread
From: Andreas Schwab @ 2024-02-06 13:17 UTC (permalink / raw)
To: H.J. Lu; +Cc: libc-alpha, jakub
On Feb 06 2024, H.J. Lu wrote:
> Intel SDE only supports ':' in LD_PRELOAD.
Then fix it.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tst-tls6.sh: Replace space with ':' in LD_PRELOAD
2024-02-06 12:42 [PATCH] tst-tls6.sh: Replace space with ':' in LD_PRELOAD H.J. Lu
2024-02-06 12:58 ` Andreas Schwab
@ 2024-02-06 14:00 ` Florian Weimer
2024-02-06 14:02 ` Jakub Jelinek
1 sibling, 1 reply; 7+ messages in thread
From: Florian Weimer @ 2024-02-06 14:00 UTC (permalink / raw)
To: H.J. Lu; +Cc: libc-alpha, jakub
* H. J. Lu:
> Replace space with ':' in LD_PRELOAD. This fixes [BZ #31344].
I think the test currently passes because we use an ELF constructor in
the LD_PRELOAD module to register test cases. So we just lose some test
coverage by ignoring the LD_PRELOAD modules. In other cases we rely on
explicit symbol bindings/lookups to make sure that everythin has been
loaded as expected. But as a minimal fix, this looks okay.
Regarding the actual change:
LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
+ | sed 's/:$//;s/: /:/g;s/ /:/g'`" ${tst_tls5} >> $logfile \
+ || fail=1
I believe this could be:
+ LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
+ | tr ' ' :`" ${tst_tls5} >> $logfile || fail=1
You could use set -- and IFS, but that's probably too obscure.
Thanks,
Florian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tst-tls6.sh: Replace space with ':' in LD_PRELOAD
2024-02-06 14:00 ` Florian Weimer
@ 2024-02-06 14:02 ` Jakub Jelinek
2024-02-06 14:10 ` Adhemerval Zanella Netto
0 siblings, 1 reply; 7+ messages in thread
From: Jakub Jelinek @ 2024-02-06 14:02 UTC (permalink / raw)
To: Florian Weimer; +Cc: H.J. Lu, libc-alpha
On Tue, Feb 06, 2024 at 03:00:12PM +0100, Florian Weimer wrote:
> * H. J. Lu:
>
> > Replace space with ':' in LD_PRELOAD. This fixes [BZ #31344].
>
> I think the test currently passes because we use an ELF constructor in
> the LD_PRELOAD module to register test cases. So we just lose some test
> coverage by ignoring the LD_PRELOAD modules. In other cases we rely on
> explicit symbol bindings/lookups to make sure that everythin has been
> loaded as expected. But as a minimal fix, this looks okay.
>
> Regarding the actual change:
>
> LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
> + | sed 's/:$//;s/: /:/g;s/ /:/g'`" ${tst_tls5} >> $logfile \
> + || fail=1
>
> I believe this could be:
>
> + LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
> + | tr ' ' :`" ${tst_tls5} >> $logfile || fail=1
>
> You could use set -- and IFS, but that's probably too obscure.
At least ld.so manpage documents for LD_PRELOAD:
"The items of the list can be separated by spaces or colons, and there is no
support for escaping either separator."
So, is that not true?
Jakub
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] tst-tls6.sh: Replace space with ':' in LD_PRELOAD
2024-02-06 14:02 ` Jakub Jelinek
@ 2024-02-06 14:10 ` Adhemerval Zanella Netto
0 siblings, 0 replies; 7+ messages in thread
From: Adhemerval Zanella Netto @ 2024-02-06 14:10 UTC (permalink / raw)
To: Jakub Jelinek, Florian Weimer; +Cc: H.J. Lu, libc-alpha
On 06/02/24 11:02, Jakub Jelinek wrote:
> On Tue, Feb 06, 2024 at 03:00:12PM +0100, Florian Weimer wrote:
>> * H. J. Lu:
>>
>>> Replace space with ':' in LD_PRELOAD. This fixes [BZ #31344].
>>
>> I think the test currently passes because we use an ELF constructor in
>> the LD_PRELOAD module to register test cases. So we just lose some test
>> coverage by ignoring the LD_PRELOAD modules. In other cases we rely on
>> explicit symbol bindings/lookups to make sure that everythin has been
>> loaded as expected. But as a minimal fix, this looks okay.
>>
>> Regarding the actual change:
>>
>> LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
>> + | sed 's/:$//;s/: /:/g;s/ /:/g'`" ${tst_tls5} >> $logfile \
>> + || fail=1
>>
>> I believe this could be:
>>
>> + LD_PRELOAD="`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
>> + | tr ' ' :`" ${tst_tls5} >> $logfile || fail=1
>>
>> You could use set -- and IFS, but that's probably too obscure.
>
> At least ld.so manpage documents for LD_PRELOAD:
> "The items of the list can be separated by spaces or colons, and there is no
> support for escaping either separator."
> So, is that not true?
It is true, LD_PRELOAD accepts both ':' and whitespace:
elf/rtld.c
866 unsigned int
867 handle_preload_list (const char *preloadlist, struct link_map *main_map,
868 const char *where)
869 {
[...]
876 /* Split preload list at space/colon. */
877 size_t len = strcspn (p, " :");
[...]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-02-06 14:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-06 12:42 [PATCH] tst-tls6.sh: Replace space with ':' in LD_PRELOAD H.J. Lu
2024-02-06 12:58 ` Andreas Schwab
2024-02-06 13:11 ` H.J. Lu
2024-02-06 13:17 ` Andreas Schwab
2024-02-06 14:00 ` Florian Weimer
2024-02-06 14:02 ` Jakub Jelinek
2024-02-06 14:10 ` Adhemerval Zanella Netto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).