Program exits with signal 11 (SIGSEGV).

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Jul 21 13:36:58 CDT 2003


on 7/21/03 12:50, Matthew Jew at mjew at icnc.com wrote:

Hi Matthew,

1) please note, I do not know Obj-C absolutly, but I will learn with you :-)

2) I again have CC this to Valentina list.
BTW, I have made Totte, and Eric Forget, but at least 2-3 more good experts
of Obj-C present here. One of them, Arthur Clemens, have made latest example
for Obj-C.

So guys, I offer you make small community and help each other resolve any PB
projects. Okay?

3) Matthew, what exactly line exists ?


> Ruslan,
> 
> Another Cocoa question.
> 
> This routine causes the program to exit with signal 11 (SIGSEGV).
> 
> - (void) writeGroupListToDB
> {
>    ValentinaDatabase * _database = [[ValentinaDatabase alloc] init];
> NewsgroupTable * aNewsgroupTable;
> long i;
> GroupInfoRec *baseRecPtr;
> GroupInfoRec *aRecPtr;
> char *baseStringPtr;
> char *groupName;
> 
> printf("Started writeGroupListToDB\n");
> 
> [_database  
> createDatabaseWithFileName:@"/Volumes/Beta2/ValentinaDBs/
> SampleNewsgroupListDB"];
> printf("Created DB\n");
> 
> aNewsgroupTable = [_database databaseDefinition]->getNewsgroupTable();
> printf("Get Table pointer\n");
> 
>    aNewsgroupTable->SetBlank();
> printf("Set Blank\n");
> 
> baseRecPtr = (GroupInfoRec *) [groupInfo mutableBytes];
> baseStringPtr = (char *) [stringPool mutableBytes];
> 
> aRecPtr = baseRecPtr;
> for ( i = 0; i < groupsInList; i++ )
> {
> groupName = baseStringPtr + aRecPtr->nameOffset;
> 
> [_database databaseDefinition]->getNewsgroupTable()->mfNewsgroupName
> = groupName;
> [_database  
> databaseDefinition]->getNewsgroupTable()->mfNewsgroupNumber =
> aRecPtr->groupNumber;
> 
> [_database databaseDefinition]->getNewsgroupTable()->AddRecord();
> 
> ++aRecPtr;    // Pointer math
> }
> printf("Done adding\n");
> [_database databaseDefinition]->getNewsgroupTable()->Flush();
> printf("Database flushed\n");
> [_database close];
> printf("Database closed\n");
>    [_database release];
> printf("Database released\n");
> }
> 
> - Matthew

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list