How do I track down a coredump in my new widget 
Author Message
 How do I track down a coredump in my new widget

I have been working on a new widget for perl/Tk (a pgplot widget for the
pgplot graphics library). As there already existed a pgplot driver for
Tcl/Tk, I have taken that driver and "perlified" the C code. Version 1
work on both Solaris and Linux. Version 2 (with only a few minor changes
to fix a few bugs) works well on Linux but coredumps under Solaris when
parsing the passed arguments. I cannot work out what to do.
Basically the C based command to create the data structures of the
widget is called, but I get a segfault when I try and access the "args"
data field:
int PgplotCmd(ClientData context, Tcl_Interp *interp, int argc,
Arg *args)
Tk_Window main_tkw = (Tk_Window)context; /* The application
main window */
TkPgplot *tkpg; /* The new widget
instance object */
* Make sure that a name for the new widget has been provided.
#ifdef DODEBUG
{int i;
printf(" Args(%d):\n", argc);
for (i=0; i<argc; i++)
printf(" %d %p %s\n", i, args[i], LangString(args[1]));
//printf(" %d\n", i);

I can print out the pointed addres OK, but LangString causes the
The traceback from the core file is:
#0 0xef688244 in _libc_kill ()
(gdb) backtrace
#0 0xef688244 in _libc_kill ()
#1 0xef63a608 in abort ()
#2 0xef4a6ce8 in InterpHv ()
#3 0xef4a6d1c in FindXv ()
#4 0xef4a6f68 in FindAv ()
#5 0xef4a6fb0 in ResultAv ()
#6 0xef4a82e8 in Tcl_ResetResult ()
#7 0xef4a9e08 in SetTclResult ()
#8 0xef4af008 in Lang_CallWithArgs ()
#9 0xef42a594 in PgplotCmd (context=0x212b28, interp=0x2153a0, argc=4,
args=0x20a80c) at ../pgplot.source/drivers/ptk/ptkpgplot.c:371
#10 0xef4aaab0 in Call_Tk ()
#11 0xef4acf9c in XSTkCommand ()
#12 0xef429f24 in XS_Tk_pgplot (cv=0x13e040) at Pgplot.xs:30
#13 0x5f4c8 in Perl_pp_entersub ()
#14 0x98a30 in Perl_runops_standard ()
#15 0x20ff8 in perl_run ()
#16 0x1eb54 in main ()
Any hints on how to track this down?
Chris Phillips

reply. I only have news access through

Sent via http://www.*-*-*.com/
Before you buy.

Sun, 08 Sep 2002 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. New Win32-style Drop-down Listbox widget

2. Tracking down a memory-eating bug

3. Tracking down a bug

4. tracking down memory leak

5. tracking down a memory leak in 5.005_03

6. URGENT: Tracking down a spammer!!

7. Tracking down Stray Modules and Versions?

8. Tracking down core dumps in Perl/Tk

9. Memory Fault(coredump) using Text Widget

10. keeping track of widgets

11. Error tracking reccommendations for new OO module

12. Updating a widget slows down process...


Powered by phpBB® Forum Software