Posted: Mon Feb 12, 2007 1:50 pm
The log file was generated this time - Ive sent you a PM.
http://www.purebasic.com
https://www.purebasic.fr/english/
So the crash occurs after PureSMTP has sent the base64 encoded username, and before it sends the base64 encoded password. Crash during 2nd base64 encode ?DoubleDutch wrote:The last message that is okay is #10
SEND: YW50aG9 ... NvbQ==
(the ... is me, it didn't display this).
After #10 it crashed.
In case you need to know, message 9, it was:
RECEIVE: 334 VXNI .... WU6
Code: Select all
Procedure.s Base64Encode(strText.s)
Protected Result.s, *B64EncodeBufferA, *B64EncodeBufferB, OutputBufferLength.l, InputBufferLength.l
InputBufferLength = Len(strText)
OutputBufferLength = InputBufferLength * 2
If OutputBufferLength < 64
OutputBufferLength = 64
EndIf
*B64EncodeBufferA = AllocateMemory(InputBufferLength)
If *B64EncodeBufferA
*B64EncodeBufferB = AllocateMemory(OutputBufferLength)
If *B64EncodeBufferB
PokeS(*B64EncodeBufferA, strText) ; PokeS(*B64EncodeBufferA, strText, InputBufferLength, #PB_Ascii) if unicode
Base64Encoder(*B64EncodeBufferA, InputBufferLength, *B64EncodeBufferB, OutputBufferLength)
Result = PeekS(*B64EncodeBufferB)
FreeMemory(*B64EncodeBufferB)
EndIf
FreeMemory(*B64EncodeBufferA)
EndIf
ProcedureReturn Result
EndProcedure
For i = 0 To 10
Debug Base64Encode("hello world")
Next
In the 1st version I send Username/Password, in the 2nd version I send the Username, wait for server answer and then send the Password. No other change. The extra message is displayed after password/username is sent.DoubleDutch wrote:No, that base64 test works just fine.
It crashed between #13 and #14 in the 2nd test of your library, but crashed just after #10 the first time. What else did you change at the point just after #10?
Was it just the EXTRA message?
If you can reproduce that problem with PureSMTP_VISTA_TEST.exe (using authentication) then it's not a Tailbite problem (if you cannot, then it may be a Tailbite problem).DoubleDutch wrote:If you want to PM me some source code, I can test it out and then you can see if its TailBite thats maybe causing the problem or something else?
Maybe. It should not crash anyway.DoubleDutch wrote:3.94 crashes at the same place
The PureSMTP_VISTA_TEST programs works, but crashes (sometimes) if you put the wrong user/password information.
Note: the crashing appears to be "random", sometimes it will produce the correct error info until you rerun the program - then it will crash at the 1st go of incorrect info.
Maybe this is because of something else?
Even with the wrong password ?DoubleDutch wrote:It works fine under XP.
So it's a Vista related problem, nothing to do with Tailbite (the test executable was not built with the library) or this Purebasic version (the crash also happens with the PB3.94 library).DoubleDutch wrote:I can get the PureSMTP_VISTA_TEST program to crash every time now. It happens when I enter the wrong password.
You already have :DoubleDutch wrote:If you have any source for this I can try track it down.
With this kind of error the crash may occur far away from the initial problem. Anyway, the only thing that changes if you use authentication is the base64 encoding.Error c00000005
An attempted read or write to/from an address to which theat process isn't allowed
Module: c:\purebasic400\Program\PureSMTP_VISTA_TEST.pb; Line: 416
I meant : you already have tracked it down (error line).DoubleDutch wrote:I dont have the source for PureSMTP_VISTA_TEST.pb ???