Fossil

View Ticket
Login

View Ticket

2012-11-30
16:39 Fixed ticket [8ca2aae3]: Command-line wildcards broken with Fossil 1.24 on Windows, in some cases crashing Fossil (1.23 was OK) plus 1 other change ... (artifact: 4a44e41e user: drh)
2012-11-18
22:33 Ticket [10aee063] Fossil didn't support for UTF8 to storage filenames. status still Open with 3 other changes ... (artifact: 00132fc6 user: jan.nijtmans)
2012-11-04
21:36 Ticket [8ca2aae3] Command-line wildcards broken with Fossil 1.24 on Windows, in some cases crashing Fossil (1.23 was OK) status still Open with 1 other change ... (artifact: 7f0f162d user: drh)
21:04 Ticket [8ca2aae3]: 1 change ... (artifact: 62fe1e29 user: jan.nijtmans)
2012-11-03
15:19 Ticket [8ca2aae3]: 1 change ... (artifact: 71dfc027 user: drh)
14:30 Ticket [8ca2aae3]: 1 change ... (artifact: 3ea7c8cd user: anonymous)
12:47 Ticket [8ca2aae3]: 1 change ... (artifact: c63d251a user: drh)
11:21 Ticket [8ca2aae3]: 1 change ... (artifact: 9612c7d9 user: jan.nijtmans)
2012-11-02
21:46 Ticket [8ca2aae3]: 2 changes ... (artifact: 68a18127 user: drh)
21:45
Only use the Tcl-derived argv/argc parser when compiling on windows using a compiler other than mingw. The crt0 for mingw works, and it also does wildcard expansion. Need to update the parse_windows_command_line() function to do wildcard expansion in order to fix builds using non-mingw windows compilers. Ticket [8ca2aae39172f9] ... (check-in: fca9c526 user: drh tags: trunk)
21:20
Fix a segfault that occurs with the "fossil md5sum" command when files named on the command-line do not actually exist. Ticket [8ca2aae39172f90c]. ... (check-in: 52199a50 user: drh tags: trunk)
19:11 Ticket [8ca2aae3] Command-line wildcards broken with Fossil 1.24 on Windows, in some cases crashing Fossil (1.23 was OK) status still Open with 2 other changes ... (artifact: c9234c65 user: anonymous)
19:09 New ticket [8ca2aae3]. ... (artifact: 13a1f822 user: anonymous)

Ticket Hash: 8ca2aae39172f90c314256deda71e006cb2f38bf
Title: Command-line wildcards broken with Fossil 1.24 on Windows, in some cases crashing Fossil (1.23 was OK)
Status: Fixed Type: Code_Defect
Severity: Important Priority:
Subsystem: Resolution: Fixed
Last Modified: 2012-11-30 16:39:29
Version Found In: 1.24
Description:
There appears to be a regression introduced with Fossil 1.24 on Windows regarding command-line wildcard parsing.

Fossil 1.23 behaves as expected: > fossil-123 md5sum common\* 2a9d384b95db916a22cc05b7227ab55b common\fileutils.cpp eb7ae4d4d206c73079faa4bfb4d737ca common\fileutils.h

However, under 1.24: > fossil md5sum common\* Assertion failed: (p)->xRealloc==blobReallocMalloc || (p)->xRealloc==blobReallocStatic, file ./src/blob.c, line 273

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

Wildcards also fail, but less spectacularly, with other Fossil commands:

Fossil 1.24: >fossil add gui\forms.* fossil: not found: C:/Projects/InkSpector2/src/gui/forms.*

Fossil 1.23: >fossil-123 add gui\forms.* ADDED src/gui/forms.cpp ADDED src/gui/forms.h

Thanks Mark.


drh added on 2012-11-02 21:46:52 UTC:
Working now for MinGW. Need to fix the parse_windows_command_line() function to do wildcard expansion in order to fix the problem for non-mingw windows compilers.


jan.nijtmans added on 2012-11-03 11:21:18 UTC:
Note: Mingw is the only toolset which does command line expansion in crt0, mingw-w64 and msvc do not. It is really a problem of the Windows console: Shells are supposed to do their own command line expansion. Cygwin and Msys do that, but the Windows console does not do that. Therefore the mingw people decided to build it into crt0, but it makes mingw incompatible with msvc.

Unfortunately, mingw doesn't have an unicode-aware crt0, that would solve everything. Mingw-w64 and msvc have it, but those don't do command line expansion.

I would recommend to build command line expansion into fossil. It would make command line expansion available to mingw-w64 and msvc builds on the Windows console as well. The risk is that when using Msys or Cygwin, the command line expansion is done twice, I don't know exactly what possible problems that could give.

So, the easiest workaround would be: use the Msys or Cygwin or any other shell, just not the Windows console.


drh added on 2012-11-03 12:47:01 UTC:
Maybe the right thing to do is add a new "fossil glob CMD ARG1 ARG2 ...." command. The glob command applies file globing to all arguments, then runs CMD with the globed arguments. This is similar to how the "glob" command worked in very early Unix systems, before globing got built into the shell.

Unix, Msys, and cygwin shells would continue to operate normally. Users on a windows shell, however, would need to add the "glob" keyword if they want globing to occur in their command.


anonymous added on 2012-11-03 14:30:05 UTC:
Hi,

I'm not sure if it's been mentioned before, but msvc does support expanding command-line wildcards into separate argv strings: http://msdn.microsoft.com/en-us/library/8bch7bkk%28v=vs.80%29.aspx

Mark.


jan.nijtmans added on 2012-11-04 21:04:47 UTC:
Regarding the assertion:

However, under 1.24: > fossil md5sum common\* Assertion failed: (p)->xRealloc==blobReallocMalloc || (p)->xRealloc==blobReallocStatic, file ./src/blob.c, line 273
Shouldn't fossil be compiled without assertions, so with -DNDEBUG? That should fix the mentioned crash.

drh added on 2012-11-04 21:36:42 UTC:
The "fossil md5sum" segfault has already been fix by check-in [52199a504a9c7c20].

I think we want to continue to run with assert()s enabled. This gives better visibility to mistaken assumptions in the code.