What happens if you also add a line before the call to terminal_init
in main.c like:

printf ("%s:%d %p %p\n", __FILE__, __LINE__, &view_width_p,*view_length_p);

and can you dereference view_{width,length}_p inside terminal_init, or
is this where the problems start?

J'



On Fri, May 09, 2008 at 01:21:40PM -0400, Jason Stover wrote:
     I got tired of trying to get gdb to work, so I started adding
     test code.
     
     On Mac OSX, the terminal version of pspp crashes here, in main.c:
     
     terminal_init (&view_width_p, &view_length_p);
     
     The trouble seems to be here:
     
     void
     terminal_init (int **view_width_p, int **view_length_p)
     {
       printf ("%x\t%x\n", view_width_p, view_length_p)
       *view_width_p = &view_width;
       *view_length_p = &view_length;
       terminal_check_size ();
     }
     
     It shows view_width_p has address 0xfffffff0, and view_length_p
     has address 0xffffffec. 
     
     I tried fixing this by malloc'ing view_width_p and view_length_p
     in main(). Doing so gave the pointers acceptable addresses, but 
     those addresses seem to be overwritten by the time terminal_init()
     is called. The problem is that view_width_p and view_length_p don't
     seem to be referenced anywhere in main() between their declarations
     and the call to terminal_init(). I'm not sure what's going on.
     
     -Jason
     
     
     _______________________________________________
     pspp-dev mailing list
     [email protected]
     http://lists.gnu.org/mailman/listinfo/pspp-dev

-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: signature.asc
Description: Digital signature

_______________________________________________
pspp-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/pspp-dev

Reply via email to