swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swarm-Support] problem solved, but one more question


From: Yifeng Zhang
Subject: [Swarm-Support] problem solved, but one more question
Date: Wed, 12 Jan 2005 07:45:04 -0800 (PST)

Hi everyone:
 
I solved the problem that I posted to this list yesterday. But I am not sure if it's my mistake or a bug in swarm. The problem was that I didn't have a +createBegin method for a subclass who has a member variable. Only the superclass (the Intermediary class) has the +createBegin method. I solved the problem by moving the member variable from the subclass to the superclass. I guess I can solve the problem by add a +createBegin method for all subclass too, instead of moving the member variable. I'll try that.
 
Thanks,
 
Yifeng

Yifeng Zhang <address@hidden> wrote:
Hi everyone:
 
I've been using Swarm for sometime. However I hit a problem that I couldn't solve recently. I hope that somebody here can help me with it. I am running Swarm-2.2 the latest release under Windows XP. My program crashes and the crash seems to be related to malloc. I am sure that it's not because of insufficient memory. First here's the error message that I got from gdb:
 
Program received signal SIGSEGV, Segmentation fault.
0x0040131d in +[Intermediary createBegin:] (self=0x411440, _cmd=0x411f48,
    aZone=0x107430a8) at intermediary.m:14
 
The crash happens at this statement:
 
obj->last_update_time = SSC_START_UPDATE_TIME;
 
where obj is of type Intermediary*, last_update_time is of type int, and SSC_START_UPDATE_TIME is a constant.
 
Using gdb I also found the memory for obj->last_update_time is not accessible. The reason that I think the crash is related to malloc is that at the time of crashing, I got the following stack from insight:
 
...
+[Intermediary createBegin:]
malloc
 
Also, my program used to crash at some malloc statements written by myself. Then I tried xmalloc, allocBlock. Still the program crashed at these statements. I thought I would avoid the problem by not using dynamic memory allocation and used static arrays instead. But, apparently, the prolem is still there. By the way, my Intermediary class contains a lot of member variables, maybe 50 of them. Does that matter?
 
Any help will be appreciated. Lots of thanks in advance.
 
Yifeng
 
 
 
 
 



Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search. Learn more._______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]