Opened 10 years ago

Closed 10 years ago

#3966 closed bug (invalid)

Free Pascal Compiler throwing exception at r30830

Reported by: haiqu Owned by: axeld
Priority: normal Milestone: R1
Component: - General Version: R1/pre-alpha1
Keywords: Cc: oco
Blocked By: Blocking:
Has a Patch: no Platform: x86

Description

At hrev30825 FPC works fine and can rebuild itself. By hrev30830 I get this:

make[7]: Entering directory `/boot/home/projects/fpc/rtl/haiku'
as -o /boot/home/projects/fpc/rtl/units/i386-haiku/prt0.o i386/prt0.as
as -o /boot/home/projects/fpc/rtl/units/i386-haiku/cprt0.o i386/cprt0.as
as -o /boot/home/projects/fpc/rtl/units/i386-haiku/func.o i386/func.as
as -o /boot/home/projects/fpc/rtl/units/i386-haiku/dllprt.o i386/dllprt.as
/boot/home/projects/fpc/compiler/ppc1 -Ur -dHASUNIX -n -dFPC_USE_LIBC -Si -Ur -Xs -O2 -n -Fi../inc -Fi../i386 -Fi../unix -Fii386 -FE. -FU/boot/home/projects/fpc/rtl/units/i386-haiku -di386 -dRELEASE -Us -Sg system.pp
Fatal: Compilation aborted
An unhandled exception occurred at $4A16F43A :
EAccessViolation : Access violation
  $4A16F43A

I'm investigating it myself, since current developers probably don't use this compiler.

Change History (5)

comment:1 Changed 10 years ago by korli

Cc: oco added

comment:2 Changed 10 years ago by oco

It work fine here but i am still at hrev30782.

Also, i have some freepascal patchs here (there was some change about signal handling recently). I still have to submit them, but i am quite busy in the upcoming weeks.

I am currently updating one of my haiku's partitions to test with latest Haiku revision.

comment:3 Changed 10 years ago by oco

I was able to reproduce the problem with hrev30868.

The generated exe is probably calling the wrong *stat functions and/or without the right stat struct (record).

I was not able to fix it yet. I will probably look at this next weekend if you do not fix it before ;-).

comment:4 Changed 10 years ago by haiqu

Fixed. Changed the following in fpc/rtl/haiku/ostypes:

(* This is the BeOS stat struct and Haiku version differs as at r30830
   stat = packed record
      dev:longint;     {"device" that this file resides on}
      ino:int64;       {this file's inode #, unique per device}
      st_mode:dword;      {mode bits (rwx for user, group, etc)}      
      nlink:longint;   {number of hard links to this file}
      uid:dword;       {user id of the owner of this file}
      gid:dword;       {group id of the owner of this file}
      st_size:int64;      {size of this file (in bytes)}
      rdev:longint;    {device type (not used)}
      blksize:longint; {preferref block size for i/o}
      atime:longint;   {last access time}
      st_mtime:longint;   {last modification time}
      ctime:longint;   {last change time, not creation time}
      crtime:longint;  {creation time}
   end;
*)   

   stat = packed record
       st_dev:longint;       {"device" that this file resides on}
       st_ino:int64;         {this file's inode #, unique per device}
       st_mode:dword;        {mode bits (rwx for user, group, etc)}      
       st_nlink:longint;     {number of hard links to this file}
       st_uid:dword;         {user id of the owner of this file}
       st_gid:dword;         {group id of the owner of this file}
       st_size:int64;        {size of this file (in bytes)}
       st_rdev:longint;      {device type (not used)}
       st_blksize:longint;   {preferref block size for i/o}
       st_atime:timespec;    {last access time}
       st_mtime:timespec;    {last modification time}
       st_ctime:timespec;    {last change time, not creation time}
       st_crtime:timespec;   {creation time}
       st_type:dword;        {attribute/index type}
       st_blocks:int64;      {number of blocks allocated for object}
   end;
   TStat = stat;
   pStat = ^stat;

Also needed to do a few patches in rtl/unix/sysutils.pp and rtl/unix/dos.pp like so:

{$ifdef haiku}
      Result:=UnixToWinAge(info.st_mtime.tv_sec);
{$else}
      Result:=UnixToWinAge(info.st_mtime);
{$endif}

It's all good now.

comment:5 Changed 10 years ago by bonefish

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.