Sign in Join

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

Mailing lists / fpc-devel / 2013-09

fpc_popaddrstack ()

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Unknown author

Hi,
Improving my bindings for CEF3, I often have crashes with the following message:

Program received signal SIGSEGV, Segmentation fault. 0x00000000004ba41a in fpc_popaddrstack ()

The backtrace looks similar every time:

#0 0x00000000004ba3aa in fpc_popaddrstack ()
#1 0x00007fffef704a28 in ?? ()
#2 0x00000000008003f5 in CEF_REQUEST_HANDLER_ON_BEFORE_RESOURCE_LOAD (SELF=0x7fffef6f90c8, BROWSER=0x7fffac0608a0, FRAME=0x7fffac060790, REQUEST=0x7fffac060590)
at ../cef3own.pas:2180

#2 is a callback, called by the C side of the CEF3 wrapper from an arbitrary thread
[the actual callback function differs, so the above is only an example]

#1 is unresolved every time
#0 is fpc_popaddrstack () every time, too

The callback functions themselves don't do anything special. Most of the time the parameters [Pointers] are "resolved" to descendants of TInterfacedObject, a certain method is called and its result is passed back.

Does anybody have an idea what the reason could be?

1. Could it be a wrong calling convention?
2. Is it a problem to call methods of TObject on different threads without any kind of lock?
[ Data of the object itself is neither read nor written within these methods ]
3. Can this be related to the use of the "With" statement?

Thanks in advance,
d.l.i.w

Reply by email

Ewald
to Unknown author

Once upon a time, said:

Does anybody have an idea what the reason could be?

Perhaps: since you call the function from an `arbitrary thread`, can I assume this thread is not a `native freepascal` thread? If so, then your problem probably lies in the fact that the TLS for exception handling etc is not yet initialized.

I suggest that you have a look at
http://wiki.freepascal.org/Multithreaded_Application_Tutorial#External_threads

Hope it helps...

Ewald

Reply by email