unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: branch master updated: gnu: gettext-minimal: Mark "test-raise" test XFAIL on the Hurd.
       [not found] <20201005100249.19995.93553@vcs0.savannah.gnu.org>
@ 2020-10-05 12:24 ` Jan Nieuwenhuizen
  2020-10-05 12:27   ` Efraim Flashner
  2020-10-12 10:10   ` Ludovic Courtès
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Nieuwenhuizen @ 2020-10-05 12:24 UTC (permalink / raw)
  To: guix-devel


Hi!

> commit 2fc298d19c5256eb5609aae7bd35bada59d91685
> Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
> AuthorDate: Mon Oct 5 11:58:16 2020 +0200
>
>     gnu: gettext-minimal: Mark "test-raise" test XFAIL on the Hurd.
>     
>     * gnu/packages/gettext.scm (gettext-minimal)[arguments]: When compiling for
>     the Hurd, add "test-raise" to XFAIL_TESTS in make-flags.

Some more info on this bug, it is this snippet that causes
the test failure

--8<---------------cut here---------------start------------->8---
#include <signal.h>

int
main (void)
{
  if (!raise (-1))
    return 1;
  
  return 0;
}
--8<---------------cut here---------------end--------------->8---

but only when linked against libpthread:

--8<---------------cut here---------------start------------->8---
$ gcc raise.c
$ ./a.out
$ echo $?
0
$ gcc raise.c /gnu/store/9vs3gkp6svam82zw7vjlml7iiarcs11c-glibc-2.31/lib/libpthread.so.0.3
$ ./a.out
User defined signal 2
$ echo $?
159
--8<---------------cut here---------------end--------------->8---

Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: branch master updated: gnu: gettext-minimal: Mark "test-raise" test XFAIL on the Hurd.
  2020-10-05 12:24 ` branch master updated: gnu: gettext-minimal: Mark "test-raise" test XFAIL on the Hurd Jan Nieuwenhuizen
@ 2020-10-05 12:27   ` Efraim Flashner
  2020-10-12 10:10   ` Ludovic Courtès
  1 sibling, 0 replies; 7+ messages in thread
From: Efraim Flashner @ 2020-10-05 12:27 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]

On Mon, Oct 05, 2020 at 02:24:31PM +0200, Jan Nieuwenhuizen wrote:
> 
> Hi!
> 
> > commit 2fc298d19c5256eb5609aae7bd35bada59d91685
> > Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
> > AuthorDate: Mon Oct 5 11:58:16 2020 +0200
> >
> >     gnu: gettext-minimal: Mark "test-raise" test XFAIL on the Hurd.
> >     
> >     * gnu/packages/gettext.scm (gettext-minimal)[arguments]: When compiling for
> >     the Hurd, add "test-raise" to XFAIL_TESTS in make-flags.
> 
> Some more info on this bug, it is this snippet that causes
> the test failure
> 
> --8<---------------cut here---------------start------------->8---
> #include <signal.h>
> 
> int
> main (void)
> {
>   if (!raise (-1))
>     return 1;
>   
>   return 0;
> }
> --8<---------------cut here---------------end--------------->8---
> 
> but only when linked against libpthread:
> 
> --8<---------------cut here---------------start------------->8---
> $ gcc raise.c
> $ ./a.out
> $ echo $?
> 0
> $ gcc raise.c /gnu/store/9vs3gkp6svam82zw7vjlml7iiarcs11c-glibc-2.31/lib/libpthread.so.0.3
> $ ./a.out
> User defined signal 2
> $ echo $?
> 159
> --8<---------------cut here---------------end--------------->8---
> 
> Janneke
> 

I believe this commit also caused the guix data service to not want to
import more derivations.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: branch master updated: gnu: gettext-minimal: Mark "test-raise" test XFAIL on the Hurd.
  2020-10-05 12:24 ` branch master updated: gnu: gettext-minimal: Mark "test-raise" test XFAIL on the Hurd Jan Nieuwenhuizen
  2020-10-05 12:27   ` Efraim Flashner
@ 2020-10-12 10:10   ` Ludovic Courtès
  2020-10-12 11:37     ` Jan Nieuwenhuizen
  1 sibling, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2020-10-12 10:10 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel

Hi!

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

>> commit 2fc298d19c5256eb5609aae7bd35bada59d91685
>> Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
>> AuthorDate: Mon Oct 5 11:58:16 2020 +0200
>>
>>     gnu: gettext-minimal: Mark "test-raise" test XFAIL on the Hurd.
>>     
>>     * gnu/packages/gettext.scm (gettext-minimal)[arguments]: When compiling for
>>     the Hurd, add "test-raise" to XFAIL_TESTS in make-flags.
>
> Some more info on this bug, it is this snippet that causes
> the test failure
>
> #include <signal.h>
>
> int
> main (void)
> {
>   if (!raise (-1))
>     return 1;
>   
>   return 0;
> }
>
>
> but only when linked against libpthread:
>
> $ gcc raise.c
> $ ./a.out
> $ echo $?
> 0
> $ gcc raise.c /gnu/store/9vs3gkp6svam82zw7vjlml7iiarcs11c-glibc-2.31/lib/libpthread.so.0.3

I don’t know if it’s relevant here, but you should always use ‘-pthread’
both at compile time and link time:

  gcc raise.c -pthread

That typically defines a few macros that may or may not have an effect
on the code at hand.

Thanks,
Ludo’.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: branch master updated: gnu: gettext-minimal: Mark "test-raise" test XFAIL on the Hurd.
  2020-10-12 10:10   ` Ludovic Courtès
@ 2020-10-12 11:37     ` Jan Nieuwenhuizen
  2020-10-13 13:41       ` raise(-1) succeeds for programs linked against libpthread Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Nieuwenhuizen @ 2020-10-12 11:37 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Ludovic Courtès writes:

Hi!

> Jan Nieuwenhuizen <janneke@gnu.org> skribis:
>
>>> commit 2fc298d19c5256eb5609aae7bd35bada59d91685
>>> Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
>>> AuthorDate: Mon Oct 5 11:58:16 2020 +0200
>>>
>>>     gnu: gettext-minimal: Mark "test-raise" test XFAIL on the Hurd.
>>>     
>>>     * gnu/packages/gettext.scm (gettext-minimal)[arguments]: When compiling for
>>>     the Hurd, add "test-raise" to XFAIL_TESTS in make-flags.
>>
>> Some more info on this bug, it is this snippet that causes
>> the test failure
>>
>> #include <signal.h>
>>
>> int
>> main (void)
>> {
>>   if (!raise (-1))
>>     return 1;
>>   
>>   return 0;
>> }
>
> I don’t know if it’s relevant here, but you should always use ‘-pthread’
> both at compile time and link time:
>
>   gcc raise.c -pthread
>
> That typically defines a few macros that may or may not have an effect
> on the code at hand.

Ah...right.  Makes no difference, though:

root@childhurd ~# guix environment --bootstrap --ad-hoc gcc-toolchain@7
root@childhurd ~ [env]# gcc raise.c
root@childhurd ~ [env]# ./a.out
root@childhurd ~ [env]# echo $?
0
root@childhurd ~ [env]# gcc raise.c -pthread
root@childhurd ~ [env]# ./a.out
User defined signal 2
root@childhurd ~ [env]# echo $?
159

Greetings,
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


^ permalink raw reply	[flat|nested] 7+ messages in thread

* raise(-1) succeeds for programs linked against libpthread
  2020-10-12 11:37     ` Jan Nieuwenhuizen
@ 2020-10-13 13:41       ` Ludovic Courtès
  2020-10-13 13:57         ` Samuel Thibault
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2020-10-13 13:41 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel, bug-hurd

Hi!

(Cc: bug-hurd.)

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

>>> #include <signal.h>
>>>
>>> int
>>> main (void)
>>> {
>>>   if (!raise (-1))
>>>     return 1;
>>>   
>>>   return 0;
>>> }
>>
>> I don’t know if it’s relevant here, but you should always use ‘-pthread’
>> both at compile time and link time:
>>
>>   gcc raise.c -pthread
>>
>> That typically defines a few macros that may or may not have an effect
>> on the code at hand.
>
> Ah...right.  Makes no difference, though:
>
> root@childhurd ~# guix environment --bootstrap --ad-hoc gcc-toolchain@7
> root@childhurd ~ [env]# gcc raise.c
> root@childhurd ~ [env]# ./a.out
> root@childhurd ~ [env]# echo $?
> 0
> root@childhurd ~ [env]# gcc raise.c -pthread
> root@childhurd ~ [env]# ./a.out
> User defined signal 2

Interesting!  In the second case, we’re using ‘__pthread_kill’ from
‘pt-kill.c’ (instead of ‘kill’).

The expected behavior is that ‘raise’ should return non-zero and EINVAL.

‘pthread_kill’ passes the signal number to ‘_hurd_raise_signal’, which
assumes it is valid:

--8<---------------cut here---------------start------------->8---
int
_hurd_raise_signal (struct hurd_sigstate *ss,
		    int signo, const struct hurd_signal_detail *detail)
{
  if (ss == NULL)
    {
      ss = _hurd_self_sigstate ();
      __spin_lock (&ss->lock);
    }

  /* Mark SIGNO as pending to be delivered.  */
  __sigaddset (&ss->pending, signo);
  ss->pending_data[signo] = *detail;
--8<---------------cut here---------------end--------------->8---

I suppose that before calling ‘sigaddset’, it should check whether SIGNO
is within bounds, along the lines of:

  if (signo < 2 || signo >= _NSIG)
    return EINVAL;

Does that make sense?

Thanks,
Ludo’.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: raise(-1) succeeds for programs linked against libpthread
  2020-10-13 13:41       ` raise(-1) succeeds for programs linked against libpthread Ludovic Courtès
@ 2020-10-13 13:57         ` Samuel Thibault
  2020-10-13 20:41           ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Samuel Thibault @ 2020-10-13 13:57 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, bug-hurd

Ludovic Courtès, le mar. 13 oct. 2020 15:41:37 +0200, a ecrit:
> ‘pthread_kill’ passes the signal number to ‘_hurd_raise_signal’, which
> assumes it is valid:
[...]
> I suppose that before calling ‘sigaddset’, it should check whether SIGNO
> is within bounds, along the lines of:
> 
>   if (signo < 2 || signo >= _NSIG)
>     return EINVAL;
> 
> Does that make sense?

Probably, yes. Why excluding SIGHUP?

Samuel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: raise(-1) succeeds for programs linked against libpthread
  2020-10-13 13:57         ` Samuel Thibault
@ 2020-10-13 20:41           ` Ludovic Courtès
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2020-10-13 20:41 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: guix-devel, bug-hurd

Samuel Thibault <samuel.thibault@gnu.org> skribis:

> Ludovic Courtès, le mar. 13 oct. 2020 15:41:37 +0200, a ecrit:
>> ‘pthread_kill’ passes the signal number to ‘_hurd_raise_signal’, which
>> assumes it is valid:
> [...]
>> I suppose that before calling ‘sigaddset’, it should check whether SIGNO
>> is within bounds, along the lines of:
>> 
>>   if (signo < 2 || signo >= _NSIG)
>>     return EINVAL;
>> 
>> Does that make sense?
>
> Probably, yes. Why excluding SIGHUP?

Oops, an oversight: I was looking at ‘signum-generic.h’ and the first
definition is SIGINT (2).  :-)

Ludo’.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-10-13 20:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20201005100249.19995.93553@vcs0.savannah.gnu.org>
2020-10-05 12:24 ` branch master updated: gnu: gettext-minimal: Mark "test-raise" test XFAIL on the Hurd Jan Nieuwenhuizen
2020-10-05 12:27   ` Efraim Flashner
2020-10-12 10:10   ` Ludovic Courtès
2020-10-12 11:37     ` Jan Nieuwenhuizen
2020-10-13 13:41       ` raise(-1) succeeds for programs linked against libpthread Ludovic Courtès
2020-10-13 13:57         ` Samuel Thibault
2020-10-13 20:41           ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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).