Baron-von-Riedesel / JWasm

Masm compatible assembler
107 stars 24 forks source link

Asm causing real-mode compiler to hang #9

Closed VaKonS closed 4 years ago

VaKonS commented 4 years ago

The attached file "e.asm" (errorasm.zip, 2 kb) hangs real-mode version of compiler. Also, JWasm once displayed "internal error in file omfint.c, line 168" message, but I can not get this error anymore, it simply hangs.

The file is currently in compilable form, but if you remove file "dummy.asm" (or make any error in "e.asm"), the compiler will hang.

It also hangs in DosBox (as in safer environment), but only after several launches and if free memory is below ≈600 kb. The attached "a.bat" automatically eats memory and launches JWasmr.exe to reproduce the error (in DosBox the bat needs to be relaunched manually, because its command.com does not support /k switch).

The error only affects real-mode version, therefore it is probably a limitation of low memory, but if you'll decide to look, here it is. And thanks for the program!

VaKonS commented 4 years ago

"DosBox-compatible" variant: asm_hang.zip (334 kb).

1) Run "a.bat", JWasm will compile while there is enough memory, and it will not hang. 2) To produce error, delete "dummy.asm" and run "a.bat". JWasmr.exe will hang.

P.s. Just in case, md5: ab47db2613c4ea40b23041f6777825db errorasm.zip 94b1e0478d6347633ade0ceb3c7df317 asm_hang.zip

Baron-von-Riedesel commented 4 years ago

Thanks, I can reproduce the hang.

It's indeed a malloc/free issue; memory management in the real-mode version differs from the protected-mode versions.

Baron-von-Riedesel commented 4 years ago

should be fixed now.

VaKonS commented 4 years ago

Thank you so much, it works perfectly now!