From: <no...@so...> - 2002-05-11 16:31:18
|
Support Requests item #554647, was opened at 2002-05-11 03:45 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=202435&aid=554647&group_id=2435 Category: None Group: None Status: Open Priority: 5 Submitted By: Alan Wilson (wilsona) Assigned to: Nobody/Anonymous (nobody) Summary: Problems with a program Initial Comment: I get the following trying to run a program which I compiled and linked using the make and gcc in the MinGW distribution. (There were no warnings or errors when building, and it produced an exe file.) CHORD caused an invalid page fault in module CRTDLL.DLL at 0167:7fc0dbc5. Registers: EAX=00000000 CS=0167 EIP=7fc0dbc5 EFLGS=00010286 EBX=00550000 SS=016f ESP=0255fca0 EBP=0255fca8 ECX=ffffffff DS=016f ESI=0255fcd8 FS=436f EDX=00002020 ES=016f EDI=00000000 GS=0000 Bytes at CS:EIP: f2 ae f7 d1 2b f9 87 f7 8b c1 c1 e9 02 f3 a5 83 Stack dump: 00000000 819757a0 0255fdd8 00407beb 0255fcd8 00000000 00000000 8193ea28 bff7a3bc 0255fd04 000000b8 8193a3d8 00000010 bff7a3a0 818fd000 8193a3e8 I do not know if this is the correct forum and I realise the program could have problems, but this is a well known program in a standard ansi format and has been built successfully in many other environments. Any suggestions/ideas? ---------------------------------------------------------------------- Comment By: Luke Dunstan (infidel) Date: 2002-05-12 00:31 Message: Logged In: YES user_id=30442 Ah, that line is certainly a bug: if there is no HOME environment variable, getenv() returns a NULL pointer, causing the crash. The simplest way to deal with this would be to set the HOME environment variable (to some directory path) before running the software, but you should report the bug to the developers too (particularly since strcpy is unsafe for this purpose). For future bug reports, it would also be helpful to know the web site where the source code of the software can be downloaded :). Also, you will typically get a faster and more detailed response if you report problems on the mailing list first. ---------------------------------------------------------------------- Comment By: Alan Wilson (wilsona) Date: 2002-05-11 21:44 Message: Logged In: YES user_id=540191 The problem seems to lie with the source line: strcpy (chordrc, getenv ("HOME")); Can anyone explain? ---------------------------------------------------------------------- Comment By: Alan Wilson (wilsona) Date: 2002-05-11 20:43 Message: Logged In: YES user_id=540191 Having downloaded a newer version of MinGW from SourceForge, and rebuilt, I get the following: CHORD caused an invalid page fault in module MSVCRT.DLL at 0167:78001d22. Registers: EAX=0075fc98 CS=0167 EIP=78001d22 EFLGS=00010246 EBX=00550000 SS=016f ESP=0075fc68 EBP=0075fd98 ECX=00000000 DS=016f ESI=8199aa98 FS=6c67 EDX=7efefeff ES=016f EDI=0075fc98 GS=0000 Bytes at CS:EIP: 8b 01 03 d0 83 f0 ff 33 c2 8b 11 83 c1 04 a9 00 Stack dump: 00000000 00407c43 0075fc98 00000000 818fd000 8199a9f0 00000040 00000000 818fd050 818fd00c c140fa60 0075fcb8 bff7a10e bff7a567 818fd000 00000040 As far as compiler flags, etc, all I did to build was use the makefile supplied: # if you are compiling under DOS, you may have to replace all the ".o" extension # by ".obj" # Select the required paper size for your printer #PAPERSIZE = US PAPERSIZE = A4 # If your system does not have a getopt fonction, uncomment the next line GETOPT = getopt.o # Use a ansi or K&R compiler CC = mingw32-gcc CFLAGS = -D$(PAPERSIZE) # where to put the resulting program BINDIR = /develop/gnu/cprogs/chord # where to put the man page MANDIR = /develop/gnu/cprogs/chord MANEXT = l # You should not have to change anything below this line # name of the program PROGRAMS = chord INCL = chord.h getopt.h SRC = common.c xpose.c iso.c chord.c grid.c getopt.c chord.man Makefile OBJ = common.o xpose.o iso.o chord.o grid.o ${GETOPT} SONGS = songs/space-oddity songs/heaven songs/everybody- hurts DOCS = README chord_guide.ps license.txt RELNAME = chord35 all: $(PROGRAMS) chord : $(OBJ) Makefile $(CC) $(CFLAGS) -o $@ $(OBJ) chord.o : chord.h common.o : chord.h grid.o : chord.h xpose.o : chord.h getopt.o : getopt.h install : all cp $(PROGRAMS) $(BINDIR) rm -f $(MANDIR)/cat$(MANEXT)/chord.$(MANEXT) cp chord.man $(MANDIR)/man$(MANEXT)/chord.$(MANEXT) chmod 666 $(MANDIR)/man$(MANEXT)/chord.$(MANEXT) shar : $(SRC) shar -F -L 60 -o $(RELNAME).part $(SRC) $(INCL) $(SONGS) $(DOCS) tar : $(SRC) tar cvf $(RELNAME).tar $(SRC) $(INCL) $(SONGS) $(DOCS) compress $(RELNAME).tar lint : $(SRC) lint $(SRC) clean: rm -f core *.o chord If I should be trying to get support elsewhere please let me know, I do not want to waste valuable development effort. I just feel that it is important that a 'standard' source distribution should compile and link with as few mods as possible for this environment. Alan ---------------------------------------------------------------------- Comment By: Alan Wilson (wilsona) Date: 2002-05-11 20:42 Message: Logged In: YES user_id=540191 Having downloaded a newer version of MinGW from SourceForge, and rebuilt, I get the following: CHORD caused an invalid page fault in module MSVCRT.DLL at 0167:78001d22. Registers: EAX=0075fc98 CS=0167 EIP=78001d22 EFLGS=00010246 EBX=00550000 SS=016f ESP=0075fc68 EBP=0075fd98 ECX=00000000 DS=016f ESI=8199aa98 FS=6c67 EDX=7efefeff ES=016f EDI=0075fc98 GS=0000 Bytes at CS:EIP: 8b 01 03 d0 83 f0 ff 33 c2 8b 11 83 c1 04 a9 00 Stack dump: 00000000 00407c43 0075fc98 00000000 818fd000 8199a9f0 00000040 00000000 818fd050 818fd00c c140fa60 0075fcb8 bff7a10e bff7a567 818fd000 00000040 As far as compiler flags, etc, all I did to build was use the makefile supplied: # if you are compiling under DOS, you may have to replace all the ".o" extension # by ".obj" # Select the required paper size for your printer #PAPERSIZE = US PAPERSIZE = A4 # If your system does not have a getopt fonction, uncomment the next line GETOPT = getopt.o # Use a ansi or K&R compiler CC = mingw32-gcc CFLAGS = -D$(PAPERSIZE) # where to put the resulting program BINDIR = /develop/gnu/cprogs/chord # where to put the man page MANDIR = /develop/gnu/cprogs/chord MANEXT = l # You should not have to change anything below this line # name of the program PROGRAMS = chord INCL = chord.h getopt.h SRC = common.c xpose.c iso.c chord.c grid.c getopt.c chord.man Makefile OBJ = common.o xpose.o iso.o chord.o grid.o ${GETOPT} SONGS = songs/space-oddity songs/heaven songs/everybody- hurts DOCS = README chord_guide.ps license.txt RELNAME = chord35 all: $(PROGRAMS) chord : $(OBJ) Makefile $(CC) $(CFLAGS) -o $@ $(OBJ) chord.o : chord.h common.o : chord.h grid.o : chord.h xpose.o : chord.h getopt.o : getopt.h install : all cp $(PROGRAMS) $(BINDIR) rm -f $(MANDIR)/cat$(MANEXT)/chord.$(MANEXT) cp chord.man $(MANDIR)/man$(MANEXT)/chord.$(MANEXT) chmod 666 $(MANDIR)/man$(MANEXT)/chord.$(MANEXT) shar : $(SRC) shar -F -L 60 -o $(RELNAME).part $(SRC) $(INCL) $(SONGS) $(DOCS) tar : $(SRC) tar cvf $(RELNAME).tar $(SRC) $(INCL) $(SONGS) $(DOCS) compress $(RELNAME).tar lint : $(SRC) lint $(SRC) clean: rm -f core *.o chord If I should be trying to get support elsewhere please let me know, I do not want to waste valuable development effort. I just feel that it is important that a 'standard' source distribution should compile and link with as few mods as possible for this environment. Alan ---------------------------------------------------------------------- Comment By: Luke Dunstan (infidel) Date: 2002-05-11 13:37 Message: Logged In: YES user_id=30442 If your program is linked to crtdll.dll (instead of msvcrt.dll), you must be using either a very old or unofficial version of Mingw. Try downloading the latest packages of gcc, binutils, mingw-runtime and w32api and try again. Please note that the Mingw 1.0.1 advertised on the www.mingw.org page is quite old, and the main page has not been updated in some time. If this does not fix the problem, you need to submit some source code that reproduces the problem, and the commands used to compile it. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=202435&aid=554647&group_id=2435 |