Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-12

How is EntryInformation.OS.haltproc assigned?

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha Manninen

I am testing with a 64-bit Manjaro Linux.
I get an access violation when closing any LCL application built with QT bindings using FPC trunk. When using FPC 3.0.2 there was no access violation, and neither with other widgetsets. Only FPC trunk + QT posed a problem.
I remember seeing this for some time, surely half a year, when testing FPC trunk.
An app only says:
An unhandled exception occurred at $00007F180E69437C: EAccessViolation:
$00007F180E69437C
Breakpoints inside the app did not reveal anything.

I wanted to find out what is happening and built FPC trunk with debug info. The error happens in procedure System_exit in rtl/linux/system.pp, at line:

  EntryInformation.OS.haltproc(ExitCode);

Backtrace is not very useful:
#0 :174
#1 fpc_do_exit at ../inc/system.inc:1076
#2 :20

In debugger the data in both records "EntryInformation" and "EntryInformation.OS" look valid.
Apparently the haltproc is not assigned. Where should it be assigned? The only place under rtl/linux I find haltproc assigned is in "si_dll.inc". There procedure _FPC_shared_lib_haltproc deals with shared libraries. Not relevant here.

After the crash I get an assembly window pointing to this line: 00007FFFF60AE37C 660f6f442410 movdqa 0x10(%rsp),%xmm0 Isn't xmm0 a SSE2 register or something? I don't think the compiler generated such code.

Amazingly enough the Lazarus IDE itself when built with QT bindings does not crash at the end. Somehow the QT bindings are quilty but how? Any clues where I should look for the problem?

Juha

Reply by email

Sven Barth
to Juha Manninen
Juha Manninen wrote 28 lines
I am testing with a 64-bit Manjaro Linux. I get an access violation when closing any LCL application built with QT bindings using FPC trunk. When using FPC 3.0.2 there was no access violation, and neither with other widgetsets. Only FPC trunk + QT posed a problem. I remember seeing this for some time, surely half a year, when testing FPC trunk. An app only says: An unhandled exception occurred at $00007F180E69437C: EAccessViolation: $00007F180E69437C Breakpoints inside the app did not reveal anything. I wanted to find out what is happening and built FPC trunk with debug info. The error happens in procedure System_exit in rtl/linux/system.pp, at line: EntryInformation.OS.haltproc(ExitCode); Backtrace is not very useful: #0 :174 #1 fpc_do_exit at ../inc/system.inc:1076 #2 :20 In debugger the data in both records "EntryInformation" and "EntryInformation.OS" look valid. Apparently the haltproc is not assigned. Where should it be assigned? The only place under rtl/linux I find haltproc assigned is in "si_dll.inc". There procedure _FPC_shared_lib_haltproc deals with shared libraries. Not relevant here.

haltproc is assigned in the RTL's Linux startup files. Depending on whether the specific platform uses assembler or Pascal startup its either rtl/linux/<cpu>/*prt0.as or rtl/linux/<cpu>/si_*.inc. The specific file depends on whether you're linking against C-libraries (cprt0.as, si_c.inc) or not or whether you're building a library (dllprt0.as, si_dll.inc) or a static program (prt0.as, si_prc.inc). In case of x86_64 the assembler files are used despite the Pascal files already existing.

After the crash I get an assembly window pointing to this line: 00007FFFF60AE37C 660f6f442410 movdqa 0x10(%rsp),%xmm0 Isn't xmm0 a SSE2 register or something? I don't think the compiler generated such code.

Yes, xmm0 is a SSE2 register, but they're part of the x86_64 ABI (both SysV and Windows) and can be used without problems as all x86_64 processers support it (with I think only the really early Athlons being exceptions).

Amazingly enough the Lazarus IDE itself when built with QT bindings does not crash at the end. Somehow the QT bindings are quilty but how? Any clues where I should look for the problem?

Regards,
Sven

Reply by email

Victor Campillo
to Juha Manninen: I am testing with a 64-bit Manjaro Linux. I get an access violation when closing any LCL…
Juha Manninen wrote 5 lines
I am testing with a 64-bit Manjaro Linux. I get an access violation when closing any LCL application built with QT bindings using FPC trunk. When using FPC 3.0.2 there was no access violation, and neither with other widgetsets. Only FPC trunk + QT posed a problem.

Hi Juha,

I don't know if you have only the problem with Manjaro Linux, but in case it helps I just made a few test building a few Qt LCL examples with Lazarus Trunk + FPC trunk in Xubuntu 64-bit and does not get any access violation.

Best Regards.

Victor Campillo

Reply by email

Juha Manninen
to Victor Campillo
Victor Campillo wrote
I don't know if you have only the problem with Manjaro Linux, but in case it helps I just made a few test building a few Qt LCL examples with Lazarus Trunk + FPC trunk in Xubuntu 64-bit and does not get any access violation.

Thanks for testing.
It looks like nobody has the exact same problem.
There is a report about different crashes with QT: https://bugs.freepascal.org/view.php?id=29409
It happens only sometimes in some computers.

Juha

Reply by email