[Lazarus] WinINet STDCALL callback crash

Benito van der Zander benito at benibela.de
Fri Mar 15 12:27:52 CET 2013


> If you run on Win64 then SEH can cause crashes with dll's. Latest FPC
> from trunk (2.7.1) enables SEH on win64 by default.
What kind of crashes? If compiled for win64, or run there?
But the crashes in 2.6 would be unrelated, wouldn't they?
> Why don't you use a sync library such as synapse
> (http://synapse.ararat.cz/doku.php) in your thread?
These kinds of libraries never work so well with https.
You need to install openssl, set the ssl version manually when the 
detection fails sometimes,
and afair it never checks if the ssl certificate is actually valid.
wininet checks it against the certificates allowed on the machine.

Benito

On 03/14/2013 08:51 AM, Ludo Brands wrote:
> On 03/14/2013 12:09 AM, Benito van der Zander wrote:
>>> However, I still get frequent, random segfaults when calling Windows
>>> functions.  My current attempt, as simple as I can make it, is below.
>>> About 50% of the time, the first command in the execute procedure
>>> works fine; the other times it causes a crash.
>> An actually crash or just a segfault message in the debugger?
>>
>> I have been using wininet in a similar way for years, and it throws an
>> error quite often, when run from within Lazarus.
>> But when called normally, without Lazarus everything works fine.
>> I think wininet and debuggers just do not play well together...
>>
>>
> Or is it a SIGFPE? There are known similar problems with FPC and dll's
> crashing with floating point errors. With SetExceptionMask (unit math)
> you can mask these exceptions.
>
> If you run on Win64 then SEH can cause crashes with dll's. Latest FPC
> from trunk (2.7.1) enables SEH on win64 by default.
>
> Why don't you use a sync library such as synapse
> (http://synapse.ararat.cz/doku.php) in your thread? In httpsend you'll find
> function HttpGetBinary(const URL: string; const Response: TStream): Boolean;
> Create a FileStream, call HttpGetBinary and close the stream, done. No
> external dependencies.
>
> Also don't change FileMode in a thread. FileMode is global. This is not
> the cause of the crash you are seeing but could cause weird problems
> later on.
>
> Ludo
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




More information about the Lazarus mailing list