gnu arm crash: "%-10.2f", 0.0001

Bug #1845610 reported by Dag Midling Larsen on 2019-09-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain

Bug Description


I've got hardfaults in library __lshift function.
This is experienced using gcc-arm-none-eabi-8-2019-q3-update-win32-sha1.exe and older versions, so this is an old bug.

>>Host machine:
-Lenovo Thinkpad
-Windows 10 Pro Version 1809


Example below triggers crash. When using a debug build, I can step over the first three, but not the fourth.

static void dmlprint(char *pBuf, uint16_t bufSz, const char *format, ...)
    va_list args;
    va_start(args, format);
    int len = vsnprintf(pBuf, bufSz, format, args);

static void dmlStringTest()
    char dmlString[100];

    dmlprint(dmlString, 100, "%-10.2f", 0.0);
    dmlprint(dmlString, 100, "%-10.2f", 0.01);
    dmlprint(dmlString, 100, "%-10.2f", 0.001);
    dmlprint(dmlString, 100, "%-10.2f", 0.0001); //=> Crash
    dmlprint(dmlString, 100, "%-10.2f", 0.00001);
    dmlprint(dmlString, 100, "%-10.2f", 0.000001);
    dmlprint(dmlString, 100, "%-10.2f", 0.0000001);
    dmlprint(dmlString, 100, "%-10.2f", 0.00000001);
    dmlprint(dmlString, 100, "%-10.2f", 0.000000001);
    dmlprint(dmlString, 100, "%-10.2f", 0.0000000001);
    dmlprint(dmlString, 100, "%-10.2f", 0.00000000001);

    int dmlBr;
    dmlBr = 0xdead;

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers