Moddable-OpenSource / moddable

Tools for developers to create truly open IoT products using standard JavaScript on low cost microcontrollers.
http://www.moddable.com
1.34k stars 236 forks source link

AddressSanitizer: FPE on unknown address 0x000000773e98 #735

Closed eternalsakura closed 2 years ago

eternalsakura commented 2 years ago

Build environment

description

AddressSanitizer:DEADLYSIGNAL
=================================================================
==1941769==ERROR: AddressSanitizer: FPE on unknown address 0x000000773e98 (pc 0x000000773e98 bp 0x7ffd3c245b70 sp 0x7ffd3c245440 T0)
    #0 0x773e98 in fxRunID /home/sakura/moddable/xs/sources/xsRun.c:3395:27
    #1 0x78f93f in fxRunScript /home/sakura/moddable/xs/sources/xsRun.c:4752:4
    #2 0x909474 in fxRunProgramFile /home/sakura/moddable/xs/tools/xst.c:1387:2
    #3 0x909474 in main /home/sakura/moddable/xs/tools/xst.c:281:8
    #4 0x7f83acdd00b2 in __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308:16
    #5 0x42e69d in _start (/home/sakura/moddable/build/bin/lin/release/xst+0x42e69d)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE /home/sakura/moddable/xs/sources/xsRun.c:3395:27 in fxRunID
==1941769==ABORTING
phoddie commented 2 years ago

Nice find -- thank you!

The simplest way to reproduce this issue appears to be:

let t = (-2147483648 | 0) % -1;

This is a variation of a similar issue fixed a few days ago.