epics-base / pvDataCPP

pvDataCPP is an EPICS V4 C++ module
https://epics-base.github.io/pvDataCPP/
Other
6 stars 16 forks source link

`isctype.c(68) : Assertion failed: c >= -1 && c <= 255` #81

Open mdavidsaver opened 1 year ago

mdavidsaver commented 1 year ago

I noticed that one of the appveyor runs triggering an assertion failure in printer.cpp. The MS documentation is clear enough:

The behavior of isprint and _isprint_l is undefined if c isn't EOF or in the range 0 through 0xFF, inclusive. When a debug CRT l>ibrary is used and c isn't one of these values, the functions raise an assertion.

https://ci.appveyor.com/project/epics-base-7/epics-base/builds/45492554/job/5tauw07hyhd8qn22

f:\dd\vctools\crt_bld\self_x86\crt\src\isctype.c(68) : Assertion failed: c >= -1 && c <= 255
Dumping a stack trace of thread 'win440':
[  74F35CF5]: c:\projects\epics-base\modules\libcom\src\osi\os\win32\osdbacktrace.cpp[line 23](epicsBackTrace+0x25)
[  74F35A25]: c:\projects\epics-base\modules\libcom\src\osi\epicsstacktrace.c[line 80](epicsStackTrace+0x85)
[  74F26EF4]: c:\projects\epics-base\modules\libcom\src\misc\epicsunittest.c[line 94](testReportHook+0x34)
[  7495E942](_VCrtDbgReportW+0x5c2)
[  74955CF4](_CrtDbgReportW+0x74)
[  74955CAD](_CrtDbgReportW+0x2d)
[  748F586C](_chvalidator+0x2c)
[  748F3C6A](isprint+0x1a)
[  74AB01B5]: c:\projects\epics-base\modules\pvdata\src\factory\printer.cpp[line 500](epics::pvData::operator<<+0xf5)
[  74AB0541]: c:\projects\epics-base\modules\pvdata\src\factory\printer.cpp[line 544](epics::pvData::operator<<+0x121)
[  74A5D502]: c:\projects\epics-base\modules\pvdata\src\factory\pvdatacreatefactory.cpp[line 147](epics::pvData::PVString::dumpValue+0x32)
[  74A50B67]: c:\projects\epics-base\modules\pvdata\src\factory\pvfield.cpp[line 94](epics::pvData::operator<<+0x17)
[  74A59CE2]: c:\projects\epics-base\modules\pvdata\src\factory\pvunion.cpp[line 191](epics::pvData::PVUnion::dumpValue+0x272)
[  74A50B67]: c:\projects\epics-base\modules\pvdata\src\factory\pvfield.cpp[line 94](epics::pvData::operator<<+0x17)
[  74A52F9E]: c:\projects\epics-base\modules\pvdata\src\factory\pvstructure.cpp[line 321](epics::pvData::PVStructure::dumpValue+0x2be)
[  74A50B67]: c:\projects\epics-base\modules\pvdata\src\factory\pvfield.cpp[line 94](epics::pvData::operator<<+0x17)
[  74A60076]: c:\projects\epics-base\modules\pvdata\src\factory\pvdatacreatefactory.cpp[line 778](std::operator<<+0x16)
[  00D64389]: c:\program files (x86)\microsoft visual studio 11.0\vc\include\memory[line 816](std::operator<<<char,std::char_traits<char>,epics::pvData::PVStructure>+0x19)
[  00D624D5]: c:\projects\epics-base\modules\pvdata\testapp\misc\testjson.cpp[line 175](`anonymous namespace'::testInto+0x525)
[  00D63285]: c:\projects\epics-base\modules\pvdata\testapp\misc\testjson.cpp[line 285](main+0x75)
[  00D72249]: f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c[line 536](__tmainCRTStartup+0x199)
[  00D7238D]: f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c[line 377](mainCRTStartup+0xd)
[  755A6A14](BaseThreadInitThunk+0x24)
[  77A8AD8F](RtlInitializeExceptionChain+0x8f)
[  77A8AD5A](RtlInitializeExceptionChain+0x5a)
f:\dd\vctools\crt_bld\self_x86\crt\src\isctype.c(56) : Assertion failed: c >= -1 && c <= 255
Dumping a stack trace of thread 'win440':

This is pointing to

https://github.com/epics-base/pvDataCPP/blob/45671faaea4d091523350f6c111193ef0d103aa6/src/factory/printer.cpp#L485 ... https://github.com/epics-base/pvDataCPP/blob/45671faaea4d091523350f6c111193ef0d103aa6/src/factory/printer.cpp#L500

mdavidsaver commented 1 year ago

Should be fixed with 0b424a71ec5fa7095304c160c757daf2d06781c1