View Issue Details

IDProjectCategoryView StatusLast Update
0034416FPCRTLpublic2020-05-30 17:41
ReporterValerij Assigned ToFlorian  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformAARCH64OSLINUX 
Product Version3.0.4 
Fixed in Version3.3.1 
Summary0034416: wrong EPoll_Event structure
DescriptionUnder Aarch64 field events must be uint64.
https://www.freepascal.org/docs-html/current/rtl/linux/epoll_event.html

type EPoll_Event = packed record
{$ifdef CPUAARCH64}
  Events: cuint64; // Events to monitor
{$else}
  Events: cuint32; // Events to monitor
{$endif}
  Data: TEPoll_Data; // User data
end;



TagsNo tags attached.
Fixed in Revision44093
FPCOldBugId
FPCTarget-
Attached Files

Relationships

related to 0037135 closedMarco van de Voort Merge r43880 and r44093 to 3.2 

Activities

Thaddy de Koning

2018-10-14 16:50

reporter   ~0111397

AFAIK this is correct in trunk:
type
  EPoll_Data = record
    case integer of
      0: (ptr: pointer);
      1: (fd: cint);
      2: (u32: cuint);
      3: (u64: cuint64);
  end;
  TEPoll_Data = Epoll_Data;
  PEPoll_Data = ^Epoll_Data;

  EPoll_Event = {$ifdef cpu64} packed {$endif} record
    Events: cuint32;
    Data : TEpoll_Data;
  end;

The number of events is *NOT* a 64 bit type, also not on AARCH64.
The variant record TEpoll_data (a union) holds the correct types.

bald zhang

2020-02-01 23:43

reporter   ~0120844

I met this issue also.

yes, the Events is cuint32.
but on aarch64/linux, strut EPoll_Event is not packed, in bits/epoll.h, there is no packed attribute defined.
on armv7l(on raspbian), it's align 8, and it's same size(16) with c defines.
looks like it's only packed at x86_64.

tested with 3.0.4/debian 10 (aarch64, armv7l)

Thaddy de Koning

2020-02-02 10:52

reporter   ~0120846

Last edited: 2020-02-02 12:25

View 3 revisions

As I wrote: trunk has already the correct declaration (I wonder if AARCH64 is even supported on 3.0.4, it is not: supported from 3.2.0)
I don't know if the declaration is back-ported to 3.2.0.

That is: unless cpu64 still references cpux64 somewhere and not all 64 bit cpu's

Florian

2020-02-02 15:24

administrator   ~0120847

Thanks for reporting.

Issue History

Date Modified Username Field Change
2018-10-14 14:25 Valerij New Issue
2018-10-14 16:50 Thaddy de Koning Note Added: 0111397
2020-02-01 23:43 bald zhang Note Added: 0120844
2020-02-02 10:52 Thaddy de Koning Note Added: 0120846
2020-02-02 10:53 Thaddy de Koning Note Edited: 0120846 View Revisions
2020-02-02 12:25 Thaddy de Koning Note Edited: 0120846 View Revisions
2020-02-02 15:24 Florian Assigned To => Florian
2020-02-02 15:24 Florian Status new => resolved
2020-02-02 15:24 Florian Resolution open => fixed
2020-02-02 15:24 Florian Fixed in Version => 3.3.1
2020-02-02 15:24 Florian Fixed in Revision => 44093
2020-02-02 15:24 Florian FPCTarget => -
2020-02-02 15:24 Florian Note Added: 0120847
2020-05-30 17:41 Michael Van Canneyt Relationship added related to 0037135