EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Issues with Multithrading and GetOriginatorProcessName

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#3400
Posted: 07/19/2007 01:12:19
by Stefan Stefan (Basic support level)
Joined: 07/18/2007
Posts: 15

Hello!
I am evaluating CbFs. I have three issues I would like to point out:
The help file says, that all callbacks are being serialized. I do have clear evidence that this is not always the case. I could add a case to reproduce if you like.
During Read callbacks GetOriginatorProcessName does not return the name of the process but some, don't know, maybe internal name (as far as I have seen it's a number).
The same happens if being in Write callbacks.
Regards
Stefan
#3402
Posted: 07/19/2007 01:24:38
by Eugene Mayevski (EldoS Corp.)

Quote
Stefan Stefan wrote:
The help file says, that all callbacks are being serialized. I do have clear evidence that this is not always the case. I could add a case to reproduce if you like.


The callbacks are called from a single worker thread.Of course you can give us a test case so that we can find out what's wrong in it.

Quote
Stefan Stefan wrote:
During Read callbacks GetOriginatorProcessName does not return the name of the process but some, don't know, maybe internal name (as far as I have seen it's a number).
The same happens if being in Write callbacks.


This can happen when cache manager reads or writes data. As such operations are asynchronous, there's no way to find out, who exactly initiated the operation.


Sincerely yours
Eugene Mayevski
#3407
Posted: 07/19/2007 05:33:03
by Eugene Mayevski (EldoS Corp.)

Quote
Eugene Mayevski wrote:
The callbacks are called from a single worker thread.Of course you can give us a test case so that we can find out what's wrong in it.


It looks like the developers' information was misleading.

The callbacks are called consequently for one file. For different files they can be called in parallel. We will add an option to serialize *all* calls to a single thread for the next update.


Sincerely yours
Eugene Mayevski
#3413
Posted: 07/19/2007 13:42:50
by Stefan Stefan (Basic support level)
Joined: 07/18/2007
Posts: 15

Thanks a lot.
I already thought my computer is going crazy cause of the hot weather :)
Regards
Stefan
#3414
Posted: 07/19/2007 14:01:14
by Stefan Stefan (Basic support level)
Joined: 07/18/2007
Posts: 15

Hello!
I do have another issue here. Please see the attached exract:

CloseEnumeration <<<<
GetContext 14808928
Context found: True
GetContext 14808928
Context found: True
DeleteContext 14808928 (2) <<<<
EnumerateDirectory *
GetContext 14808928
Context found: False
Exception Invalid context 14808928

I do get an EnumerateDirectory callback with an EnumerationContext which immediately before has been requested to be closed (first line CloseEnumeration, Context is 14808928). The code is actually almost the same as in your demo (I am just keeping a list of pointers and handles... else I think I would get an InvalidPointer Exception here)
These problems are probably not related as I ensured using CriticalSections within my code that the callbacks are -really- serialized.
This mainly happens when copying a bunch of files to a mounted volume and during copying pressing F5 being in Windows Explorer :o)
Regards
Stefan
#3417
Posted: 07/19/2007 18:31:48
by Stefan Stefan (Basic support level)
Joined: 07/18/2007
Posts: 15

And I would have another answer about your worker threads. If I receive callbacks from within different worker threads I would need to care for this within my code. Is there any way to get notified when a new worker thread has been created or at least, when a worker thread has been destroyed (so I could also do any necessary clean up within my code)?
Regards
Stefan
#3420
Posted: 07/20/2007 01:13:56
by Eugene Mayevski (EldoS Corp.)

Quote
Stefan Stefan wrote:
And I would have another answer about your worker threads. If I receive callbacks from within different worker threads I would need to care for this within my code. Is there any way to get notified when a new worker thread has been created or at least, when a worker thread has been destroyed (so I could also do any necessary clean up within my code)?


This should not be needed in case of proper synchronization in your code. I.e. your methods should not care about the exact thread in which they are invoked, but should aquire a critical section or a mutex.

Your other question has been moved to HelpDesk.


Sincerely yours
Eugene Mayevski
#19066
Posted: 02/15/2012 07:31:58
by Ivan P (Priority Standard support level)
Joined: 04/11/2011
Posts: 66

Hi Eugene,
Quote
Eugene Mayevski wrote:
This can happen when cache manager reads or writes data. As such operations are asynchronous, there's no way to find out, who exactly initiated the operation.

There're cases when ProcessId is known, but process name isn't.

Take a look at the 2 log snippets below. The log has the following structure:
[ProcessName:PID:MngTID] Operation: parameters

This snippet shows that file seems to be written by system cach (the process Id is 4)
Code
[WINWORD.:11508:16]: SetEOF: '\~WRD0000.tmp', EOF: [002D3000]
[<Unknown>:    4:12]: Write: '\~WRD0000.tmp' (ctx:0020119C), [00006000:1000]
[<Unknown>:    4:15]: Write: '\~WRD0000.tmp' (ctx:0020119C), [00007000:1000]
[<Unknown>:    4:17]: Write: '\~WRD0000.tmp' (ctx:0020119C), [00091000:1000]


But this one shows that process Id is known, but request to GetOriginatorProcessName fails:
Code
[WINWORD.:11508:12]: SetEOF: '\~WRD0000.tmp', EOF: [00339400]
[WINWORD.:11508:13]: SetAllocationSize: '\~WRD0000.tmp' to 0033E600
[WINWORD.:11508:13]: SetEOF: '\~WRD0000.tmp' (ctx:0020119C), EOF: [0033E600]
[<Unknown>:11508:11]: Write: '\~WRD0000.tmp' (ctx:0020119C), [00339000:0400]
[<Unknown>:11508:15]: Write: '\~WRD0000.tmp' (ctx:0020119C), [00339600:5000]
[<Unknown>:11508:12]: Read: '\~WRD0000.tmp' (ctx:0020119C), [0032F000:1000]


Is it expected behavior?

OS: Windows 7 Ultimate x64
Driver version: 3.2.104.258

Thanks,
IP
#19069
Posted: 02/15/2012 07:58:02
by Eugene Mayevski (EldoS Corp.)

Moved to helpdesk. On a side note, please assign the license ticket to your user account. This would let developers recognize you as a licensed customer.


Sincerely yours
Eugene Mayevski
#22507
Posted: 11/16/2012 12:19:54
by Ivan P (Priority Standard support level)
Joined: 04/11/2011
Posts: 66

I noticed that calling GetOriginatorProcessName(ref string) from the OnGetVolumeSize callback it returns true indicating success, but the returned string value contains trash.

I installed the latest driver version 3.2.119.300 and problem persist.

I'm using dotNet. My OS is Windows 7 SP1 ultimate x64.
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

Topic viewed 5032 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!