From: Marko K. <mar...@gm...> - 2011-07-12 08:37:11
|
Hi all, I was able to successfully build SBCL from git on Win7x64 using 32 bit mingw compiler. I used one of the Kovalenko builds for bootstraping. The problem is that sbcl.exe fails to run if SBCL_HOME is not set. Here's the except from the gdb session: c:\development\cvstree>gdb sbcl GNU gdb (GDB) 7.2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "mingw32". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from c:\opt\sbcl\bin/sbcl.exe...done. (gdb) run Starting program: c:\opt\sbcl\bin/sbcl.exe [New Thread 5396.0x177c] [New Thread 5396.0x16b0] Program received signal SIGSEGV, Segmentation fault. 0x75df43f9 in strlen () from C:\Windows\syswow64\msvcrt.dll (gdb) bt #0 0x75df43f9 in strlen () from C:\Windows\syswow64\msvcrt.dll #1 0x0040be98 in copied_string (argc=1, argv=0x772f90, envp=0x771b88) at runtime.c:120 #2 main (argc=1, argv=0x772f90, envp=0x771b88) at runtime.c:547 (gdb) If SBCL_HOME is set, I'm able to successfully run SBCL. The question is why the downloaded SBCL works ok even without SBCL_HOME, while locally built SBCL segfaults? Note that "sbcl --help" works ok, it fails when I try to start a repl. Regards, Marko Kocić |
From: David L. <da...@li...> - 2011-07-12 10:22:18
|
Quoting Marko Koci?? (mar...@gm...): > Program received signal SIGSEGV, Segmentation fault. > 0x75df43f9 in strlen () from C:\Windows\syswow64\msvcrt.dll > (gdb) bt > #0 0x75df43f9 in strlen () from C:\Windows\syswow64\msvcrt.dll > #1 0x0040be98 in copied_string (argc=1, argv=0x772f90, envp=0x771b88) > at runtime.c:120 > #2 main (argc=1, argv=0x772f90, envp=0x771b88) at runtime.c:547 > (gdb) I can't reproduce this error on my systems (SBCL 1.0.49.81-75b4335; Wine and Vista 32 bit). Based on the stacktrace I would have thought it likely that stat() on your Windows fails to notice that the statically configured SBCL_HOME/sbcl.core does not exist, resulting in a null pointer being used later. Can you verify that, e.g. by adding debugging output to copied_existing_filename_or_null? > If SBCL_HOME is set, I'm able to successfully run SBCL. > The question is why the downloaded SBCL works ok even without > SBCL_HOME, while locally built SBCL segfaults? > Note that "sbcl --help" works ok, it fails when I try to start a repl. SBCL is expected to fail with an error message if SBCL_HOME (the environment variable) is unset, and the statically configured SBCL_HOME preprocessor macro doesn't point to a directory with a core file either. It's a bug if it segfaults instead of calling lose() with a clear error. The msi installers set the SBCL_HOME environment variable automatically for the user. d. |
From: Marko K. <mar...@gm...> - 2011-07-12 11:14:16
|
Thanks for the info. I was able to find what was the problem. The problem was that when SBCL_HOME is not present, sbcl assumes that core is located in the same dir as exe file (logical assumption for windows platform). sh install.sh on windows is copying sbcl.exe and sbcl.core in different folders. If I manually copy sbcl.exe to the same folder where sbcl.core is and start is from there, it works correctly. Problem with segfault is that after searching for core there is no null checking if valid core is detected. In runtime.c around line 540 after this snipped: if (!core) { core = search_for_core(); } There should be another check, since search_for_core can return 0 if stat fails, and error message in case of error. Regards, Marko Kocić On Tue, Jul 12, 2011 at 12:20 PM, David Lichteblau <da...@li...> wrote: > Quoting Marko Koci?? (mar...@gm...): >> Program received signal SIGSEGV, Segmentation fault. >> 0x75df43f9 in strlen () from C:\Windows\syswow64\msvcrt.dll >> (gdb) bt >> #0 0x75df43f9 in strlen () from C:\Windows\syswow64\msvcrt.dll >> #1 0x0040be98 in copied_string (argc=1, argv=0x772f90, envp=0x771b88) >> at runtime.c:120 >> #2 main (argc=1, argv=0x772f90, envp=0x771b88) at runtime.c:547 >> (gdb) > > I can't reproduce this error on my systems (SBCL 1.0.49.81-75b4335; Wine > and Vista 32 bit). > > Based on the stacktrace I would have thought it likely that stat() on > your Windows fails to notice that the statically configured > SBCL_HOME/sbcl.core does not exist, resulting in a null pointer being > used later. Can you verify that, e.g. by adding debugging output to > copied_existing_filename_or_null? > >> If SBCL_HOME is set, I'm able to successfully run SBCL. >> The question is why the downloaded SBCL works ok even without >> SBCL_HOME, while locally built SBCL segfaults? >> Note that "sbcl --help" works ok, it fails when I try to start a repl. > > SBCL is expected to fail with an error message if SBCL_HOME (the > environment variable) is unset, and the statically configured SBCL_HOME > preprocessor macro doesn't point to a directory with a core file either. > > It's a bug if it segfaults instead of calling lose() with a clear error. > > The msi installers set the SBCL_HOME environment variable automatically > for the user. > > d. > |
From: David L. <da...@li...> - 2011-07-12 13:45:13
|
Quoting Marko Koci?? (mar...@gm...): > I was able to find what was the problem. > The problem was that when SBCL_HOME is not present, sbcl assumes that > core is located in the same dir as exe file (logical assumption for > windows platform). > sh install.sh on windows is copying sbcl.exe and sbcl.core in different folders. > If I manually copy sbcl.exe to the same folder where sbcl.core is and > start is from there, it works correctly. [...] Quick summary after off-list discussion: - The bug is on one of the Windows branches, not on master. - But changes similar to the ones that Nikodemus proposed to remove SBCL_HOME would obviously make things easier for Windows users, too. d. |
From: Marko K. <mar...@gm...> - 2011-07-12 13:59:14
|
On Tue, Jul 12, 2011 at 3:43 PM, David Lichteblau <da...@li...> wrote: > > Quick summary after off-list discussion: > > - The bug is on one of the Windows branches, not on master. Yes, and Anton alerady commited the fix for segfault in his git tree. > - But changes similar to the ones that Nikodemus proposed to remove > SBCL_HOME would obviously make things easier for Windows users, too. Yes. > d. Regards, Marko |