On Wednesday 27 November 2002 8:14 pm, John Levon wrote: > #6 0x40414114 in chunk_realloc (ar_ptr=0x404b4680, oldp=0x8418c04, > oldsize=4294967292, nb=16) at malloc.c:3390 #7 0x40413dc1 in > __libc_realloc (oldmem=0x8418c0c, bytes=7) at malloc.c:3286 #8 0x400d400d > in fl_set_object_label (ob=0x841cad0, label=0x841cb3c "Cancel") at > objects.c:579 #9 0x081f0102 in GuiBC<flobjs_, flobjs_>::refresh() > (this=0x841cb00) at > ../../../src/frontends/controllers/ButtonController.tmpl:53 #10 0x0826f2f1 > in ButtonControllerBase::readOnly(bool) (this=0x841cb00, ro=false) at > ButtonControllerBase.C:96 #11 0x08278b52 in > ControlDialog<ControlConnectBD>::show() (this=0x8421828) at > ControlDialog.tmpl:46 #12 0x0827e928 in ControlMath::showDaughter(void*) > (this=0x8421828, key=0x8419458) at ControlMath.h:91 > > xforms is trying to realloc, but the old text was from a string literal, so > you cannot free it. At least, that's what it looks like to me. > > Angus ?
Can't see nothing wrong with this... void fl_set_object_label(FL_OBJECT * ob, const char *label) { ... if (!label) label = ""; ... ob->label = fl_realloc(ob->label, strlen(label) + 1); strcpy(ob->label, label); } However, in your backtrace can I draw your attention to "oldsize" in item 6 #6 0x40414114 in chunk_realloc (ar_ptr=0x404b4680, oldp=0x8418c04, oldsize=4294967292, nb=16) at malloc.c:3390 what does std::cerr << static_cast<unsigned int>(-1) << std::endl; give on your machine?