View Issue Details

IDProjectCategoryView StatusLast Update
0001494SkyChart1-Softwarepublic16-02-03 15:52
ReporterSasa Assigned ToPatrick Chevalley  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionnot fixable 
PlatformLinuxOSKubuntuOS Version10.04
Summary0001494: Upgrade latest .deb from repository crash
DescriptionAfter upgrading:
sudo apt-get upgrade

CDC do not starts any more (from unstable repository, that should be build 3223):

$ skychart
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $0000000000419F57
  $000000000069DF37
  $00000000008992E8
TApplication.HandleException Access violation
  Stack trace:
  $0000000000419F57
  $000000000069DF37
  $00000000008992E8
Exception at 0000000000419F57: EAccessViolation:
Access violation.
TagsNo tags attached.

Activities

Sasa

16-01-31 19:50

reporter   ~0003246

Last edited: 16-01-31 19:55

It is Kubuntu 14.04 LTS 64-bit

Patrick Chevalley

16-01-31 19:56

administrator   ~0003247

Are you sure you install 3223? I just put it quickly on Sourceforge yesterday for a specific test but I not update the unstable repository.
Can you run this command to confirm the version:
apt-cache showpkg skychart

Normally the version on unstable is still 3208 from January 25.
It will be upgraded to 3225 Monday morning at about 4h30 UT.


Patrick Chevalley

16-01-31 19:58

administrator   ~0003248

I just download and install skychart_3.11-3223_amd64.deb from Sourceforge and it work fine.

Maybe you have another unrelated problem?

Sasa

16-01-31 20:12

reporter   ~0003249

Last edited: 16-01-31 20:14

Yes, it is 3208 from repository...

However, I have downloaded skychart_3.11-3223_amd64.deb and it also fail with the same error.

This is actually another computer with installed fresh Kubuntu 14.04 and upgraded all. It also have GT-8600 video card (recommended settings for driver), perhaps this have something related with error...

Unfortunately, I do not have installed FPC and Lazarus here ATM in order to debug from source.

Patrick Chevalley

16-01-31 20:36

administrator   ~0003250

You can install a version with debug symbol here
http://sourceforge.net/projects/skychart/files/0-beta/debug/2016-01-25/

Then run with gdb to get a backtrace.

Sasa

16-01-31 21:00

reporter   ~0003251

Last edited: 16-01-31 21:06

Result:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffef116700 (LWP 5229)]
[New Thread 0x7fffee915700 (LWP 5230)]

Program received signal SIGILL, Illegal instruction.
0x0000000000423627 in fpc_exp_real ()
(gdb)

I think the problem here is related with 64-bit version of some used libs and FPC settings for 64-bit compilation and this particular CPU (64-bit Celeron, one of the first released from Intel, I think). I will try to give you more details about CPU and actually I will recompile all from source and test further. Unfortunately, that may be possible only next weekend.

Apparently, instant solution for this particular computer is to install 32-bit version of Kubuntu...

Thank you.

Sasa

16-01-31 22:58

reporter   ~0003252

Instructions supported by this CPU:
 FPU TSC CX8 SEP CMOV MMX FXSR SSE SSE2 SSE3 MONITOR CX16 X64

Perhaps there is requirement about minimum instruction set for 64-bit version of Linux (Intel/AMD)?

As 64-bit version of Kubuntu works fine on this computer, I strongly suspect default supported instructions for FPC in Lazarus may select more than required for 64-bit version of Linux.

Patrick Chevalley

16-02-01 07:37

administrator   ~0003253

fpc_exp_real is exponential computation (in rtl/inc/genmath.inc)
So the problem is more probably with the FPU and this explain that the base system work fine.

Sasa

16-02-01 14:20

reporter   ~0003254

Last edited: 16-02-01 15:07

CPUID shows this is Intel Celeron D (Prescott E0) 90nm.

I have installed latest stable 64-bit version of FPC and Lazarus, however I do not have a time to install all other required packages in order to compile CDC. I can confirm only that if set "default" or "x86_64", it compile and run without error trivial example using exp() function.

I have also installed latest 64-bit version of Stellarium and it works fine.

There is quite a few versions of fpc_exp_real and perhaps some settings in CDC or by default in Lazarus or FCP influence on produced asm, that is only I can conclude (if FPC can test CPU before compilation and decide what instruction set to use)...

And yes, I have ran out of more ideas...

Patrick Chevalley

16-02-02 09:44

administrator  

test_exp.tar (348,160 bytes)

Patrick Chevalley

16-02-02 09:49

administrator   ~0003259

I make a small test program that contain the first use of the exp() function when you start skychart.

Can you try the following:
- download the file test_exp.tar attached to this issue
- run the binary compiled on my system: ./test_exp_pch
- compile on your system: fpc test_exp.pp
- run your binary: ./test_exp

Sasa

16-02-02 14:39

reporter   ~0003260

Last edited: 16-02-02 17:03

Yes, thank you. Result is as follows:

1. Your binary:

$ ./test_exp_pch
Runtime error 216 at $0000000000403787
  $0000000000403787
  $0000000000400259
  $000000000040035C
  $00000000004001BF

With gdb:

Program received signal SIGILL, Illegal instruction.
0x0000000000403787 in fpc_exp_real ()

2. Compiled on this computer:

"Stable" release downloaded from:
http://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%201.4.4/

Free Pascal Compiler version 2.6.4 [2014/04/20] for x86_64

$ fpc test_exp.pp
$ ./test_exp
 1.00008227668000E+000-8.46644459442086E-002


Perhaps disassembling both executables may show what exactly is the difference.
Attached executable.

Sasa

16-02-02 14:42

reporter  

test_exp.zip (58,153 bytes)

Patrick Chevalley

16-02-03 10:13

administrator   ~0003265

Thank you for your file.

Yes, disassembling make an easy comparison because this function in rtl/x86_64/math.inc is in asm.

The difference is because I use the last stable fpc 3.0.
The fpc change between 2.6.4 and 3.0.0 is 29131, the following page show exactly your disassembly on the left and mine on the right:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/tags/release_3_0_0/rtl/x86_64/math.inc?r1=27656&r2=29131

The crash address 403787 correspond to the sahf instruction at the line 208 of the 3.0.0 source code:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/tags/release_3_0_0/rtl/x86_64/math.inc?revision=32317&view=markup

Sasa

16-02-03 13:49

reporter   ~0003267

Yes, thanks. It is all clear now.

https://en.wikipedia.org/wiki/X86-64

"
Early AMD64 and Intel 64 CPUs lacked LAHF and SAHF instructions in 64-bit mode. AMD introduced these instructions (also in 64-bit mode) with their Athlon 64, Opteron and Turion 64 revision D processors in March 2005[46][47][48] while Intel introduced the instructions with the Pentium 4 G1 stepping in December 2005. The 64-bit version of Windows 8.1 requires this feature.[45]
"

Patrick Chevalley

16-02-03 15:52

administrator   ~0003268

OK, it is clear.

I add an entry to the FAQ :
https://www.ap-i.net/skychart/en/documentation/faq?&#common_problems

Issue History

Date Modified Username Field Change
16-01-31 19:22 Sasa New Issue
16-01-31 19:50 Sasa Note Added: 0003246
16-01-31 19:51 Sasa Note Edited: 0003246
16-01-31 19:55 Sasa Note Edited: 0003246
16-01-31 19:56 Patrick Chevalley Note Added: 0003247
16-01-31 19:56 Patrick Chevalley Assigned To => Patrick Chevalley
16-01-31 19:56 Patrick Chevalley Status new => feedback
16-01-31 19:58 Patrick Chevalley Note Added: 0003248
16-01-31 20:12 Sasa Note Added: 0003249
16-01-31 20:12 Sasa Status feedback => assigned
16-01-31 20:13 Sasa Note Edited: 0003249
16-01-31 20:14 Sasa Note Edited: 0003249
16-01-31 20:36 Patrick Chevalley Note Added: 0003250
16-01-31 21:00 Sasa Note Added: 0003251
16-01-31 21:02 Sasa Note Edited: 0003251
16-01-31 21:04 Sasa Note Edited: 0003251
16-01-31 21:06 Sasa Note Edited: 0003251
16-01-31 22:58 Sasa Note Added: 0003252
16-02-01 07:37 Patrick Chevalley Note Added: 0003253
16-02-01 14:20 Sasa Note Added: 0003254
16-02-01 14:21 Sasa Note Edited: 0003254
16-02-01 14:22 Sasa Note Edited: 0003254
16-02-01 14:24 Sasa Note Edited: 0003254
16-02-01 14:26 Sasa Note Edited: 0003254
16-02-01 14:37 Sasa Note Edited: 0003254
16-02-01 14:40 Sasa Note Edited: 0003254
16-02-01 14:41 Sasa Note Edited: 0003254
16-02-01 14:42 Sasa Note Edited: 0003254
16-02-01 15:07 Sasa Note Edited: 0003254
16-02-02 09:44 Patrick Chevalley File Added: test_exp.tar
16-02-02 09:49 Patrick Chevalley Note Added: 0003259
16-02-02 09:49 Patrick Chevalley Status assigned => feedback
16-02-02 14:39 Sasa Note Added: 0003260
16-02-02 14:39 Sasa Status feedback => assigned
16-02-02 14:42 Sasa File Added: test_exp.zip
16-02-02 14:44 Sasa Note Edited: 0003260
16-02-02 14:49 Sasa Note Edited: 0003260
16-02-02 15:22 Sasa Note Edited: 0003260
16-02-02 16:43 Sasa Note Edited: 0003260
16-02-02 17:03 Sasa Note Edited: 0003260
16-02-03 10:13 Patrick Chevalley Note Added: 0003265
16-02-03 13:49 Sasa Note Added: 0003267
16-02-03 15:52 Patrick Chevalley Note Added: 0003268
16-02-03 15:52 Patrick Chevalley Status assigned => resolved
16-02-03 15:52 Patrick Chevalley Resolution open => not fixable