Welcome! Log In Create A New Profile

Advanced

Interlocked Increment()

Posted by Robin Lane 
Interlocked Increment()
April 23, 2019 07:53AM
Hi All,

I have an app which works okay when run in test mode on my development machine.

I've recently tried to deploy it onto another laptop and although it installs fine, I'm getting the following error when trying a certain process.

Can anyone point me in the right direction please?

Many thanks,
Robin.



Error at line 28 of Local Procedure CrewPopTable process.
Unexpected system error.
If this error systematically occurs in the same conditions, contact PC SOFT Hot Line and specify:
 - the error circumstances,
 - a window, a project or the code lines used to replicate the problem,
 - the details below.

Details techniques :

Module : KERNEL32.DLL
Adresse de base : 76160000
Erreur systeme : Access violation (GPF)
EIP = 7617716B
OS : Windows 8 (6.2.9200)

----- Technical Information -----

Project : DPR Analyser

WL call:
Process of 'Local Procedure CrewPopTable' (WIN_Search.PROCEDURE.CrewPopTable), line 28, thread 0

What happened?
Unexpected system error.
If this error systematically occurs in the same conditions, contact PC SOFT Hot Line and specify:
 - the error circumstances,
 - a window, a project or the code lines used to replicate the problem,
 - the details below.

Details techniques :

Module : KERNEL32.DLL
Adresse de base : 76160000
Erreur systeme : Access violation (GPF)
EIP = 7617716B
OS : Windows 8 (6.2.9200)

Error code: 1020
Level: fatal error

Dump of the error of 'wd210vm.dll' module (21.0.330.0).
Identifier of detailed information (.err): 1020
Debugging information:

Details techniques :

Module : KERNEL32.DLL
Adresse de base : 76160000
Erreur systeme : Access violation (GPF)
EIP = 7617716B
OS : Windows 8 (6.2.9200)
Registres :

  EIP = 7617716B    EBP = 0019D330
  EAX = 00000001    EBX = 00000001
  ECX = FFFFFFF3    EDX = 00000001
  ESI = 03420060    EDI = 035EC480

Pile des appels :

[KERNEL32.DLL (76160000)]	76177160 : InterlockedIncrement() + 11 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25EEBE20 : EXT_bSetVariableCollection() + 321689 bytes
[???]	0019D394
[???]	0250E130
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 39760 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 33552 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 33584 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 33616 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 33632 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 33648 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 33664 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 45088 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 33680 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 33712 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 33728 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 39392 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 39680 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E9CF70 : Execution() + 50000 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	26061A60 : EXT_pszGetMessageErreurDelegue() + 152256 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	26061A60 : EXT_pszGetMessageErreurDelegue() + 152256 bytes
[wd210vm.dll (25E60000), 21.0.330.0, 01A210067f]	25E7DC50 : DeclareProxy() + 82400 bytes

Additional Information:
EIT_PILEWL :
Local Procedure CrewPopTable (WIN_Search.PROCEDURE.CrewPopTable), line 28
Selecting a row of CBO_Crew (WIN_Search.CBO_Crew), line 4
Click BTN_Search (WIN_Main.BTN_Search), line 2
EIT_DATEHEURE : 23/04/2019 06:43:36
EIT_TYPE_WDFILE : <2>
EIT_IDCODE : <458752>

Help
Re: Interlocked Increment()
April 23, 2019 08:04AM
Hi Robin,

this is a GPF - a General Protection Fault. This means that the application accessed an address outside of the address space reserved for your application. If your application is made of WINDEV functions only then only PC Soft will be able to explain the cause of the problem.

If you want a hint then you should release the code of selecting a row of Table "CBO_Crew" and what is behind button BTN_Search. All in all, I fear, even with that code we will not be able to explain.

However, is that computer definitely free of any viruses, malware, adware etc?

Kind regards,
Guenter Predl
office@windev.at
Re: Interlocked Increment()
April 23, 2019 08:47AM
Hi Guenter,

Thank you for your quick reply.

When you say "release the code", do you mean publish it here? I am more than happy to do so if it would help.

I have sent a request to PC Soft, however as an update I get the same error on two separate machines & also when I tried installing the app on my development laptop too.
It is strange that it runs great while in test mode.

Cheers,
Robin.
Re: Interlocked Increment()
April 23, 2019 09:38AM
Here is the code:



PROCEDURE CrewPopTable()
dDateF, dDateT is Date
nCrewID is int
sData is string
arrData is array of strings
arrDataTbT is array of 4 strings
arrCboID is array of 5 int
arrCboName is array of 5 strings

arrCboID = [3, 4, 7, 10, 15]
arrCboName = ["Toolbox Talk", "Drills", "Induction", "Crew Change", "Crew Shift Change"]

// get variables for query
dDateF = EDT_DateFrom
dDateT = EDT_DateTo
nCrewID = CBO_Crew..StoredValue

// for each of the 5 activities in the arrays above loop through & look for CrewID
IF DateValid(dDateF) AND DateValid(dDateT) THEN
	FOR i = 1 TO 5		
		HExecuteQuery(QRY_ActivityByDateAndID, hQueryDefault, dDateF, dDateT, arrCboID)
		HReadFirst(QRY_ActivityByDateAndID)
		WHILE NOT HOut(QRY_ActivityByDateAndID)
			SWITCH arrCboID
				CASE 3:				// TbT
					arrData = CrewCSigneesFind(QRY_ActivityByDateAndID.ActivityID)
					arrDataTbT = Split_3(QRY_ActivityByDateAndID.Description)
					IF ArrayCount(arrData) > 0 THEN
						FOR j = 1 TO ArrayCount(arrData)
							IF arrData[j] < 0 THEN
								sData = arrDataTbT[1]
							ELSE
								sData = " - " +arrData[j] +" - "
							END
							TableAddLine(TBL_Crew, QRY_ActivityByDateAndID.Date, QRY_ActivityByDateAndID.Time, ...
									QRY_ActivityByDateAndID.VesselName, arrCboName, sData, QRY_ActivityByDateAndID.ActivityID)
						END
					END
				CASE 4:		  		// Drill
					arrData = CrewDrillFind(QRY_ActivityByDateAndID.ActivityID)
					IF ArrayCount(arrData) > 0 THEN
						FOR k = 1 TO ArrayCount(arrData)
							TableAddLine(TBL_Crew, QRY_ActivityByDateAndID.Date, QRY_ActivityByDateAndID.Time, ...
								QRY_ActivityByDateAndID.VesselName, arrCboName, arrData[k], QRY_ActivityByDateAndID.ActivityID)
						END
					END
				CASE 7:				// Induction
					arrData = CrewCSigneesFind(QRY_ActivityByDateAndID.ActivityID)
					IF ArrayCount(arrData) > 0 THEN
						FOR l = 1 TO ArrayCount(arrData)
							IF arrData[l] < 0 THEN
								sData = " - - "
							ELSE
								sData = arrData[l]
							END
							TableAddLine(TBL_Crew, QRY_ActivityByDateAndID.Date, QRY_ActivityByDateAndID.Time, ...
									QRY_ActivityByDateAndID.VesselName, arrCboName, sData, QRY_ActivityByDateAndID.ActivityID)
						END
					END
				CASE 10:			// Crew Change
					arrData = CrewCSigneesFind(QRY_ActivityByDateAndID.ActivityID)
					IF ArrayCount(arrData) > 0 THEN
						FOR m = 1 TO ArrayCount(arrData)
							IF arrData[m] = 0 THEN
								sData = "Signed OFF"
							ELSE IF arrData[m] = 1
								sData = "Signed ON"
							ELSE
								sData = arrData[m]
							END
							TableAddLine(TBL_Crew, QRY_ActivityByDateAndID.Date, QRY_ActivityByDateAndID.Time, ...
									QRY_ActivityByDateAndID.VesselName, arrCboName, sData, QRY_ActivityByDateAndID.ActivityID)
						END
					END
				CASE 15:			// Shift Change
				
				OTHER CASE	
			END
			HReadNext(QRY_ActivityByDateAndID)
		END
		HCancelDeclaration(QRY_ActivityByDateAndID)
	END
	TableSort(TBL_Crew, "Col_Date", "Col_Time")
ELSE
	Info("Enter valid dates")
END

and the Called routine at line 28 is:
PROCEDURE CrewCSigneesFind(xActID)
nCrewID is int
arrResult is array of int

nCrewID = CBO_Crew..StoredValue

HReadSeek(CrewSignees, ActivityID, xActID, hIdentical)
WHILE HFound(CrewSignees) = True
	IF CrewSignees.CrewID = nCrewID THEN
		ArrayAdd(arrResult, CrewSignees.SignOnOff)
	END
	HReadNext(CrewSignees, ActivityID)
END
HCancelSeek(CrewSignees, ActivityID)

RESULT arrResult

Re: Interlocked Increment()
April 23, 2019 11:24AM
Hi,

Your function returns an array of int into an array of strings.
If this is not the cause, art least is not good practice.

Regards,
Piet
Re: Interlocked Increment()
April 23, 2019 12:21PM
Good Afternoon Piet,

You are correct (on both counts).
I hadn't recognised the int array to string array issue & it is definitely not good practice.

Also, correcting this has fixed the Interlocked Increment() problem I was having when the app was deployed.

Very many thanks for taking the time to read through my code & identify the problem.

Cheers,
Robin.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: