SWI-Prolog / issues

Dummy repository for issue tracking
7 stars 3 forks source link

MacOS GUI issues with V8.0.1 #83

Open ridgeworks opened 5 years ago

ridgeworks commented 5 years ago

SWI-Prolog version 8.0.1 on MacOS 10.13.4

The Mac GUI has regressed since v7.6.4:

  1. In general the graphics interface is low-resolution. This applies to the fonts in the top-level window as well as any popup menus.

  2. The font cannot be changed using the main menu item Settings/Font ...

  3. Application crashes on main menu item Settings/GUI preferences ...

JanWielemaker commented 5 years ago

Uploaded http://eu.swi-prolog.org/download/devel/bin/swipl-8.1.5-3.x86_64.dmg This version is built against only self compiled dependencies that have their min deployment target set to 10.12. Please test.

ridgeworks commented 5 years ago

Good progress, but not quite there.

Again, no problems (limited testing) on the MacBook.

On the MacPro, the application now launches and runs fine - that's the progress.

However the query: ?- X is 1*(1 div 2). crashes on both the bundle and the command line app. Trace from the terminal:

$ /Applications/SWI-Prolog-3.app/Contents/MacOS/swipl 
Welcome to SWI-Prolog (threaded, 64 bits, version 8.1.5-5-g9afb9384b-DIRTY)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- X is 1 rdiv 2.
X = 1 rdiv 2.

?- X is 1*(1 rdiv 2).

SWI-Prolog [thread 1 (main) at Thu Apr 25 17:29:30 2019]: received fatal signal 4 (ill)
C-stack trace labeled "crash":
  [0] /Applications/SWI-Prolog-3.app/Contents/Frameworks/libswipl.8.1.5.dylib(save_backtrace+0xee) [0x107c9094e]
  [1] /Applications/SWI-Prolog-3.app/Contents/Frameworks/libswipl.8.1.5.dylib(sigCrashHandler+0xb2) [0x107c90f72]
  [2] /Applications/SWI-Prolog-3.app/Contents/Frameworks/libswipl.8.1.5.dylib(dispatch_signal+0x233) [0x107c1d1c3]
  [3] /usr/lib/system/libsystem_platform.dylib(_sigtramp+0x1a) [0x7fff64fe6f5a]
  [5] /Applications/SWI-Prolog-3.app/Contents/Frameworks/libgmp.10.dylib(__gmpq_mul+0x1a9) [0x107d16239]
  [6] /Applications/SWI-Prolog-3.app/Contents/Frameworks/libswipl.8.1.5.dylib(ar_mul+0xb0) [0x107bba7c0]
  [7] /Applications/SWI-Prolog-3.app/Contents/Frameworks/libswipl.8.1.5.dylib(valueExpression+0x541) [0x107bb96d1]
  [8] /Applications/SWI-Prolog-3.app/Contents/Frameworks/libswipl.8.1.5.dylib(pl_is2_va+0x67) [0x107bbae47]
  [9] /Applications/SWI-Prolog-3.app/Contents/Frameworks/libswipl.8.1.5.dylib(PL_next_solution+0xdb57) [0x107ba1867]
  [10] /Applications/SWI-Prolog-3.app/Contents/Frameworks/libswipl.8.1.5.dylib(query_loop+0x274) [0x107bf9d14]
  [11] /Applications/SWI-Prolog-3.app/Contents/Frameworks/libswipl.8.1.5.dylib(prologToplevel+0x51) [0x107bfa3d1]
  [12] /Applications/SWI-Prolog-3.app/Contents/Frameworks/libswipl.8.1.5.dylib(PL_toplevel+0x38) [0x107bb32f8]
  [13] /Applications/SWI-Prolog-3.app/Contents/MacOS/swipl(main+0x25) [0x107b85f65]
  [14] /usr/lib/system/libdyld.dylib(start+0x1) [0x7fff64cd8015]
Running on_halt hooks with status 132
Killing 15052 with default signal handlers
Illegal instruction: 4
JanWielemaker commented 5 years ago

The new machine still works? I thought this would as simple as the gmp build ignoring the CFLAGS that specifies the OS version, but that is not the case 😞. Now I'm a little at a loss. I'm wondering whether the probably older CPU is the issue, but it seems to crash In the system library, possibly as GMP calls one of the memory allocation routines, but it might also be that the actual crash is in GMP and the system library is just the signal handler.

Can you find the CPU for both machines?

JanWielemaker commented 5 years ago

Take 4 :smile: http://eu.swi-prolog.org/download/devel/bin/swipl-8.1.5-4.x86_64.dmg This is with GMP compiled using --enable-fat following the suggestion by the lead GMP developer Torbjörn Granlund. Passes all tests on the build machine. Please try.

ridgeworks commented 5 years ago

All now seems well on the MacPro. I'll do some more testing on both computers and let you know of any issues.

Is this due to some incompatibility at the hardware CPU level?

Thanks for sticking with this; it hasn't been an easy problem to resolve.

JanWielemaker commented 5 years ago

Great! Yes, GMP by default compiles for the native CPU, mine is newer than yours and apparently has some new instructions GMP likes using. You can tell it to compile for an old CPU, but on some platforms it is possible to have multiple versions of a function and the linker will bind the right one depending on the actual hardware. That at least is my understanding and --enable-fat exploits this.

Some more testing might be nice. @erlanger added an option to add the test suite to the installed system. Might be an option to try that out. Almost time to close this :smile:

ridgeworks commented 5 years ago

Certainly not my call (and probably too late anyway) but it might better if --enable-fat was the default (most general) and leave any fine tuning as a app developer decision.

Is it possible for me to run the SWIP test suite? If so can you point me at some doc that tells me how?

I did run the installation check (attached). A couple of FAILS but nothing that is of immediate concern to me.

InstallChk8.1.5-8-gcc5023a8c.txt

erlanger commented 5 years ago

To run the installed test suite just do this (from within swi-prolog):

?- test_installation.

It will run all the rests.

If it complains you may need to recompile with cmake -DINSTALL_TESTS=ON