#86 (Yasm.exe hangs with command line that specifies a quoted include path with trailing backslash) – The Yasm Modular Assembler Project
Modify

Ticket #86 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Yasm.exe hangs with command line that specifies a quoted include path with trailing backslash

Reported by: dnegrescu@… Owned by:
Priority: P1 Milestone:
Component: Misc Version: 0.5.0
Severity: normal Keywords:
Cc:

Description

The following command line makes the assembler to act like when it is started without any parameters:

yasm -i "C:\Dev\ASM\YASM\Inc\" test.asm

but the following ones don’t:

yasm -i "C:\Dev\ASM\YASM\Inc" test.asm

yasm -i C:\Dev\ASM\YASM\Inc\ test.asm

Tested with version 0.5.0 and r1657 on Windows XP (32bit). The input file is not relevant (any file will do).

Attachments

Change History

comment:1 Changed 4 years ago by mu

How exactly are you launching it with those command lines? CMD's command line parsing follows rules I'm not sure any of us mortals can understand. It's possible that the first is being interpreted as -i 'C:\Dev\ASM\YASM\Inc" test.asm'. Perhaps see what a tool like Process Explorer claims the command line is to the first one.

comment:2 Changed 4 years ago by dnegrescu@…

Actually the Process Explorer shows the command line as entered. I did a little bit of debugging on this and it appears that the command line parsing done by the MS C runtime initialization code (preparing the argv and argc params) is doing some weird stuff with double quotes and backslashes and the final result is that the include path and the file name are “merged” together as one string. The end result is that the yasm command line parser will not see the input file name and will switch to read from the stdin, which gives the impression that it hanged.

While I understand that this is not Yasm’s fault, it would be nice to have a better handling of invalid command line parameters.

comment:3 Changed 4 years ago by peter

  • Status changed from new to closed
  • Resolution set to fixed

(In [1659]) Fix #86 by requiring '-' (e.g. "yasm -") to read from stdin, and reporting an error if no files are specified (instead of defaulting to stdin). While the old behavior mimiced GNU AS, the new behavior is far more common amongst typical compilers (e.g. GCC), including NASM.

While I'm here, add support for '--' (e.g. "yasm -- -f").

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.