Sign in Join

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

Mailing lists / fpc-devel / 2010-05

Bus error in fpc_PopAddrStack

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Bernd Mueller

Hello,

I get a bus error in fpc_PopAddrStack (on ARM-Linux) in a multithreaded application. Maybe, that the local Pointer hp in fpc_PopAddrStack is loaded with an unaligned memory address.

The role of fpc_PopAddrStack is not clear to me. Does it mean, that an exception occurred somewhere and the application would crash later anyway?

Regards, Bernd.

Reply by email

Jonas Maebe
to Bernd Mueller
Bernd Mueller wrote
I get a bus error in fpc_PopAddrStack (on ARM-Linux) in a multithreaded application. Maybe, that the local Pointer hp in fpc_PopAddrStack is loaded with an unaligned memory address.

The most likely reason is that you are at some point executing Pascal code inside threads that haven't been started via the RTL. The exception handling code uses several threadvars, and these must be initialised for each thread (which doesn't happen if you start threads via some other means).

The role of fpc_PopAddrStack is not clear to me. Does it mean, that an exception occurred somewhere and the application would crash later anyway?

No.

Jonas

Reply by email

Bernd Mueller
to Jonas Maebe
Jonas Maebe wrote 6 lines
On 13 May 2010, at 17:55, Bernd Mueller wrote: > I get a bus error in fpc_PopAddrStack (on ARM-Linux) in a multithreaded > application. Maybe, that the local Pointer hp in fpc_PopAddrStack is loaded with an unaligned memory address. The most likely reason is that you are at some point executing Pascal code inside threads that haven't been started via the RTL. The exception handling code uses several threadvars, and these must be initialised for each thread (which doesn't happen if you start threads via some other means).

I am using pthreads. I fear, this could be the reason?

Regards, Bernd.

Reply by email

Jonas Maebe
to Bernd Mueller
Bernd Mueller wrote 7 lines
Jonas Maebe wrote: > On 13 May 2010, at 17:55, Bernd Mueller wrote: >> I get a bus error in fpc_PopAddrStack (on ARM-Linux) in a multithreaded >> application. Maybe, that the local Pointer hp in fpc_PopAddrStack is loaded with an unaligned memory address. > The most likely reason is that you are at some point executing Pascal code inside threads that haven't been started via the RTL. The exception handling code uses several threadvars, and these must be initialised for each thread (which doesn't happen if you start threads via some other means). I am using pthreads. I fear, this could be the reason?

Yes: "The most likely reason is that you are at some point executing Pascal code inside threads that haven't been started via the RTL".

Jonas

Reply by email