Program exits with signal 11 (SIGSEGV).
aclemens at xs4all.nl
aclemens at xs4all.nl
Tue Jul 22 11:01:35 CDT 2003
I am just checking my mail from my holiday address, and see this thread. I
think I can give you some help.
The database is located inside the bundle folder. In the Finder, select
the demo app, right click and choose Show contents.
So with the method createDatabaseWithFileName you should not use an
absolute path, but a name only. The method will create the database inside
the bundle. Otherwise change the commands inside
createDatabaseWithFileName.
You are using
ValentinaDatabase * _database
inside writeGroupListToDB, while _database is an already defined data
member of the class. By putting
ValentinaDatabase *
you will create a local variable, that is released at the end of the
method. Calling a delete in -dealloc will give you an error.
Instead just use
_database = [[ValentinaDatabase alloc] init];
Arthur
>
> On Monday, July 21, 2003, at 03:36 AM, Ruslan Zasukhin wrote:
>
>> 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 :-)
>>
>
> Ruslan,
>
> My apologies for bothering you by sending mail only to you directly.
> I will send my questions to the list and related people from now on.
>
>> 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?
>>
>
> That would be wonderful, if others are willing.
>
>> 3) Matthew, what exactly line exists ?
>>
>
> Actually, the signal 11 (SIGSEGV) happens at the very end, on the
>
> [_database release];
>
> I also neglected to mention another issue: I cannot find the DB files
> anywhere on disk! This is also true of the Cocoa Demo; I cannot locate
> the "ExampleDB" that it creates, even while the program is running
> (I thought maybe it deleted it upon exit). Am I missing something
> obvious?
>
> - Matthew
>
>
>>>
>>
>>> 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
>> -------------------------------------------------------------
>>
>
>
mt: 0624 192097
hp: http://www.xs4all.nl/~aclemens/
More information about the Valentina
mailing list