[Xcircuit-dev] Xcircuit Mac Crash

Charles Repetti charlie at sandpiper-inc.com
Wed Mar 28 19:54:44 EDT 2012


Hi Tim,

It looks like the "sprintf" call in "menucalls.c".  Your "cstr[5]" is 
sprintf'd to as "%5d", and this results in six actual characters being 
written (including the null).  But I'm guessing you know that.

I've pasted the code, and the gdb backtrace follows that below.

Standing by if needed,
Charlie

/*--------------------------------------------------------------*/
/* Set the menu checkmarks on the color menu                    */
/*--------------------------------------------------------------*/

void setcolormark(int colorval)
{
    /* Set GUI variables and execute any command tags associated */
    /* with the "color" command */

*char cstr[5]*;
    int i;

    if (colorval != DEFAULTCOLOR) {
       for (i = 0; i < number_colors; i++)
          if (colorlist[i].color.pixel == colorval) {
*sprintf(cstr, "%5d", i);*
             break;
          }
    }

#ifdef TCL_WRAPPER
    XcInternalTagCall(xcinterp, 3, "color", "set", (colorval == 
DEFAULTCOLOR) ?
         "inherit" : cstr);
#endif
}

---------------------------------------------------------------------
(gdb) r
Starting program: 
/sw/src/fink.build/xcircuit-3.7.35-1/xcircuit-3.7.35/xcircexec
Reading symbols for shared libraries .+++++++++.. done
Reading symbols for shared libraries . done
Starting xcircuit under Tcl interpreter
Loaded font file /sw/lib/xcircuit-3.7/fonts/helvetica.lps
Loaded font file /sw/lib/xcircuit-3.7/fonts/times_roman.lps
Loaded font file /sw/lib/xcircuit-3.7/fonts/courier.lps
Loaded font file /sw/lib/xcircuit-3.7/fonts/symbol.lps
Loaded library file /sw/lib/xcircuit-3.7/generic.lps
Loaded library file /sw/lib/xcircuit-3.7/analog.lps
Loaded library file /sw/lib/xcircuit-3.7/avlsi.lps
Loaded library file /sw/lib/xcircuit-3.7/digital.lps
Loaded library file /sw/lib/xcircuit-3.7/digitaltcl.lps
Loaded library file /sw/lib/xcircuit-3.7/analoglib3.lps
%
Program received signal SIGABRT, Aborted.
0x9a539c5a in __kill ()
(gdb) bt
#0  0x9a539c5a in __kill ()
#1  0x9a539c4c in kill$UNIX2003 ()
#2  0x9a5cc5a5 in raise ()
#3  0x9a5e2679 in __abort ()
#4  0x9a5d6d22 in __chk_fail ()
#5  0x9a505a15 in __sprintf_chk ()
#6  0x005afaf0 in setcolormark ()
#7  0x005cca57 in setoptionmenu ()
#8  0x005d09ef in recurse_select_element ()
#9  0x0056c2be in edit ()
#10 0x0056764a in functiondispatch ()
#11 0x00566a9c in eventdispatch ()
#12 0x00568129 in keyhandler ()
#13 0x005fdf26 in xctcl_standardaction ()
#14 0x0011e6d9 in InvokeImportedCmd ()
#15 0x000dc213 in TclEvalObjvInternal ()
#16 0x000dc470 in Tcl_EvalEx ()
#17 0x0000c8b9 in Tk_BindEvent ()
#18 0x000113b2 in TkBindEventProc ()
#19 0x00016718 in Tk_HandleEvent ()
#20 0x00015eec in WindowEventProc ()
#21 0x0012178d in Tcl_ServiceEvent ()
#22 0x0012193e in Tcl_DoOneEvent ()
#23 0x00015ce1 in Tk_MainLoop ()
#24 0x0002208e in Tk_MainEx ()
#25 0x00001ee4 in main ()


On 3/28/12 8:20 AM, Tim Edwards wrote:
> Hello Charlie,
>
>> Thanks for Xcircuit, I use it lots.  Unfortunately the Mac port does 
>> not work in the 3.7.x releases.
>>
>> To see this, open a fink installation of xcircuit 3.7.35 on a mac 
>> 10.6.8. "Netlist->Make pin" on a new blank sheet.  Type some text for 
>> the pin and press enter.  Now hover over the pin and type "e" to 
>> change the text.
>>
>> Crash (Abort trap).
>>
>> This is not the case on Suse linux 10.0/11.2, cygwin/win32(XP), or 
>> cygwin/win64(Win7).
>
> I don't have a Mac.  Is is possible for you to run a debugger on the
> code and trace the source code line that causes the crash?
>
>                         ---Tim
>
> +--------------------------------+-------------------------------------+
> | Dr. R. Timothy Edwards (Tim)   | email: tim at opencircuitdesign.com    |
> | Open Circuit Design, Inc.      | web:   http://opencircuitdesign.com |
> | 22815 Timber Creek Lane        | phone: (301) 528-5030               |
> | Clarksburg, MD 20871-4001      | cell:  (240) 401-0616               |
> +--------------------------------+-------------------------------------+
> _______________________________________________
> Xcircuit-dev mailing list
> Xcircuit-dev at opencircuitdesign.com
> http://www.opencircuitdesign.com/mailman/listinfo/xcircuit-dev

-- 

Charlie Repetti
Senior Engineer
Sandpiper Associates, Inc.
415-515-5985


More information about the Xcircuit-dev mailing list