V4RB Sockets, Threads and Windows Crashes

Cindy Brown cindy at kowhaiprogramming.com
Wed Mar 31 19:58:35 CST 2004



> On 3/31/04 9:57 AM, "Cindy Brown" <cindy at kowhaiprogramming.com> wrote:
> 
> Hi Cindy,
> 
>> I'm still struggling with the windows version of my server/workstation. I am
>> running a simple test where I create 244 records on my workstation and send
>> them across to the server. Every time it gets to record 211, the server just
>> quits. 
> 
> So crashes YOUR server, but not client, yes?

Firstly it crashes the server. I can then run the server again and it will
keep working for a while before it crashes again. When I then run it to the
second workstation, it crashes the client completely.
> 
>> If I then run it again, the records continue updating but are now
>> corrupted so if I try to bring them across to another workstation the
>> records corrupt the workstations databases. Only happens on Windows. I have
>> created a thread and got the semaphores to work as they should. Everything
>> seems to be working fine. There are no doubles, the server is only
>> collecting one record at a time. In fact, in my test environment there is
>> only one workstation running and therefore the records are only being
> 
> I wonder. You always do tests from remote computer?
> Have you try WIN client to your WIN Server located on the same WIN computer?

I am using a single PC with a server and two clients on it. At the moment I
am only running one client at a time to eliminate any potential problems of
threading, etc. The problem occurs with only one client running every time.
Note, when I initially create the 244 records on the client program, it
creates them with no problems. It is only when I send them across the server
and to another client that the problem occurs.
> 
>> updated to the server one at a time. Yet it crashes every time at record
>> 211. Note, each time I do a test, I run a different set of records so record
>> 211 is different each time so it is not related to the record.
>> 
>> When I run a diagnose database file I get:
>> 
>> ************************************************************************
>> * BaseObject: "sysItem"
>> ************************************************************************
>> Problems found.
>> 
>> -----> Field: "ItemDescrPtr' of type ObjectPtr
>> All right.
>> 
>> -----> Field: "Value' of type VarChar
>> All right.
>> 
>> -----> Field: "TextValue' of type Text
>> Problems found!
>> 
>> (!) Minor problem: exists 1 orphan segments.(indicate mistake in algorithm.)
> 
> Such problem can be result of crash.
> 
> And it show that you have made
>   Text.value = something  // this have put data into BLOB file
> 
> But there was no cursor.Update() call, so they was not fixed.

Unless a varchar field is a blob file, I don't have any BLOB files in any of
my databases, especially not in the one that I am working with which is my
assessments database. So why this error is occurring I have no idea.
> 
> 
> 
>> -----> Field: "ParentPtr' of type ObjectPtr
>> All right.
>> 
>> Have you got any more suggestions (other than going to Valentina Server
>> which I have already explained I don't want to do just yet).
> 
>> When the program quits it quits at the line:
>> 
>> WorkingCursor = app.mdatabase.SQLSelect(s,2,1,2).
>> 
>> It works for the first 210 records and then quits on the 211th record.
>> 
>> I am starting to despair that I will never be able to sort this problem
>> out!!!
> 
> Yes, not easy tasks develop own server.
> 
> Well I can give you next advices:
> 
> 1) do you have LOG of each command that come to server?
> 
> 2) have you set debug level for Valentina in your server app, to see after
> WHICH exactly command crashes Your server?
> 
> 3) have you locate if crash happens inside of Valentina or inside of
> REALbasic code?

I have set the debug level but I have also stepped through the code and the
line WorkingCursor = app.mdatabase.SQLSelect(s,2,1,2) is where the server
eventually just quits but, as mentioned above, it worked for 210 records and
then quits on the 211th record.
> 
> 4) do you have way to simulate the same 214 records adding using just server
> without any clients at all?

Not sure how I would do this as it is only when I am sending across a socket
to the server or from the server to a workstation that the error is
occurring. Creating the 244 records on the client machine is not a problem.
> 
> The main task for you know ISOLATE where and why and on which conditions
> happens crash.
> 
> May be make small LOCAL only project which add the same 214 records.
> Your Server must not differ write.

All the server does is check is the record is to be added, edited or
deleted, create a simple sql query "Select * FROM Assessments WHERE cid =
'fjdskfjsd'". If it finds a record and it is supposed to be added, the
record doesn't get added as it is already there. If it doesn't find the
record it adds it into the database. With the sample I have been working
with, I have only been adding records.
> 
> 5) BTW, only now I have realize that I don't know:
>   do you mean Windows for client or for your server?
>   have you try all combinations mac-mac win-mac, win-win? Mac-win ?

Mac to mac is fine. Win to Mac also seems to be fine. It is when the server
is on a windows machine that the problems occur. This problem is occurring
consistently now but only on the windows machine. The Mac machine using the
same program and the same database is working fine. There is no problem here
with doubling up as it is only adding in one record at a time. The
semaphores are stopping the windows machine from sending more than one item.
I have checked through each step to make sure it is working fine and for 210
records it is perfect and then for number 211 it quits. There is no apparent
difference between record 210 and record 211.

Here are the steps: I have created the records in client 1 and sent them to
the server. Client 2 is not running. It cuts out at record 211. I then run
the server again. It finishes collecting the files with no apparent
problems. I quit client 1 and run client 2. It begins collecting the files
from the server and adds them all in with apparently no problems. Go to
check the database and see my new files, program crashes. When I diagnose
the second client database I get this:

************************************************************************
* BaseObject: "Assessments"
************************************************************************
Problems found.

-----> Field: "cassessid' of type String
Problems found!

(!) Table has 765 physical records but field has 766


-----> Field: "cstuid' of type String
Problems found!

(!) Table has 765 physical records but field has 766


-----> Field: "csubid' of type String
Problems found!

I would appreciate being able to get to the bottom of this as it is driving
me insane.

All the best.

Cindy

> 
> 
> 



More information about the Valentina mailing list