Status: closed
Owner: nobody
Labels: None
Updated: 2012-03-24
Created: 2012-03-23
Creator: Shane Saxon
Private: No
JJ,
oh... that makes sense ;)
going to put this on sourceforge Tickets...
thanks for the help... this actually points to a conceptual conflict in
the architecture...
the npPostMessage () serves the same purpose as printf()
all printf() statements will be updated to use npPostMessag()
added benefit is that it can print to the GUI console and a log file...
log file not yet implemented (but soon)
kNPmessageType... determines where displayed
in general nearly every msg goes to the OS system console and log
subset of messages to the user GUI console
the data Map' is initialized first then 'IO' then 'Control'
however, when cams are setup, they call a 'ctrl' command which calls
the IO method to post a message... (this should not be allowed)
a few problems here:
- Map init should not call any ctrl commands
(ctrl is after Map and IO and is allows to call anything...)
- npPostMessage needs to be initialized before everything
(which is what you did!)
i think i will make messages a member of the data->map
though they are an IO function... will need to carefully look at the code...
also perhaps add a safety catch to 'ctrl' that rejects any calls before both
data map and IO is fully initialized.
cheers,
Shane
On Mar 23, 2012, at 8:18 AM, JJ wrote:
that is there, and the place i put the init call is just to get things running again, but the npPostMessage is being called
but you can probably see it yourself by adding the print below (for me, this prints a large negative number... which is why it crashes on startup),
the call to the uninitialized message comes here in npctrl.c, that npPostMessage is being called before the iomessage is initialized
case kNPgraphCamera :
...lots of code...
sprintf(msg, "%scamera id: %d", msgPart, node->id);
npPostMessage (msg, kNPmessageTypeCtrl, dataRef);
break;
void npPostMessage (char message, int type, void dataRef)
{
pData data = (pData) dataRef;
//add handling for type filtering, perhaps create a msg struct with type, debug zz
data->io.message.queIndex++;
printf("npPostMessage, queueIndex is %d\n", data->io.message.queIndex);
if (data->io.message.queIndex >= kNPmessageQueMax)
{
On Thu, Mar 22, 2012 at 10:19 PM, <shane wrote:
i thought i fixed this by adding npInitMessage() to npInitDataIO()
does this not show up?
if npInitDataIO() calling npInitMessage() stills results in the memory violation
then please let me know and i will hunt things down more carefully!
thanks again,
Shane
On Mar 22, 2012, at 9:55 PM, JJ wrote:
unrelated to 2010, ran across it earlier, change in an area I really don't know much about
but in any case, the change truly is necessary, and will randomly strike different people, its just uninitialized memory... there is something that is depending on that npInitMessage being called, if its not called, and that queIndex happens to be negative you get a crash, positive randomness is handled without a problem... here's the relevant section in npdata.c, the two lines marked "JJ"
void npInitDataIO (int argc, char argv, void dataRef);
void npInitDataCtrl (void dataRef);
void npInitMessage (void* dataRef); // JJ
//------------------------------------------------------------------------------
void npInitData (int argc, char* argv)
{
// allocate memory for the global 'data' structure
pData data = (pData) malloc (sizeof(Data));
if (data == NULL)
{
printf ("err 4213 - malloc failed cannot run app \n");
return NULL;
}
printf ("Starting...\n");
// initialize data
npInitMessage(data); //JJ
npInitDataMap (data);
On Thu, Mar 22, 2012 at 8:56 PM, wrote:
JJ,
allright... i think i should consider testing on VS2010
while officially we are on 2008... a lot of developers have moved to 2010 by now
i appreciate the help
cheers,
Shane
On Mar 22, 2012, at 8:50 PM, JJ wrote:
tried release clean/build, get immediate crash into assembly language, no freeglut error anymore
the one i have that works is release... will let you know what i find
On Thu, Mar 22, 2012 at 8:16 PM, wrote:
JJ,
thats strange, really note sure...
currently the freeglut.dll is in the same folder as the app...
(if you are in debug mode, try release and/or copy the .dll's from release to debug.)
the library is in the project folder and should be same version as the DLL (unless i mixed things up...)
since i don't see the problem, i wonder if it is somehow a VS2010 thing?
let me know..
cheers,
Shane
On Mar 22, 2012, at 7:26 PM, JJ wrote:
new version downloaded zip, clean, build, no problem
run it, it says i need to get or re-install freeglut.dll
When i use previous version, clean build, run, there is no mention of freeglut.dll missing, and everything runs...
Any idea what that means?
Is there some manual step to get it to know about freeglut.dll? I don't remember doing anything with that before, I do have freeglut.dll in the zip and my directories, but for some reason its not recognized at run time
Discussion
Shane Saxon
Shane Saxon
2012-03-23
summary: ACrash on startup --> Crash on App Startup - ANTz_2012_03_19
Reply
Link
Edit
Delete
Spam
Attach
Shane Saxon
Shane Saxon
2012-03-24
status: accepted --> closed