lightning
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 3 Bugs in Lightning


From: Paulo César Pereira de Andrade
Subject: Re: 3 Bugs in Lightning
Date: Fri, 21 Aug 2020 15:08:31 -0300

Em qui., 25 de jun. de 2020 às 18:48, Max Barraclough
<maxbarraclough@outlook.com> escreveu:

  Hi,

  Sorry for the really long time to reply.

> Issue 1
> -------
> Platform: Ubuntu 20.04, AMD64. Also, Ubuntu 20.04, ARM64.
>
> Problem: The configure script fails to detect that the dev version of
> binutils ('binutils-dev') is installed. All 6 example programs compile
> and run fine, but the 'printf' example does not print disassembly.

  Likely it did not correctly detect binutils. Please check the
config.log file, and check what it prints below:

"""
| #include <lightning.h>
|       #include <lightning/jit_private.h>
|       #include <dis-asm.h>
|       int main(int argc, char *argv)
|       {
|               disassembler_ftype       print;
|               bfd                     *abfd;
|               print = disassembler(abfd);
|               return 0;
|       }
"""

  For some reason it failed to check, likely need to link to some
extra library, or some library is missing.

> Issue 2
> -------
> Platform: Amazon Linux 2, ARM64
>
> Problem: I'm able to configure and build, and the configure script
> detects that I've installed the binutils dev package, but all 6
> examples crash when run. Here's the error message:
>
>     Assertion 'a == bfd_get_arch(abfd) failed'

  This one is more complicated. Most likely need to hardcode
some code in lib/jit_disasm.c, following pattern of other
architectures, and select a base arch. I mean, something
in a pattern like this:
"""
#  if defined(__alpha__)
    disasm_info.arch = bfd_arch_alpha;
    disasm_info.mach = bfd_mach_alpha_ev6;
#  endif
"""
but adapted for arm64.

> Issue 3
> -------
> Platform: OmniOS (a distro of Illumos OpenSolaris), AMD64
>
> Problem: The 'ifib' and 'rfib' examples segfault. (I didn't install
> binutils dev.)

  To debug it, it should help to run under gdb, for example:
$ gdb doc/.libs/rfib
(gdb) b _jit_clear_state
(gdb) run
<<< when stopped in _jit_clear_state >>>
(gdb) fin
(gdb) x/30i _jit.code.ptr
(gdb) cont

the instruction address where it did segfault in the jit code
should help in understanding the root cause of the problem.

> On Amazon Linux 2 on AMD64, everything worked fine. The configure
> script correctly detected the binutils dev library, and all 6 examples
> ran fine, including the disassembly printing in the 'printf' example.
>
>
>    -Max
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]