From: David Stockton Newsgroups: comp.os.msdos.djgpp Subject: Help interpreting a stack trace Date: Wed, 23 Apr 1997 09:02:49 -0500 Organization: Baylor College of Medicine, Houston, Tx Lines: 53 Message-ID: <335E1689.766D@bcm.tmc.edu> NNTP-Posting-Host: ginger.imgen.bcm.tmc.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I am working on a library of routines and a small test program (about 30 lines; the call a routine, print a message type) dies with the following stack trace. Since it dies in a standard library routine I was not sure how to track it down. Note also that if I change the declaration of selects timeout argument to static the GPF goes away. Am I running out of stack space? Any help would be much appreciated. Thanks, David The calling code looks like this... struct timeval timeout; fd_set dsmask; int n, fd; timeout.tv_sec = 1; timeout.tv_usec = 0; FD_ZERO( &dsmask ); FD_SET( fd, &dsmask ); printf( "Calling select( %d, %#x, NULL, NULL, %#x )\n", fd+1, (unsigned int) &dsmask, (unsigned int) &timeout ); fflush( stdout ); n = select( fd+1, &dsmask,(fd_set *) NULL, (fd_set *) NULL, &timeout ); And here is what gets written to the screen (after symify)... Calling select( 8, 0x58b98, NULL, NULL, 0x58b90 ) Exiting due to signal SIGSEGV General Protection Fault at eip=00010002 eax=00000000 ebx=000176b4 ecx=0000ff5f edx=00010054 esi=000007cd edi=0000ff10 ebp=00057dc0 esp=00057dc0 program=C:\OBJ\TEST3.EXE cs: sel=00f7 base=82ceb000 limit=0006ffff ds: sel=00ff base=82ceb000 limit=0006ffff es: sel=00ff base=82ceb000 limit=0006ffff fs: sel=011f base=82d5c000 limit=00010000 gs: sel=010f base=00000000 limit=ffffffff ss: sel=00ff base=82ceb000 limit=0006ffff Call frame traceback EIPs: 0x00010002 ___crlf2nl+290 0x000100bc ___crlf2nl+476 0x00010d86 ___crlf2nl+3750 0x00010e82 ___tzset+222 0x00010dc0 ___tzset+28 0x00010eae ___tzset+266 0x000114a3 _ctime+551 0x0001161d _ctime+929 0x00011732 _mktime+18 0x0000f5a8 ___gettimeofday+168 0x0000a64e _select+114 bash$ symify obj/test3.exe