mpz_get_str in this context returns a null terminated string: https://gmplib.org/manual/Converting-Integers. And I'm passing in a null value for its first argument, so libgmp is figuring out how much memory we need to allocate.
Anyways, s would always be null terminated. But the crash is happening inside of mpz_get_str, so that result can't be the problem -- we haven't gotten that far, yet. One thing I'm wondering, from the description, is if libgmp was compiled with avx support only or avx2 support, and whether that introduces any issues (such as the state of machine flags) in the handling of calling conventions. But I haven't figured out how to research this issue, yet. Thanks, -- Raul On Tue, Jan 31, 2023 at 11:13 AM bill lam <[email protected]> wrote: > > Raul, > > From the backtrace below, I suspect something wrong in the parameter of > calling __gmpz_get_str(..) > Have you checked voidAV1((x) is properly null terminated ? > > #define SgetX(Xy) ({\ > X Sy=Xy; mpX(Sy); C*s= jmpz_get_str(0,10,mpSy); \ > X tempx= UNvoidAV1(s); mpX(tempx); X safex= jtXmpzcommon(jt, mptempx, 0); \ > CAV1(safex);}) // ": y > > #define mpzXnojt(MPZ,x) mpz_t MPZ= {XLIMBLEN(x), XSGN((x)), voidAV1((x))} > > > > x: 1000 > JE has crashed, likely due to an internal bug. Please report the code > which caused the crash, as well as the following printout, to the J > programming forum. > 00000000004030a2: ?:0: sigsegv > 00007f84a7b2dd4f: ?:0: ? > 00007f84a673ce2e: ?:0: __gmpz_get_str > 00007f84a71b6c6a: ?:0: jtthxqe > 00007f84a71b75be: ?:0: jtthorn1main > 00007f84a71bb3bb: ?:0: jtjprx > 00007f84a71bcf11: ?:0: jtjpr1 > 00007f84a71bcd9b: ?:0: jtjpr > 00007f84a71db0d9: ?:0: jtimmex > 00007f84a71c7a61: ?:0: jdo > 00007f84a71c7813: ?:0: JDo > 0000000000402f9f: ?:0: main > 00007f84a7b1829c: ?:0: __libc_start_main > 00000000004024ed: ?:0: _start > > On Tue, Jan 31, 2023 at 10:30 PM Igor Zhuravlov <[email protected]> wrote: > > > Bill, > > > > you were right. libgmp.so from my desktop PC which passes all 3 tests, > > isn't stripped. Therefore, it cannot be from distro. May be, it's from > > previous version of j904_linux64.tar.gz . It's meta-data: > > - size: 614504 bytes > > - timestamp: 2022-12-15 09:17:56 > > - GMP version: 6.2.1 > > > > I've checked again all libgmp.so available on both PCs, and may conclude: > > 1) two libgmp 6.1.2 libs (from distro and built from gmplib.org tarball) > > pass (x: 1000) test but crash with (+/ .*) and (-/ .*) tests; > > 2) two libgmp 6.2.1 libs bundled with J (from tarballs dated 2022-12-15 > > and 2023-01-15) work fine with JE j904/j64avx2/linux and crash for > > all 3 tests with JE j904/j64avx/linux; > > 3) libgmp 6.2.1 built from gmplib.org tarball works fine with JE > > j904/j64avx/linux (on the same PC where it was built). > > > > Crash case (JE: j904/j64avx/linux, libgmp 6.2.1 bundled with J, current > > tarball version): > > > > user@notebook:~/j904/bin> LANG=C ./jconsole > > JVERSION > > Engine: j904/j64avx/linux > > Beta-j: commercial/2023-01-07T02:27:29 > > Library: 9.04.11 > > Platform: Linux 64 > > Installer: J904 install > > InstallPath: /home/user/j904 > > Contact: www.jsoftware.com > > x: 1000 > > JE has crashed, likely due to an internal bug. Please report the code > > which caused the crash, as well as the following printout, to the J > > programming forum. > > 00000000004030a2: ?:0: sigsegv > > 00007f84a7b2dd4f: ?:0: ? > > 00007f84a673ce2e: ?:0: __gmpz_get_str > > 00007f84a71b6c6a: ?:0: jtthxqe > > 00007f84a71b75be: ?:0: jtthorn1main > > 00007f84a71bb3bb: ?:0: jtjprx > > 00007f84a71bcf11: ?:0: jtjpr1 > > 00007f84a71bcd9b: ?:0: jtjpr > > 00007f84a71db0d9: ?:0: jtimmex > > 00007f84a71c7a61: ?:0: jdo > > 00007f84a71c7813: ?:0: JDo > > 0000000000402f9f: ?:0: main > > 00007f84a7b1829c: ?:0: __libc_start_main > > 00000000004024ed: ?:0: _start > > ffffffffffffffff: ?:0: ? > > > > ----------------------------------------------------------------------------- > > Aborted (core dumped) > > > > user@notebook:~/j904/bin> LANG=C ./jconsole. > > (+/ .*)x: 4 4$_ __ 0 0 1 1 0 0 0 0 1 0 0 0 0 1 > > JE has crashed, likely due to an internal bug. Please report the code > > which caused the crash, as well as the following printout, to the J > > programming forum. > > 00000000004030a2: ?:0: sigsegv > > 00007fc29f286d4f: ?:0: ? > > 00007fc29e11cc3a: ?:0: __gmpn_mul_1 > > > > ----------------------------------------------------------------------------- > > Aborted (core dumped) > > > > user@notebook:~/j904/bin> LANG=C ./jconsole. > > (-/ .*)x: 4 4$_ __ 0 0 1 1 0 0 0 0 1 0 0 0 0 1 > > JE has crashed, likely due to an internal bug. Please report the code > > which caused the crash, as well as the following printout, to the J > > programming forum. > > 00000000004030a2: ?:0: sigsegv > > 00007efd35339d4f: ?:0: ? > > 00007efd341cfc3a: ?:0: __gmpn_mul_1 > > > > ----------------------------------------------------------------------------- > > Aborted (core dumped) > > > > user@notebook:~/j904/bin> LANG=C ./jconsole. > > load '~user/temp/gmp_ver.ijs' > > gmp_version '' > > libgmp.so 569448 15-Jan-23 23:05:28 > > 6.2.1 > > exit '' > > > > user@notebook:~/j904/bin> ./jconsole > > fread < '~user/temp/gmp_ver.ijs' > > NB. nilad to get GMP version string > > NB. ver=. gmp_version '' > > gmp_version=: 3 : 0 > > dl=. '/usr/lib64/libdl.so' > > g=. (jpath '~bin') , '/libgmp.so' > > echo dir g > > h=. 0 {:: (dl , ' dlopen * *c i') cd g ; 1 NB. lazy binding > > assert 0 ~: h > > p=. 0 {:: (dl , ' dlsym x x *c') cd h ; '__gmp_version' > > assert 0 ~: p > > c=. memr p , 0 1 4 > > assert 0 ~: c > > ver=. memr c , 0 _1 > > ) > > > > -- > > Regards, > > Igor > > > > > > On Tue, Jan 31, 2023 at 01:24 AM bill lam <[email protected]> wrote: > > > I found libgmp 6.1.2 crashed for those 2 lines, but libgmp 6.2.1 that > > > bundled by J works fine. > > > > > > I think libgmp 6.1.2 is buggy but the bundled 6.2.1 can't be loaded on > > > your computers. > > > > > > If you linux distro can provide libgmp 6.2.1 ( or 6.2.0) you should > > update > > > to the newer version. > > > > > > Can you double check the version of libgmp after OS upgrade on your > > desktop > > > computer? > > > > > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
