It looks like the program does not recognize line endings in the input file. This code should stop at the end of file or when a '\n' character is found: static int read_line(FILE *f, unsigned char *buf) { int i, j, c; i = j = 0; do { c = fgetc(f); /* add this line: printf("%d\n", c); */ if (c == EOF || c == '\n') break; if (c == '"' && !(i > 0 && buf[i - 1] == (unsigned char) '\\')) j = 1 - j; else if (j) { buf[i] = (unsigned char) c; /* *** here is where the crash happens *** */ ... For some reason, it seems to just keeps reading until the buffer overflows. I do not really know why this happens, though. Two things that may be worth checking: does it still crash when compiled without optimizations (-O0), and do the input files have correct line endings and not e.g. the Mac-style CR-only ones. Also, if you add the printf() line as shown above, what numbers are printed (only the first 150 or so are interesting) ? On Wednesday 07 June 2006 02:44, matt ingalls wrote: > matt$ sudo gdb --args ./makedb strings/all_strings American > GNU gdb 6.1-20040303 (Apple version gdb-434) (Wed Nov 2 17:28:16 GMT > 2005) > Copyright 2004 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and > you are > welcome to change it and/or distribute copies of it under certain > conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for > details. > This GDB was configured as "powerpc-apple-darwin"...Reading symbols > for shared libraries .. done > > (gdb) run > Starting program: /Users/matt/Documents/Csound/csound5/csound5/makedb > strings/all_strings American > Reading symbols for shared libraries . done > > Program received signal EXC_BAD_ACCESS, Could not access memory. > Reason: KERN_INVALID_ADDRESS at address: 0xc0000000 > read_line (f=0xa000db44, buf=0xbffff3c8 ' ' , > "ilength should be greater than kgsize * max up\n", ' ' times>, "pitch shift. Also, igsize_os and igskip_os should\n > remainder of line flushed\n String truncated\n Zero substituted > \n end"...) at strings/makedb.c:43 > 43 buf[i] = (unsigned char) c; > (gdb) backtrace > #0 read_line (f=0xa000db44, buf=0xbffff3c8 ' ' , > "ilength should be greater than kgsize * max up\n", ' ' times>, "pitch shift. Also, igsize_os and igskip_os should\n > remainder of line flushed\n String truncated\n Zero substituted > \n end"...) at strings/makedb.c:43 > #1 0x00002a24 in main (argc=0, argv=0xbffffac4) at strings/makedb.c:150 > > > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel > > _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net