strange things:
My SCGI programm written in PB on a Debian 7 64bit PC fails on a PC where I upgraded to Debian 8.
A small test program shows the following:
If I call the procedure without creating a thread it runs on both PCs.
If I call the procedure as thread it generates an IMA on the Debian 8 PC.
On the Debian 7 PC it's still working.
And yes, threadsave is enabled
Code: Select all
EnableExplicit
Procedure Send(*Dummy)
Protected.i Mail
Protected Alarm$
Mail = CreateMail(#PB_Any, "supervisor@smarthome.ednt.de", "Test")
If Mail
PrintN("created")
Alarm$ = "That's the main body"
PrintN("before SetMailBody")
SetMailBody(Mail, Alarm$)
PrintN("after SetMailBody")
AddMailRecipient(Mail, "root@localhost", #PB_Mail_To)
PrintN("after AddMailRecipient")
If SendMail(Mail, "127.0.0.1")
PrintN("success")
EndIf
EndIf
EndProcedure
Define.i Thread
InitNetwork()
OpenConsole()
PrintN("Called normal:")
Send(0)
PrintN("")
PrintN("Now as thread:")
Thread = CreateThread(@Send(), 0)
WaitThread(Thread)
; IDE Options = PureBasic 5.31 (Linux - x64)
; ExecutableFormat = Console
; CursorPosition = 35
; Folding = -
; EnableThread
; EnableXP
; Executable = SetMailBodyTest
Output on Debian 8Called normal:
created
before SetMailBody
after SetMailBody
after AddMailRecipient
success
Now as thread:
created
before SetMailBody
after SetMailBody
after AddMailRecipient
success
Any idea what to doCalled normal:
created
before SetMailBody
after SetMailBody
after AddMailRecipient
success
Now as thread:
created
before SetMailBody
Speicherzugriffsfehler
Bernd
