Access violation in module ’kernel32.dll’

Discuss RoboTask here
Post Reply
paulus
Posts: 19
Joined: Tue Sep 14, 2004 1:51 am
Location: Netherlands

Access violation in module ’kernel32.dll’

Post by paulus »

Hi,
Using Robotask version 2.2.1
I`ve multiple simultainiously tasks running which start there own VB-scripts. Many VB-scripts in these tasks make use of the GetCurrentThreadId function in kernel32.dll
Somethimes (one a month) I get the following error:
E: 6-12-2005 2:36:00: Access violation at address 7C575B81 in module 'kernel32.dll'. Read of address 0F87C000
E: 6-12-2005 2:36:00: An error occured. Reconfigure this step.
E: 6-12-2005 2:36:00: Task execution is aborted


Could it be that simultainious declaration of function GetCurrentThreadId will lead to this error, when two tasks run at the same time?
Am I using the right VB-script statement? I'm using statement: Declare Function GetCurrentThreadId Lib "kernel32" As Long
Should it be: Public Declare Function GetCurrentThreadId Lib "kernel32" Alias "GetCurrentThreadId" () As Long

The error does not occur in the same task, when it occurs. Each time it's another task using a VB-script as descibed before.
Adios, Paulus
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Access violation in module ’kernel32.dll’

Post by Oleg »

Thank you for your message.
You do everything correctly, and your tasks must work fine. We shall investigate this problem.
Can you send some of BASIC scripts you use?
paulus
Posts: 19
Joined: Tue Sep 14, 2004 1:51 am
Location: Netherlands

Access violation in module ’kernel32.dll’

Post by paulus »

VB-script 1:

Code: Select all

Declare Function GetCurrentThreadId Lib "kernel32" As Long
Sub Main
 Dim logfilename
 Dim currentYear
 Dim currentMonth
 Dim currentDay
 Dim currentYearMonth
    On Error GoTo ErrHndlr
 Dim thr As Long
 thr = GetCurrentThreadId
 currentYear = Year(Now)
 currentMonth = Month(Now)
 currentDay = Day(Now)
  If currentMonth = 1 Then
   currentYear = currentYear - 1
   currentMonth = 12
  Else
   currentMonth = currentMonth - 1
  End If
' RoboTaskApp.SetUserVariable("{CUBE_BUILD_YEAR}", currentYear )
'    RoboTaskApp.WriteToLog(1 , "CUBE_BUILD_YEAR=" & currentYear, thr)
 currentYearMonth = Format(currentYear,"0000") & "-" & Format(currentMonth,"00")
  RoboTaskApp.SetUserVariable("{KUBUSHISTORY_COPYTO_YEAR _MONTH}", currentYearMonth )
    RoboTaskApp.WriteToLog(1 , "KUBUSHISTORY_COPYTO_YEAR_MONTH=" & currentYearMonth, thr)
ErrHndlr:
 If Err = 0 Then
 Else
  Dim ErrMsg
  ErrMsg = Format(Now,"DD-MM-YYYY HH.MM.SS") & " ::*Error occurred: " & Error$ & " Filename=" & filename
  Debug.Print ErrMsg
  RoboTaskApp.SetUserVariable("{ERROR_MESSAGE}", ErrMsg )
     RoboTaskApp.WriteToLog(1 , ErrMsg, thr)
     Resume Next
 End If
End Sub
 
 
paulus
Posts: 19
Joined: Tue Sep 14, 2004 1:51 am
Location: Netherlands

Access violation in module ’kernel32.dll’

Post by paulus »

VB-script 2:

Code: Select all

Declare Function GetCurrentThreadId Lib "kernel32" As Long
Sub Main
 Dim filename
 Dim filedate
 Dim logfilename
 Dim paramYear
 Dim paramCUBE_BUILD_YEAR_START_RANGE
 Dim paramCUBE_BUILD_YEAR_END_RANGE
 Dim thr As Long
    On Error GoTo ErrHndlr
 thr = GetCurrentThreadId
 RoboTaskApp.SetUserVariable("FILEDATE_BEZETTING", "" )
  RoboTaskApp.SetUserVariable("FILEDATE_MOBILITEIT_DOORS TROOM", "" )
  RoboTaskApp.SetUserVariable("FILEDATE_MOBILITEIT_STAND EN", "" )
 RoboTaskApp.SetUserVariable("FILEDATE_VERZUIMDAG", "" )
  RoboTaskApp.SetUserVariable("FILEDATE_BEZETTING_MEERJA REN", "" )
  RoboTaskApp.SetUserVariable("FILEDATE_MOBILITEIT_DOORS TROOM_MEERJAREN", "" )
  RoboTaskApp.SetUserVariable("FILEDATE_MOBILITEIT_STAND EN_MEERJAREN", "" )
 paramYear = RoboTaskApp.ExpandText("{CUBE_BUILD_YEAR}")
 paramCUBE_BUILD_YEAR_START_RANGE = RoboTaskApp.ExpandText("{CUBE_BUILD_YEAR_START_RANGE}")
 paramCUBE_BUILD_YEAR_END_RANGE = RoboTaskApp.ExpandText("{CUBE_BUILD_YEAR_END_RANGE}")
 filename = RoboTaskApp.ExpandText("{SERVER_LOCATION}")  &"\Cognos\Productie\PowerPlay\Mensproces\Bezetting\bezet ting " & paramYear & ".mdc"
 filedate = Empty
 filedate = FileDateTime(filename)
 If filedate = Empty Then
  filedate = "File niet aangetroffen"
 End If
 RoboTaskApp.SetUserVariable("FILEDATE_BEZETTING", filedate )
 filename = RoboTaskApp.ExpandText("{SERVER_LOCATION}")  &"\Cognos\Productie\PowerPlay\Mensproces\Mobiliteit\mobi liteit_doorstroom " & paramYear & ".mdc""
 filedate = Empty
 filedate = FileDateTime(filename)
 If filedate = Empty Then
  filedate = "File niet aangetroffen"
 End If
  RoboTaskApp.SetUserVariable("FILEDATE_MOBILITEIT_DOORS TROOM", filedate )
 filename = RoboTaskApp.ExpandText("{SERVER_LOCATION}")  &"\Cognos\Productie\PowerPlay\Mensproces\Mobiliteit\mobi liteit_standen " & paramYear & ".mdc"
 filedate = Empty
 filedate = FileDateTime(filename)
 If filedate = Empty Then
  filedate = "File niet aangetroffen"
 End If
  RoboTaskApp.SetUserVariable("FILEDATE_MOBILITEIT_STAND EN", filedate )
 filename = RoboTaskApp.ExpandText("{SERVER_LOCATION}") &"\Cognos\Productie\PowerPlay\Mensproces\Verzuim\verzuim dag " & paramYear & ".mdc"
 filedate = Empty
 filedate = FileDateTime(filename)
 If filedate = Empty Then
  filedate = "File niet aangetroffen"
 End If
 RoboTaskApp.SetUserVariable("FILEDATE_VERZUIMDAG", filedate )

 filename = RoboTaskApp.ExpandText("{SERVER_LOCATION}")  &"\Cognos\Productie\PowerPlay\Mensproces\Bezetting\bezet ting " & paramCUBE_BUILD_YEAR_START_RANGE & "-" & paramCUBE_BUILD_YEAR_END_RANGE & ".mdc"
 filedate = Empty
 filedate = FileDateTime(filename)
 If filedate = Empty Then
  filedate = "File niet aangetroffen"
 End If
  RoboTaskApp.SetUserVariable("FILEDATE_BEZETTING_MEERJA REN", filedate )
 filename = RoboTaskApp.ExpandText("{SERVER_LOCATION}")  &"\Cognos\Productie\PowerPlay\Mensproces\Mobiliteit\mobi liteit_doorstroom " & paramCUBE_BUILD_YEAR_START_RANGE & "-" & paramCUBE_BUILD_YEAR_END_RANGE & ".mdc""
 filedate = Empty
 filedate = FileDateTime(filename)
 If filedate = Empty Then
  filedate = "File niet aangetroffen"
 End If
  RoboTaskApp.SetUserVariable("FILEDATE_MOBILITEIT_DOORS TROOM_MEERJAREN", filedate )
 filename = RoboTaskApp.ExpandText("{SERVER_LOCATION}")  &"\Cognos\Productie\PowerPlay\Mensproces\Mobiliteit\mobi liteit_standen " & paramCUBE_BUILD_YEAR_START_RANGE & "-" & paramCUBE_BUILD_YEAR_END_RANGE & ".mdc"
 filedate = Empty
 filedate = FileDateTime(filename)
 If filedate = Empty Then
  filedate = "File niet aangetroffen"
 End If
  RoboTaskApp.SetUserVariable("FILEDATE_MOBILITEIT_STAND EN_MEERJAREN", filedate )
 filename = ""
ErrHndlr:
 If Err = 0 Then
 Else
  Dim ErrMsg
  ErrMsg = Error$
  If (filename = "") Then
   ErrMsg = Format(Now,"DD-MM-YYYY HH.MM.SS") & " ::*Error occurred: " & ErrMsg
  Else
   ErrMsg = Format(Now,"DD-MM-YYYY HH.MM.SS") & " ::*Error occurred: " & ErrMsg & " Filename=" & filename
  End If
  Debug.Print ErrMsg
  RoboTaskApp.SetUserVariable("{ERROR_MESSAGE}", ErrMsg )
     RoboTaskApp.WriteToLog(1 , ErrMsg, thr)
     Resume Next
 End If
End Sub
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Access violation in module ’kernel32.dll’

Post by Oleg »

Thank you very much.
paulus
Posts: 19
Joined: Tue Sep 14, 2004 1:51 am
Location: Netherlands

Access violation in module ’kernel32.dll’

Post by paulus »

I can add to this:
VB-script 1 is running every 5 minutes (without a problem), while VB-script 2 was executed succesfully by the following robotask-task (the error occurred when Action2 was starting)
The complete errorlog:
I: 6-12-2005 2:36:00: ****** Starting task... ******************
I: 6-12-2005 2:36:00: Task started with priority: Normal
I: 6-12-2005 2:36:00: Executing "Basic Script"
I: 6-12-2005 2:36:00: Executing "Send Email: Controleren maandelijkse kubussen"
E: 6-12-2005 2:36:00: Access violation at address 7C575B81 in module 'kernel32.dll'. Read of address 0F87C000
E: 6-12-2005 2:36:00: An error occured. Reconfigure this step.
E: 6-12-2005 2:36:00: Task execution is aborted

The task export:
;**********************
;* RoboTask Task file *
;* Do not edit!       *
;**********************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1173995626
ContinueOnError=INTEGER|1
ExternalName=STRING|"Task75"
Hide=INTEGER|0
ID=INTEGER|873809681
Name=STRING|"Send mail - Maandelijkse kubussen gebouwd"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
[Actions]
Action1=FOLDER
Action2=FOLDER
[Actions\Action1]
ActionID=STRING|"BASIC_SCRIPT"
Enabled=INTEGER|-1
Name=STRING|"Basic Script"
Params=FOLDER
[Actions\Action1\Params]
linecount=STRING|"0"
scriptname=STRING|"D:\Robotask\BasicScripts\kubusbouw resultaat.bas"
source=STRING|"1"
[Actions\Action2]
ActionID=STRING|"A_INET_SENDMAIL"
Enabled=INTEGER|-1
Name=STRING|"Send Email: Controleren maandelijkse kubussen"
Params=FOLDER
[Actions\Action2\Params]
attach0=STRING|"{SERVER_LOCATION}\Cognos\Productie\Logfiles\ RoboTask\Maandkubussen.log"
attachcount=STRING|"1"
auth=STRING|"0"
cc=STRING|"{EMAIL_APPL_BEHEERDER1},{EMAIL_APPL_BEHEERDER2},{ EMAIL_APPL_BEHEERDER3}"
from=STRING|"maandkubus@ibn-groep.nl"
host=STRING|"10.1.1.4"
html=STRING|"1"
msg0=STRING|"<html>"
msg1=STRING|"<head>"
msg10=STRING|"De maandelijks gegenereerde kubussen zijn aangemaakt. De volgende kubussen moeten nu gecontroleerd worden, zodat ze beschikbaar gesteld kunnen worden voor de Controllers:<BR>"
msg11=STRING|"<li><a href=""{SERVER_LOCATION}\Cognos\Productie\PowerPlay\Mensproc es\Bezetting\bezetting {CUBE_BUILD_YEAR}.mdc"">Bezetting kubus</a> (filedate: {FILEDATE_BEZETTING})<BR>"
msg12=STRING|"<li><a href=""{SERVER_LOCATION}\Cognos\Productie\PowerPlay\Mensproc es\Mobiliteit\mobiliteit_doorstroom {CUBE_BUILD_YEAR}.mdc"">Mobiliteit doorstroom kubus</a> (filedate: {FILEDATE_MOBILITEIT_DOORSTROOM})<BR>"
msg13=STRING|"<li><a href=""{SERVER_LOCATION}\Cognos\Productie\PowerPlay\Mensproc es\Mobiliteit\mobiliteit_standen {CUBE_BUILD_YEAR}.mdc"">Mobiliteit standen kubus</a> (filedate: {FILEDATE_MOBILITEIT_STANDEN})<BR>"
msg14=STRING|"<li><a href=""{SERVER_LOCATION}\Cognos\Productie\PowerPlay\Mensproc es\Verzuim\verzuim dag {CUBE_BUILD_YEAR}.mdc"">Verzuim kubus</a> (filedate: {FILEDATE_VERZUIMDAG})<BR>"
msg15=STRING|"<BR>"
msg16=STRING|"<li><a href=""{SERVER_LOCATION}\Cognos\Productie\PowerPlay\Mensproc es\Bezetting\bezetting {CUBE_BUILD_YEAR_START_RANGE}-{CUBE_BUILD_YEAR_END_RANGE}.md c"">Bezetting {CUBE_BUILD_YEAR_START_RANGE}-{CUBE_BUILD_YEAR_END_RANGE} kubus</a> (filedate: {FILEDATE_BEZETTING_MEERJAREN})<BR>"
msg17=STRING|"<li><a href=""{SERVER_LOCATION}\Cognos\Productie\PowerPlay\Mensproc es\Mobiliteit\mobiliteit_doorstroom {CUBE_BUILD_YEAR_START_RANGE}-{CUBE_BUILD_YEAR_END_RANGE}.md c"">Mobiliteit doorstroom {CUBE_BUILD_YEAR_START_RANGE}-{CUBE_BUILD_YEAR_END_RANGE} kubus</a> (filedate: {FILEDATE_MOBILITEIT_DOORSTROOM_MEERJAREN})<BR>"
msg18=STRING|"<li><a href=""{SERVER_LOCATION}\Cognos\Productie\PowerPlay\Mensproc es\Mobiliteit\mobiliteit_standen {CUBE_BUILD_YEAR_START_RANGE}-{CUBE_BUILD_YEAR_END_RANGE}.md c"">Mobiliteit standen {CUBE_BUILD_YEAR_START_RANGE}-{CUBE_BUILD_YEAR_END_RANGE} kubus</a> (filedate: {FILEDATE_MOBILITEIT_STANDEN_MEERJAREN})<BR>"
msg19=STRING|"<BR>"
msg2=STRING|"<meta name=""Copyright"" content=""Copyright (C) 2005 IBN-groep. All Rights Reserved."">"
msg20=STRING|"Wanneer alle kubussen goedgekeurd zijn, wordt er een maandelijkse versie apart gezet door op de volgende link te klikken:<BR>"
msg21=STRING|"<a href="" Maak'>http://{SERVER_NAME}/ibn-applicatiebeheer-portal/start robotasks/execute_robotask.asp?command=CUBES_ARE_CHECKED""&g t;Maak nieuwe maandversie van alle kubussen</a> (deze link is op elk gewenst moment te gebruiken)<BR>"
msg22=STRING|"<BR>"
msg23=STRING|"Zolang de kubussen niet goedgekeurd zijn, is via website <a href="" IBN-groep'>http://{SERVER_NAME}/ibn-rapportages/"">IBN-gr oep - Cognos rapportages voor de Controllers</a> geen rapportage op te vragen van de laatste maand.<BR>"
msg24=STRING|"Nadat de kubussen goedgekeurd zijn, worden zij automatisch gecopieerd/gepubliceerd naar de cognos website CWEB.<BR>"
msg25=STRING|"<BR>"
msg26=STRING|"Met vriendelijke groet,<BR>"
msg27=STRING|"Applicatiebeheer Afd.ICT<BR>"
msg28=STRING|"<BR>"
msg29=STRING|"<BR>"
msg3=STRING|"<meta name=""Trademark"" content=""IBN-groep."">"
msg30=STRING|"Attachement:<BR>"
msg31=STRING|"<li>Maandkubussen.log: Overzicht van alle aangemaakte kubussen.<BR>"
msg32=STRING|"<BR>"
msg33=STRING|"<HR>"
msg34=STRING|"Dit mailtje is automatisch verstuurd door Robotask (versie {ROBOTASK_VERSION}) op server {SERVER_NAME}.<BR>Datum: {DateTime}"
msg35=STRING|"<HR>"
msg36=STRING|"</body>"
msg37=STRING|"</html>"
msg4=STRING|"<meta name=""Author"" content=""Paul Siteur."">"
msg5=STRING|"</head>"
msg6=STRING|"<body>"
msg7=STRING|"<font FACE=""Arial"" COLOR=""#000000"">"
msg8=STRING|"Geachte,<BR>"
msg9=STRING|"<BR>"
msgcount=STRING|"38"
password=STRING|"2693725452264732468926736"
port=STRING|"25"
subject=STRING|"Maandelijks gegenereerde kubussen moeten gecontroleerd worden op {SERVER_NAME} (maand={KUBUSHISTORY_COPYTO_YEAR_MONTH})"
to=STRING|"{EMAIL_INFORMATIE_MANAGER1}"
 
Oleg
Site Admin
Posts: 3014
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Access violation in module ’kernel32.dll’

Post by Oleg »

I: 6-12-2005 2:36:00: Executing "Send Email: Controleren maandelijkse kubussen"
E: 6-12-2005 2:36:00: Access violation at address 7C575B81 in module 'kernel32.dll'. Read of address 0F87C000
E: 6-12-2005 2:36:00: An error occured. Reconfigure this step.
I see that error was raised in "Send email" step (not in basic script). Previous step was done without errors.
Post Reply