#232 ✓resolved
Agner

yasm crashes when code has many (label1-label2)

Reported by Agner | July 10th, 2011 @ 04:56 PM | in 1.2.0 (closed)

yasm version 1.1.0.2352 crashes when assembling the attached file.
The problem occurs both under Windows and Linux and with different output file formats.

The code has many expressions of the type
mov eax, [esi + label1 - label2]
where label1 and label2 are both in the data section.
The problem disappears when most of the (label1-label2) are replaced by constants.

There is no error when assembling with NASM.

Error report in Windows XP 5.1 SP3:
Error occurred in ntdll.dll at offset 10a19

Error report in Ubuntu:
agf@eit:~/temp$ yasm -felf32 cerror.asm
glibc detected yasm: free(): invalid pointer: 0x00000000006ab024 *** ======= Backtrace: ========= /lib/libc.so.6[0x7f2efd68f0ea] /lib/libc.so.6(cfree+0x8c)[0x7f2efd692c7c] yasm[0x40de2f]
yasm[0x447984]
yasm[0x448094]
yasm[0x4481f4]
yasm[0x43a003]
yasm[0x415050]
yasm[0x445d5d]
yasm[0x439d31]
yasm[0x40edc3]
yasm[0x439ba6]
yasm[0x40ec37]
yasm[0x439678]
yasm[0x4030b6]
yasm[0x403816]
/lib/libc.so.6(__libc_start_main+0xf4)[0x7f2efd6391c4] yasm[0x4017f9]
======= Memory map: ======== 00400000-00495000 r-xp 00000000 08:02 204698 /usr/local/bin/yasm
00695000-00698000 rw-p 00095000 08:02 204698 /usr/local/bin/yasm
00698000-006ba000 rw-p 00698000 00:00 0 [heap]
7f2ef8000000-7f2ef8021000 rw-p 7f2ef8000000 00:00 0
7f2ef8021000-7f2efc000000 ---p 7f2ef8021000 00:00 0
7f2efd40d000-7f2efd41a000 r-xp 00000000 08:02 91719 /lib/libgcc_s.so.1
7f2efd41a000-7f2efd61a000 ---p 0000d000 08:02 91719 /lib/libgcc_s.so.1
7f2efd61a000-7f2efd61b000 rw-p 0000d000 08:02 91719 /lib/libgcc_s.so.1
7f2efd61b000-7f2efd773000 r-xp 00000000 08:02 90828 /lib/libc-2.7.so
7f2efd773000-7f2efd973000 ---p 00158000 08:02 90828 /lib/libc-2.7.so
7f2efd973000-7f2efd976000 r--p 00158000 08:02 90828 /lib/libc-2.7.so
7f2efd976000-7f2efd978000 rw-p 0015b000 08:02 90828 /lib/libc-2.7.so
7f2efd978000-7f2efd97d000 rw-p 7f2efd978000 00:00 0
7f2efd97d000-7f2efd99a000 r-xp 00000000 08:02 89886 /lib/ld-2.7.so
7f2efdb6b000-7f2efdb8e000 rw-p 7f2efdb6b000 00:00 0
7f2efdb95000-7f2efdb9a000 rw-p 7f2efdb95000 00:00 0
7f2efdb9a000-7f2efdb9c000 rw-p 0001d000 08:02 89886 /lib/ld-2.7.so
7fff35c53000-7fff35c68000 rw-p 7ffffffe9000 00:00 0 [stack]
7fff35dd8000-7fff35dda000 r-xp 7fff35dd8000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted

Comments and changes to this ticket

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

Attachments

Pages