These are chat archives for IndySockets/Indy

9th
Feb 2016
KABALAS
@KABALAS
Feb 09 2016 08:20
Hi, i get a stack overflow error in TIdAttachmentFile.create, any advice
Matthijs ter Woord
@mterwoord
Feb 09 2016 08:21
can you reproduce, or show the snippet of codde you're using?
KABALAS
@KABALAS
Feb 09 2016 08:24
if fileexists(fEmail.SpoolFile) then
begin
lAttachments := TIdAttachmentFile.create(MailMessage.MessageParts, fEmail.SpoolFile);
lAttachments.ContentType := 'application/pdf';
lAttachments.FileName := lTempspool;
end;
Matthijs ter Woord
@mterwoord
Feb 09 2016 08:26
hmm, weird
no clue. i'm not too much a delphi guy anymore... :)
KABALAS
@KABALAS
Feb 09 2016 08:26
It does not break every time, bus after 10 or so emails
I have created a thread where i que the emails, the thread cycles 30 seconds after the last mail was send
Matthijs ter Woord
@mterwoord
Feb 09 2016 08:27
when you put a break after the 5th email, does the stack trace show anything suspicious?
KABALAS
@KABALAS
Feb 09 2016 08:27
one email at a time
let me check
Matthijs ter Woord
@mterwoord
Feb 09 2016 08:30
might just be that it just happens to be in indy when it reaches the the stack overflow conditon
KABALAS
@KABALAS
Feb 09 2016 08:39
would you recommend using the latest openssl dll's?
Matthijs ter Woord
@mterwoord
Feb 09 2016 09:11
can't help you with indy specific stuff. sorry :)
Remy Lebeau
@rlebeau
Feb 09 2016 16:17
There is nothing in that code snippet that can cause a stack overflow by itself, so the cause has to elsewhere. Typically a stack overflow occurs due to a runaway recursive function call that pushes more and more values on the stack each time. The code snippet shown does not invoke suh a loop, but maybe the higher calling code does? Look at the call stack when the error occurs, is anything being repeated multiple times?