bug#41956: [PATCH] ice-9: exceptions: Properly format the error message.

2020-06-20 Thread Maxim Cournoyer
Hello Bengt!

Bengt Richter  writes:

> Hi Maxim,
>
> tl;dr:
> Does module/ice-9/exceptions.scm use the default format?
> Maybe (use-modules (ice-9) format) will help get to the next bug ?? :)

Thanks for suggesting!  I tried but got the same result.

I'm now testing a slightly different version:

@@ -189,7 +189,10 @@
   ((subr msg margs . _)
(make-exception
 (make-exception-with-origin subr)
-(make-exception-with-message msg)
+(let ((msg (if (list? margs)
+   (apply simple-format #f msg margs)
+   msg)))
+(make-exception-with-message msg))
 (make-exception-with-irritants margs)))
   (_ (make-exception-with-irritants args)))
  args))

Maxim





bug#41956: [PATCH] ice-9: exceptions: Properly format the error message.

2020-06-20 Thread Bengt Richter
Hi Maxim,

tl;dr:
Does module/ice-9/exceptions.scm use the default format?
Maybe (use-modules (ice-9) format) will help get to the next bug ?? :)

On +2020-06-20 01:46:13 -0400, maxim.courno...@gmail.com wrote:
> Maxim Cournoyer  writes:
> 
> > Hello,
> >
> > I had this problem in Guix where 'guix deploy my-config.scm' would
> > unhelpfully report an error like:
> >
> > guix deploy: error: failed to deploy my-host: ~A: ~S
> >
> > Digging a bit, I could reproduce at the REPL with:
> >
> > (guard (c ((message-condition? c)
> >(format #t "error: ~a~%" (condition-message c
> >   ;; This is what (canonicalize-path "/do/not/exist) ends up doing:
> >   (throw 'system-error "canonicalize-path" "~A" '("No such file or 
> > directory")))
> >
> > --> error: ~A
> 
> [...]
> 
> Unfortunately the previous patch breaks the tests, with errors like:
> 
> ERROR: bytevectors.test: Datum Syntax: incorrect prefix - arguments: 
> ((wrong-type-arg "apply" "Apply to non-list: ~S" (#\i) (#\i)))
> 
> I'm out of ideas for now, I last tried:
> 
> --8<---cut here---start->8---
> modified   module/ice-9/exceptions.scm
> @@ -189,7 +189,10 @@
>((subr msg margs . _)
> (make-exception
>  (make-exception-with-origin subr)
> -(make-exception-with-message msg)
> +(let ((msg (if (null? margs)
> +   msg
> +   (apply simple-format #f msg margs
> +(make-exception-with-message msg))
>  (make-exception-with-irritants margs)))
>(_ (make-exception-with-irritants args)))
>   args))
> --8<---cut here---end--->8---
> 
> To the same effect.
> 
> Maxim
> 
> 
> 

HTH
-- 
Regards,
Bengt Richter





bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch

2020-06-20 Thread Ludovic Courtès
Hi,

Ludovic Courtès  skribis:

> Andrew Gierth  skribis:
>
>> diff --git a/libguile/lightening/lightening/arm-cpu.c 
>> b/libguile/lightening/lightening/arm-cpu.c
>> index 4445266af..2b4eecc29 100644
>> --- a/libguile/lightening/lightening/arm-cpu.c
>> +++ b/libguile/lightening/lightening/arm-cpu.c
>> @@ -230,7 +230,7 @@ encode_thumb_immediate(unsigned int v)
>>  return ((v & 0xff) | (1 << 12));
>>/* abcdefgh  abcdefgh  */
>>if (((v & 0x) >> 16) == (v & 0x) && (v & 0xff) == 0)
>> -return ((v & 0x00ff) | (2 << 12));
>> +return (((v & 0xff00) >> 8) | (2 << 12));
>>/* abcdefgh abcdefgh abcdefgh abcdefgh */
>>if ( (v &0xff)== ((v & 0xff00) >>  8) &&
>> ((v &   0xff00) >> 8) == ((v &   0xff) >> 16) &&
>
> I pushed this fix to the lightening repo on your behalf:
>
>   
> https://gitlab.com/wingo/lightening/-/commit/1bb909a44d2303f88bb05125fc6742e97f80cd1d
>
> The CI jobs pass:
>
>   https://gitlab.com/wingo/lightening/-/pipelines/158337465
>
> I’ll try merging it into Guile, but do you have a test that reproduces
> the original bug, either at the Guile level or in C using the lightening
> API?  Perhaps the test that Dale posted yesterday at
> ?

Replying to myself after our discussion on IRC: I’ve merged the test you
provided, Dale (with the addition of enter/leave_jit_abi), and pushed.

  
https://gitlab.com/wingo/lightening/-/commit/24ef197b1269f8371b1f4a412caa6d2b99d66839

I’ll look into merging into Guile later today, and then I guess we can
close this bug.

Thank you!

Ludo’.





bug#40737: Segfault in arm gcc7, thumb2 builroot, with arm patch

2020-06-20 Thread Ludovic Courtès
Hi Andrew,

Andrew Gierth  skribis:

> diff --git a/libguile/lightening/lightening/arm-cpu.c 
> b/libguile/lightening/lightening/arm-cpu.c
> index 4445266af..2b4eecc29 100644
> --- a/libguile/lightening/lightening/arm-cpu.c
> +++ b/libguile/lightening/lightening/arm-cpu.c
> @@ -230,7 +230,7 @@ encode_thumb_immediate(unsigned int v)
>  return ((v & 0xff) | (1 << 12));
>/* abcdefgh  abcdefgh  */
>if (((v & 0x) >> 16) == (v & 0x) && (v & 0xff) == 0)
> -return ((v & 0x00ff) | (2 << 12));
> +return (((v & 0xff00) >> 8) | (2 << 12));
>/* abcdefgh abcdefgh abcdefgh abcdefgh */
>if ( (v &0xff)== ((v & 0xff00) >>  8) &&
> ((v &   0xff00) >> 8) == ((v &   0xff) >> 16) &&

I pushed this fix to the lightening repo on your behalf:

  
https://gitlab.com/wingo/lightening/-/commit/1bb909a44d2303f88bb05125fc6742e97f80cd1d

The CI jobs pass:

  https://gitlab.com/wingo/lightening/-/pipelines/158337465

I’ll try merging it into Guile, but do you have a test that reproduces
the original bug, either at the Guile level or in C using the lightening
API?  Perhaps the test that Dale posted yesterday at
?

--8<---cut here---start->8---
#include "test.h"   

static void 
run_test(jit_state_t *j, uint8_t *arena_base, size_t arena_size)
{   
  jit_begin(j, arena_base, arena_size); 

  jit_movi(j, JIT_R0, 0xa500a500);  
  jit_retr(j, JIT_R0);  

  jit_uword_t (*f)(void) = jit_end(j, NULL);

  ASSERT(f() == 0xa500a500);
}   

int 
main (int argc, char *argv[])   
{   
  return main_helper(argc, argv, run_test); 
}   
--8<---cut here---end--->8---

Thanks,
Ludo’.