Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEGV in error handling of command line parameters #128

Open
srowe opened this issue Mar 24, 2022 · 0 comments
Open

SEGV in error handling of command line parameters #128

srowe opened this issue Mar 24, 2022 · 0 comments

Comments

@srowe
Copy link

srowe commented Mar 24, 2022

Trying to define a macro on the command line as follows:

dasm firmware.asm -ofirmware.bin -DFW_VERSION=1.aa -f3 -S -sfirmware.sym

results in:

Program received signal SIGSEGV, Segmentation fault.
asmerr (err=6, bAbort=false, sText=0x7fffffffddf4 "1.aa") at main.c:1578
1578    main.c: No such file or directory.
(gdb) where
#0  asmerr (err=6, bAbort=false, sText=0x7fffffffddf4 "1.aa") at main.c:1578
#1  0x0000000000409fac in eval (str=0x7fffffffddf8 "", wantmode=0) at exp.c:575
#2  0x0000000000407dca in v_set (str=0x7fffffffddf4 "1.aa", dummy=0x0) at ops.c:1232
#3  0x0000000000401fa8 in MainShadow (ac=7, av=0x7fffffffd948, pbTableSort=0x7fffffffd84b) at main.c:490
#4  0x0000000000404cde in main (ac=7, av=0x7fffffffd948) at main.c:1747

This seems to be as a result of bStopAtEnd being NULL

(gdb) print err
$1 = 6
(gdb) print bStopAtEnd
$2 = (_Bool *) 0x0

it is malloc()after command line arguments are processed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant