Re: big orbit problem.



um,  here is all the code up to the resulting corruption. I dont see
anything that would corrupt memory like you said. and besides, the value
is being change at CORBA_string_dup and not before.

  FILE *temphndl;
  CORBA_char buffer[1024];
  CORBA_char variable[256];
  CORBA_char *tempptr;
  CORBA_char **tempptr2;
  int count;
  CosNaming_NamingContext ns_root;
  CosNaming_NameComponent name_component[2] = {{"COAL", "subcontext"}, 
                                               {"default", "object"} };
  CosNaming_Name name = {2, 2, name_component, CORBA_FALSE};
  blade_env *blade=(blade_env*)malloc(sizeof(blade_env));
  blade->ev=(CORBA_Environment*)malloc(sizeof(CORBA_Environment));
  CORBA_exception_init(blade->ev);
  blade->orb = CORBA_ORB_init(argc, argv, "orbit-local-orb", blade->ev);
  blade->corba_env=blade_environment__alloc();
  if(context==NULL||!strcmp(context, "")){
    blade->corba_env->web_context=CORBA_string_dup("default");

Boom. If you can show me where the corruption is, great. But, I dont see
anything in the code that would do that.

On Thu, 11 Nov 1999, Havoc Pennington wrote:

> 
> On Thu, 11 Nov 1999 bob@cs.csoft.net wrote:
> > 
> > CORBA_string_dup is somehow doing something to the memory around it.
> > *argc before is 1 like it should be, and
> > after, argc is NULL. This is bad. Very BAD.
> > It is odd that it doesnt segfault the program flat out.
> > 
> > This is not the first time I have seen CORBA_string_dup do this.
> > 
> 
> It isn't CORBA_string_dup, and it's not odd that the program doesn't
> segfault. What you have here is random memory corruption; it happens to
> write over argc. Because argc is valid memory, you get no segfault.
> 
> So, you need to find what part of your program is screwing up memory it
> isn't supposed to touch.
> 
> Havoc
> 
> 



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