#84 ✓resolved
Peter Johnson

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

Reported by Peter Johnson | June 25th, 2011 @ 07:49 PM

Originally posted on Trac by dnegrescu@hotmail.com
Original Trac Ticket

  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).

Trac Attachments

h3. Trac Comments
comment:1

              Changed 5 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 5 years ago by dnegrescu@hotmail.com


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 5 years ago by peter


(In [1659]) Fix #86 by requiring '-' (e.g. "yasm -") to read from stdin, and reporting
an error if no files are specified .
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").

      comment:3

                  Changed 5 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 .
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").

      Status
        changed from new to closed
    
      Resolution
        set to fixed

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Yasm Modular Assembler Project

Shared Ticket Bins

People watching this ticket

Tags

Pages