Overolading the Mac OS X System Log

Discuss any Chipmunk bugs here.
Post Reply
Coopey
Posts: 2
Joined: Sat Dec 08, 2007 10:27 am
Contact:

Overolading the Mac OS X System Log

Post by Coopey »

I downloaded the latest Chipmunk code/demos (v4.0.2), compiled and ran.

First, let me say that I love physics, and I'm amazed.

However, I have found a bug.
When running ChipmunkDemo.app, I noticed my CPU usage was higher then it should be. Activity Monitor pointed out syslogd was using most of the CPU. Force closing it doesnt crash anything, but thats besides the point. I opened up the console viewer, and viewed they system log, which has now grown larger than 50MB. I found a bunch of entries involving the physics:

Code: Select all

...
Dec  8 10:23:49 Coopey [0x0-0x286286].com.yourcompany.main[22786]: Collision at (-249.259, -240.025). (1 - 0) 42
Dec  8 10:23:49 Coopey [0x0-0x286286].com.yourcompany.main[22786]: Collision at (-247.618, -240.344). (1 - 0) 42
Dec  8 10:23:49 Coopey [0x0-0x286286].com.yourcompany.main[22786]: Collision at (-245.883, -241.102). (1 - 0) 42
Dec  8 10:23:49 Coopey [0x0-0x286286].com.yourcompany.main[22786]: Collision at (-249.226, -240.689). (1 - 0) 42
Dec  8 10:23:49 Coopey [0x0-0x286286].com.yourcompany.main[22786]: Collision at (-243.757, -242.273). (1 - 0) 42
Dec  8 10:23:49 Coopey [0x0-0x286286].com.yourcompany.main[22786]: Collision at (-246.974, -241.460). (1 - 0) 42
Dec  8 10:23:49 Coopey [0x0-0x286286].com.yourcompany.main[22786]: Collision at (-241.966, -243.489). (1 - 0) 42
Dec  8 10:23:49 Coopey [0x0-0x286286].com.yourcompany.main[22786]: Collision at (-237.956, -242.797). (1 - 0) 42
Dec  8 10:23:49 Coopey [0x0-0x286286].com.yourcompany.main[22786]: Collision at (-238.795, -242.559). (1 - 0) 42
...
I dont have the time right now to investigate, but I wanted to let everybody know about it.

btw, I'm running leopard - 10.5.1, if that makes a difference.

-Coopey
Coopey
Posts: 2
Joined: Sat Dec 08, 2007 10:27 am
Contact:

Re: Overolading the Mac OS X System Log

Post by Coopey »

Never mind... fixed it.

I did an Xcode search for "Collision at" and it showed a printf. I commented that line and it's all fixed:

Code: Select all

static int
collFunc(cpShape *a, cpShape *b, cpContact *contacts, int numContacts, cpFloat normal_coef, void *data)
{
	int *some_ptr = (int *)data;
	
//	for(int i=0; i<numContacts; i++)
//		printf("Collision at %s. (%d - %d) %d\n", cpvstr(contacts[i].p), a->collision_type, b->collision_type, *some_ptr);
					//commented to keep sys log from filling
	return 1;
}
-Coopey
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Overolading the Mac OS X System Log

Post by slembcke »

Woah. I guess I've always ran it through XCode. I guess that's good to know...
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests