NetTalk Central

Author Topic: GPF when sending emails on multiple threads  (Read 5458 times)

useless

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • Email
GPF when sending emails on multiple threads
« on: September 18, 2012, 02:58:27 AM »
Getting this GPF when trying to send emails on multiple threads.
----------------------------------------------------------------------------------
Program : C:\SendEmailService\ServerService.exe
Version :
At : 23:55:42 on 2012/09/17
Reported error : EXCEPTION_ACCESS_VIOLATION - Error writing data at : 00000000h
Windows : Win XP  5.1.2600 Service Pack 3
Clarion : 6.3
Thread : 13    Field : 0    Event : 0    Keycode : 0
Error at address : 0100846Ch  no line number  no proc  Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
Stack Trace
??? 0042A000h    Line ?=3906    no proc       Src=ServerService.clw
??? 00414558h    Line ?=3906    no proc       Src=ServerService.clw
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 00D4D0C8h    Line ?=74    no proc       Src=Setti_SF.CLW    Module=C:\SendEmailService\Settings.dll 3.0.0.243
??? 010F25C8h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010F25C8h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010DD612h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010F25C8h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010F25C8h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010DD606h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010DA878h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
[01] 010AA3C8h    Line ?=27    no proc       Src="Library State"  Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 13043A00h    Line ?=246    no proc       Src=NetEnc.Clw    Module=C:\CLARION6\3rdParty\Bin\c60netx.dll 4.49 Built for Clarion 6 9054-9
??? 010EA4ACh    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010D8F3Bh    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 1304012Ch    Line ?=246    no proc       Src=NetEnc.Clw    Module=C:\CLARION6\3rdParty\Bin\c60netx.dll 4.49 Built for Clarion 6 9054-9
[02] 130075DCh    Line=928       Proc=CALLBACKWINDOWSRC@F  Src=netdl003.clw    Module=C:\CLARION6\3rdParty\Bin\c60netx.dll 4.49 Built for Clarion 6 9054-9
[03] 01091AB1h    no line number    no proc       Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054

The code is very simple, main service window loops through the email file looking for emails in the outbox. If it finds one, it adds the email ID to a global Long array[250] and then moves onto the next email its found and repeats.

Loc:ThreadCounter = 1
Loop
    GlobalsLock.Wait()
    Loc:EmailIDToSendArray[Loc:ThreadCounter] = Glo:EmailIDToSendArray[Loc:ThreadCounter]
    GlobalsLock.Release()
    IF Loc:EmailIDToSendArray[Loc:ThreadCounter] = 0
        GlobalsLock.Wait()
        Glo:EmailIDToSendArray[Loc:ThreadCounter] = EMA:EmailCode
        GlobalsLock.Release()
        Break
    Else
        Loc:ThreadCounter += 1
    END
    IF Loc:ThreadCounter > GLO:EmailThreads
        Loc:ThreadCounter = 1
        !Sleep(250) !Give other threads chance to send an email seems to lock app
    END
END

Then I have a window which starts multiple times with a 5second delay between each Start when the app starts up and each is passed a unique thread ID so it knows what array entry to read from the Glo:EmailIDToSendArray.

In this example 10 windows (threads) were running, and a timer event checks the global var, if it finds an email id ie not zero then it looks up the email and sends it.
Timer event embed.
GlobalsLock.Wait()
Loc:EmailIDToSendArray[Loc:ThreadNo] = Glo:EmailIDToSendArray[Loc:ThreadNo]
GlobalsLock.Release()
IF Loc:EmailIDToSendArray[Loc:ThreadNo] > 0 and Loc:Sending = 0
    Loc:Sending                             = 1
    Loc:SendEmailID                         = Loc:EmailIDToSendArray[Loc:ThreadNo]
    DO SendEmail
END
IF Loc:EmailIDToSendArray[Loc:ThreadNo] = 0 and Glo:ShutDownService = 1 and Loc:Sending = 0
    Post(Event:CloseWindow)
END

Anyway this gpfs everytime unless I stipulate using just 1 thread which is out of the question because emails build up.

GlobalsLock is the critical section to avoid any threading issue.

So any suggestions?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: GPF when sending emails on multiple threads
« Reply #1 on: September 18, 2012, 05:22:08 AM »
Hi Richard,

I think you're on the right track with the GPF report, but it gets chopped off just as it gets interesting. Can you maybe post the whole report as an attachment here please? It's the lines that start with [n] (where n is a number not a ?) which are the interesting ones.

Cheers
Bruce

useless

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • Email
Re: GPF when sending emails on multiple threads
« Reply #2 on: September 18, 2012, 07:31:36 AM »
The report above wasnt chopped off, but here is the latest GPF report using the latest version of NT6.
----------------------------------------------------------------------------------
Program : C:\istockcablev3\ServerService.exe
Version :
At : 16:22:20 on 2012/09/18
Reported error : EXCEPTION_ACCESS_VIOLATION - Error writing data at : 00000000h
Windows : Win XP  5.1.2600 Service Pack 3
Clarion : 6.3
Thread : 13    Field : 0    Event : 0    Keycode : 0
Error at address : 0100846Ch  no line number  no proc  Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
Stack Trace
??? 0042B000h    Line ?=3971    no proc       Src=ServerService.clw
??? 00415558h    Line ?=3971    no proc       Src=ServerService.clw
??? 010F25C8h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010F25C8h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010DD612h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010F25C8h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010F25C8h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010DD606h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010DA878h    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
[01] 010AA3C8h    Line ?=27    no proc       Src="Library State"  Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 13044A00h    Line ?=246    no proc       Src=NetEnc.Clw    Module=C:\CLARION6\3rdParty\Bin\c60netx.dll 6.44 Built for Clarion 6 9054-9
??? 010EA4ACh    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 010D8F3Bh    Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
??? 1304112Ch    Line ?=246    no proc       Src=NetEnc.Clw    Module=C:\CLARION6\3rdParty\Bin\c60netx.dll 6.44 Built for Clarion 6 9054-9
[02] 13007710h    Line=931       Proc=CALLBACKWINDOWSRC@F  Src=netdl003.clw    Module=C:\CLARION6\3rdParty\Bin\c60netx.dll 6.44 Built for Clarion 6 9054-9
[03] 01091AB1h    no line number    no proc       Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054


Just waiting for the emails to come through as I have prefixed the subject line with
ThisEmailSend.Subject  = Clip(EMA:Subject) &':'&Format(Clock(),@t8)&':'& Clock()
The ones I sent using NT4 last night came through eventually due to the greylisting which you know about, but the first 2 emails sent in the batch of 10 emails came through twice and were sent exactly 1 second after the original which is what the timer resolution is set to in all instances.


useless

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • Email
Re: GPF when sending emails on multiple threads
« Reply #3 on: September 18, 2012, 08:06:11 AM »
Just got the emails through, what is interesting is if there is a lot of data to send like emails with attachments it hasnt GPF'ed on the limited tests I have done, but does GPF if they are small emails of a few KB's in size probably because there isnt a chance for whatever to catchup or remain insynch.

Attached is a screen shot of the emails that have come through, now whilst it hasnt GPF'ed it has sent each email twice (see attached pic), you can see the emails header in the format test X: HH:MM:SS : clock() as a long integer to show the hundredths of a second.

So it seems to be either duplicates get sent or it GPF's, all these emails are 36Kb in size as they have a PDF attached to it.

This is the actual routine code for sending which gets called from a 1sec timer event

    EMA:EmailCode = Loc:SendEmailID
    IF Access:Emails.Fetch(EMA:EmailCodeKey) = Level:Benign
        EMA:EmailDirection = 7 !Sending
        IF Access:Emails.Update() = Level:Benign
            GlobalsLock.Wait()
            Glo:EmailIDToSendArray[Loc:ThreadNo] = 0
            GlobalsLock.Release()

            ThisEmailSend.Server                = ES:EmailServerAddress
            ThisEmailSend.Port                  = ES:Port
            ThisEmailSend.ToList                = EMA:EmailTo
            ThisEmailSend.ccList                = ''
            ThisEmailSend.bccList               = ''
            ThisEmailSend.From                  = EMA:EmailFrom
            ThisEmailSend.Subject               = Clip(EMA:Subject) &':'&Format(Clock(),@t8)&':'& Clock()
            ThisEmailSend.AttachmentList        = EMA:AttachmentList
            ThisEmailSend.EmbedList             = EMA:HTMLGraphicsList

            ThisEmailSend.SetRequiredMessageSize (0, Len(Clip(EMA:PlainText)), Len(Clip(EMA:CIDHTML)))

            If ThisEmailSend.Error = 0 ! Check for error
                If Len(clip(EMA:PlainText)) > 0
                    ThisEmailSend.MessageText = Clip(EMA:PlainText)
                End
                If Len(clip(EMA:CIDHTML)) > 0
                    ThisEmailSend.MessageHTML = Clip(EMA:CIDHTML)
                End
                ThisEmailSend.SendMail(NET:EMailMadeFromPartsMode)
            End
        END
    Else
    END
 

1sec Timer Event code.

GlobalsLock.Wait()
Loc:EmailIDToSendArray[Loc:ThreadNo] = Glo:EmailIDToSendArray[Loc:ThreadNo]
GlobalsLock.Release()
IF Loc:EmailIDToSendArray[Loc:ThreadNo] > 0 and Loc:Sending = 0
    Loc:Sending                             = 1
    Loc:SendEmailID                         = Loc:EmailIDToSendArray[Loc:ThreadNo]
    DO SendEmail
END
IF Loc:EmailIDToSendArray[Loc:ThreadNo] = 0 and Glo:ShutDownService = 1 and Loc:Sending = 0
    Post(Event:CloseWindow)
END




[attachment deleted by admin]

useless

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • Email
Re: GPF when sending emails on multiple threads
« Reply #4 on: September 18, 2012, 08:15:34 AM »
Spoke too soon. Testing sending 20 emails with the same attachment so its 36Kb from 10 windows/threads sending email with stack trace switched on in GPFreporter generated the below GPF report.

This program has performed an illegal operation and will now end.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Program : C:\istockcablev3\ServerService.exe
Version :
At : 17:13:55 on 2012/09/18
Reported error : EXCEPTION_ACCESS_VIOLATION - Error writing data at : 00000000h
Windows : Win XP  5.1.2600 Service Pack 3
Clarion : 6.3
Thread : 13    Field : 0    Event : 0    Keycode : 0
Error at address : 0100846Ch  no line number  no proc  Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
EAX=00000000h EBX=010DD730h ECX=7C91005Dh EDX=03F40008h
EDI=0607FAD8h ESI=00000217h EBP=0607FED8h ESP=0607FAB8h
Stack Dump
   0607FAB8h 00542668h
   0607FABCh 010A113Ch
   0607FAC0h 0607FED8h
   0607FAC4h 0607FAD8h
   0607FAC8h 00000000h
   0607FACCh 00000000h
   0607FAD0h 00000000h
   0607FAD4h 00000217h
   0607FAD8h 0000002Ah
   0607FADCh 000003E8h
   0607FAE0h 0607FAE4h
   0607FAE4h 646E6957h
   0607FAE8h 6920776Fh
   0607FAECh 6C612073h
   0607FAF0h 64616572h
   0607FAF4h 706F2079h
   0607FAF8h 440A6E65h
   0607FAFCh 6F79206Fh
   0607FB00h 61772075h
   0607FB04h 7420746Eh
   0607FB08h 5047206Fh
   0607FB0Ch 20003F46h
   0607FB10h 20202020h
   0607FB14h 20202020h
   0607FB18h 20202020h
   0607FB1Ch 20202020h
   0607FB20h 20202020h
   0607FB24h 20202020h
   0607FB28h 20202020h
   0607FB2Ch 20202020h
   0607FB30h 20202020h
   0607FB34h 20202020h
   0607FB38h 20202020h
   0607FB3Ch 20202020h
   0607FB40h 20202020h
   0607FB44h 20202020h
   0607FB48h 20202020h
   0607FB4Ch 20202020h
   0607FB50h 20202020h
   0607FB54h 20202020h
   0607FB58h 20202020h
   0607FB5Ch 20202020h
   0607FB60h 20202020h
   0607FB64h 20202020h
   0607FB68h 20202020h
   0607FB6Ch 20202020h
   0607FB70h 20202020h
   0607FB74h 20202020h
   0607FB78h 20202020h
   0607FB7Ch 20202020h
   0607FB80h 20202020h
   0607FB84h 20202020h
   0607FB88h 20202020h
   0607FB8Ch 20202020h
   0607FB90h 20202020h
   0607FB94h 20202020h
   0607FB98h 20202020h
   0607FB9Ch 20202020h
   0607FBA0h 20202020h
   0607FBA4h 20202020h
   0607FBA8h 20202020h
   0607FBACh 20202020h
   0607FBB0h 20202020h
   0607FBB4h 20202020h
   0607FBB8h 20202020h
   0607FBBCh 20202020h
   0607FBC0h 20202020h
   0607FBC4h 20202020h
   0607FBC8h 20202020h
   0607FBCCh 20202020h
   0607FBD0h 20202020h
   0607FBD4h 20202020h
   0607FBD8h 20202020h
   0607FBDCh 20202020h
   0607FBE0h 20202020h
   0607FBE4h 0607FBF0h
   0607FBE8h 5AD716C2h
   0607FBECh 00000001h
   0607FBF0h 0607FC10h
   0607FBF4h 5AD7166Eh
   0607FBF8h 5AD70000h
   0607FBFCh 00000002h
   0607FC00h 00000000h
   0607FC04h 00000000h
   0607FC08h 0607FC24h
   0607FC0Ch 7FFDE000h
   0607FC10h 0607FC30h
   0607FC14h 7C90118Ah
   0607FC18h 5AD70000h
   0607FC1Ch 00000001h
   0607FC20h 00000000h
   0607FC24h 7FFDE000h
   0607FC28h 00000000h
   0607FC2Ch 00244940h
   0607FC30h 0607FCA4h
   0607FC34h 7FFAC000h
   0607FC38h 0607FCA4h
   0607FC3Ch 7C91999Ch
   0607FC40h 0607FC54h
   0607FC44h 7C919A8Fh
   0607FC48h 7FFAC000h
   0607FC4Ch 7FFDE000h
   0607FC50h 00000000h
   0607FC54h 00000014h
   0607FC58h 00000001h
   0607FC5Ch 00000000h
   0607FC60h 00000000h
   0607FC64h 00000010h
   0607FC68h 00000000h
   0607FC6Ch 00000000h
   0607FC70h 00000000h
   0607FC74h 00000000h
   0607FC78h 00000000h
   0607FC7Ch 00000000h
   0607FC80h 7FFDE000h
   0607FC84h 5AD71626h
   0607FC88h 00241EA4h
   0607FC8Ch 0607FC48h
   0607FC90h 00000000h
   0607FC94h 0607FD0Ch
   0607FC98h 7C90E920h
   0607FC9Ch 7C9199D8h
   0607FCA0h FFFFFFFFh
   0607FCA4h 7C91997Ch
   0607FCA8h 7C90DE9Ah
   0607FCACh 7C919902h
   0607FCB0h 0607FD30h
   0607FCB4h FFFFFFFFh
   0607FCB8h 018C32BCh
   0607FCBCh 00000000h
   0607FCC0h 00000000h
   0607FCC4h 00000000h
   0607FCC8h 00000000h
   0607FCCCh 00000000h
   0607FCD0h 00000000h
   0607FCD4h 00000000h
   0607FCD8h 00000000h
   0607FCDCh 00000000h
   0607FCE0h 000000EEh
   0607FCE4h 0607FF14h
   0607FCE8h 7C911028h
   0607FCECh 7C911086h
   0607FCF0h 7C9101DBh
   0607FCF4h 0042B000h ??? Line ?=3971    no proc       Src=ServerService.clw
   0607FCF8h 00415558h ??? Line ?=3971    no proc       Src=ServerService.clw
   0607FCFCh 00001A30h
   0607FD00h 00000000h
   0607FD04h 0607FCB0h
   0607FD08h 00000000h
   0607FD0Ch FFFFFFFFh
   0607FD10h 7C90E920h
   0607FD14h 7C919908h
   0607FD18h FFFFFFFFh
   0607FD1Ch 7C919902h
   0607FD20h 7C90D06Ah
   0607FD24h 7C90E45Fh
   0607FD28h 0607FD30h
   0607FD2Ch 00000001h
   0607FD30h 00010017h
   0607FD34h 00000000h
   0607FD38h 00000000h
   0607FD3Ch 00000000h
   0607FD40h 00000000h
   0607FD44h 00000000h
   0607FD48h 00000000h
   0607FD4Ch 00000000h
   0607FD50h 00000000h
   0607FD54h 00000000h
   0607FD58h 00000000h
   0607FD5Ch 00000000h
   0607FD60h 00000000h
   0607FD64h 00000000h
   0607FD68h 00000000h
   0607FD6Ch 00000000h
   0607FD70h 00000000h
   0607FD74h 00000000h
   0607FD78h 00000000h
   0607FD7Ch 00000000h
   0607FD80h 00000000h
   0607FD84h 00000000h
   0607FD88h 00000000h
   0607FD8Ch 00000000h
   0607FD90h 00000000h
   0607FD94h 00000000h
   0607FD98h 00000000h
   0607FD9Ch 00000000h
   0607FDA0h 00000000h
   0607FDA4h 00000000h
   0607FDA8h 00140178h
   0607FDACh 00000000h
   0607FDB0h 00000000h
   0607FDB4h 00000000h
   0607FDB8h 00000000h
   0607FDBCh 00000000h
   0607FDC0h 00000038h
   0607FDC4h 00000023h
   0607FDC8h 00000023h
   0607FDCCh 7E42C1F0h
   0607FDD0h 0020FAB8h
   0607FDD4h 7FFAC000h
   0607FDD8h 00000000h
   0607FDDCh 0106E028h
   0607FDE0h 0000000Dh
   0607FDE4h 010F25C8h ??? Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
   0607FDE8h 7FFAC000h
   0607FDECh 0106DCD4h
   0607FDF0h 010F25C8h ??? Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
   0607FDF4h 00000000h
   0607FDF8h 00000000h
   0607FDFCh 00000C00h
   0607FE00h 00000C31h
   0607FE04h 00000000h
   0607FE08h 0845C700h
   0607FE0Ch 01020AEDh
   0607FE10h 00000000h
   0607FE14h 0845C700h
   0607FE18h 010200F4h
   0607FE1Ch 05C978F4h
   0607FE20h 00000000h
   0607FE24h 00000C31h
   0607FE28h 00000000h
   0607FE2Ch 010DD612h ??? Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
   0607FE30h 0007FE6Bh
   0607FE34h 7FFAC000h
   0607FE38h 00000000h
   0607FE3Ch 0106E028h
   0607FE40h 00000009h
   0607FE44h 010F25C8h ??? Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
   0607FE48h 7FFAC000h
   0607FE4Ch 0106DCD4h
   0607FE50h 010F25C8h ??? Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
   0607FE54h 05CBF580h
   0607FE58h 00000000h
   0607FE5Ch 00000004h
   0607FE60h 00000004h
   0607FE64h 08459030h
   0607FE68h 01020DEDh
   0607FE6Ch 00000000h
   0607FE70h 08459030h
   0607FE74h 00000000h
   0607FE78h 0101FFA2h
   0607FE7Ch 05CBF580h
   0607FE80h 00000000h
   0607FE84h 00000004h
   0607FE88h 00000000h
   0607FE8Ch 010DD606h ??? Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
   0607FE90h 0007FECBh
   0607FE94h 84000000h
   0607FE98h 060607FFh
   0607FE9Ch 0607FF3Fh
   0607FEA0h 7C90DF5Ah
   0607FEA4h 7C919B23h
   0607FEA8h 000005B4h
   0607FEACh 00000000h
   0607FEB0h 00000000h
   0607FEB4h 7E42C1F0h
   0607FEB8h 0607FF9Ch
   0607FEBCh FFFFFFCEh
   0607FEC0h 00000250h
   0607FEC4h 000009F8h
   0607FEC8h 0106DAF0h
   0607FECCh 05CBEA38h
   0607FED0h 00000100h
   0607FED4h 010DA878h ??? Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
   0607FED8h 0607FF50h EBP
[01]   0607FEDCh 010AA3C8h RET Line ?=27    no proc       Src="Library State"  Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
   0607FEE0h 00000000h
   0607FEE4h 010A113Ch
   0607FEE8h 00542668h
   0607FEECh 00000000h
   0607FEF0h 00000000h
   0607FEF4h 0607FF3Fh
   0607FEF8h 13044A00h ??? Line ?=246    no proc       Src=NetEnc.Clw    Module=C:\CLARION6\3rdParty\Bin\c60netx.dll 6.44 Built for Clarion 6 9054-9
   0607FEFCh 08461D68h
   0607FF00h 08461D68h
   0607FF04h 0607FF3Fh
   0607FF08h 0107E8CDh
   0607FF0Ch 01022198h
   0607FF10h 010A10CAh
   0607FF14h 7E42C1F0h
   0607FF18h 0607FF9Ch
   0607FF1Ch 0607FF50h
   0607FF20h 0607FF34h
   0607FF24h 010A113Ch
   0607FF28h 7C90E514h
   0607FF2Ch 00000000h
   0607FF30h 00542668h
   0607FF34h 00000000h
   0607FF38h 010A11D6h
   0607FF3Ch 010EA4ACh ??? Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
   0607FF40h 00000000h
   0607FF44h 010D8F3Bh ??? Line ?=3023    no proc       Src=wsl.cpp    Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
   0607FF48h 1304112Ch ??? Line ?=246    no proc       Src=NetEnc.Clw    Module=C:\CLARION6\3rdParty\Bin\c60netx.dll 6.44 Built for Clarion 6 9054-9
   0607FF4Ch FFFFFFCEh
   0607FF50h 0607FF8Ch EBP
[02]   0607FF54h 13007710h RET Line=931       Proc=CALLBACKWINDOWSRC@F  Src=netdl003.clw    Module=C:\CLARION6\3rdParty\Bin\c60netx.dll 6.44 Built for Clarion 6 9054-9
   0607FF58h 7E42C1F0h
   0607FF5Ch 0607FF9Ch
   0607FF60h 0607FF8Ch
   0607FF64h 0607FF78h
   0607FF68h 018C32BCh
   0607FF6Ch 7C90E514h
   0607FF70h 0607FF84h
   0607FF74h 08090809h
   0607FF78h 00000000h
   0607FF7Ch 00000000h
   0607FF80h 00000000h
   0607FF84h 00000000h
   0607FF88h 0607FF8Ch
   0607FF8Ch 0607FFECh EBP
[03]   0607FF90h 01091AB1h RET no line number    no proc       Module=C:\Clarion6\BIN\c60runx.dll 6.300.9054
   0607FF94h FFFFFFFFh
   0607FF98h 018C32BCh
   0607FF9Ch 00000000h
   0607FFA0h 0000B014h
   0607FFA4h 00000000h
   0607FFA8h 00000000h
   0607FFACh 00A2E829h ??? Line ?=279    no proc       Src=WinExt.CLW    Module=C:\istockcablev3\DATA.dll 3.0.0.248
   0607FFB0h 000000F4h
   0607FFB4h 0000003Fh
   0607FFB8h 7C80B729h
   0607FFBCh 018C32BCh
   0607FFC0h 7E42C1F0h
   0607FFC4h FFFFFFFFh
   0607FFC8h 018C32BCh
   0607FFCCh 7FFAC000h
   0607FFD0h C0000005h
   0607FFD4h 0607FFC0h
   0607FFD8h 0607F6DCh
   0607FFDCh FFFFFFFFh
   0607FFE0h 7C839AD8h
   0607FFE4h 7C80B730h
   0607FFE8h 00000000h
   0607FFECh 00000000h EBP
   0607FFF0h 00000000h RET

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: GPF when sending emails on multiple threads
« Reply #5 on: September 18, 2012, 10:23:29 PM »
Hi Richard,

The stack trace doesn't really tell us anything. That's there for a somewhat different purpose.

The fact you are getting duplicates is interesting. I think that's at least one concrete thing to start with. If it's sending duplicates then there's a hole in your system somewhere. (ie you are telling it to send it twice.)

Timer events are always a source of concern in an asynchronous system. So I'd probably recommend starting by either removing them from the algorithm, or by slowing them down so they don't become a factor. (like triggering them every minute or so.)

Working with multiple threads in the way you are can be difficult at the best of times, so it'll take a bit of debugging to see what goes where.

Cheers
Bruce

useless

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • Email
Re: GPF when sending emails on multiple threads
« Reply #6 on: September 19, 2012, 02:27:48 AM »
I've a problem, the C6 RTL appears to be getting its threads mixed up!

I just quickly added Mark Goldbergs debug class which outputs whatever I state via the DebugOutput API so the Sysinternals debugview can log it and as you can see from the screenshots and debugview log file, it gets to what should be thread 10 and 11 which should be the 9th and 10th SendEmail window and is showing its running on thread 1 again which is a separate procedure. The rest of the global & local vars appear to be ok, but theres no telling what is going on under the hood in the RTL but it appears to be causing the crash.
Off to try this in C8 now to see if the problem still persists, but I should add I have found a separate bug in the RTL where the IF logical statement fails when a window is subclassed as well which has also caused problems elsewhere for me. What I mean by this, is IF condition=True is failing, this came to my attention because I program defensively and log all errors and errors were showing up in the log files which shouldnt have been happening.



useless

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
    • Email
Re: GPF when sending emails on multiple threads
« Reply #7 on: September 19, 2012, 02:30:59 AM »
whoops clicked the wrong link. Heres the screenshots and log.

I suspect this problem could also account for random file corruptions and random crashes in my apps but without being able to see the RTL code I can only speculate on this, its hard to say exactly what effect this will have on a app used in anger.

[attachment deleted by admin]

bruce2

  • Full Member
  • ***
  • Posts: 108
    • View Profile
    • Email
Re: GPF when sending emails on multiple threads
« Reply #8 on: September 19, 2012, 02:58:22 AM »
Hi Richard,

I think it's unlikely that the thread number is going wrong. We have a number of highly threaded apps, and none have ever shown signs of getting the numbers wrong.

Obviously though there is a disconnect between the one view of your thread number, and the other. It might be worth examining the class to see if there's a reason why it might be getting it wrong.

It might be time for you to post a small example app of what you are trying to do, so we can see if we get the same effect as you.

cheers
Bruce