P4021 Causes CO Kernel Crash

Purpose of Document

Information Center: Overview of JD Edwards EnterpriseOne Requirements Planning > Information Center: Troubleshooting JD Edwards EnterpriseOne Requirements Planning > Note 839807.1

Call Object Kernel gets crashed in clicking find button through P4021 - Supply and Demand Inquiry for a specific item.

Error detail:

Call Stack in AS400 reads as below,

Level Program Library Module Statement Procedure

0 JDELIB E812SYS JDEDEBUG jdelogCallStack
1 JDENET E812SYS NETSIG 0000000002Stack krnlCatchall
2 JDEUNICODE E812SYS JDEUNICODE 0000000006ll jdeStrcpy
3 CMFG PD812 B3400310 0000000043ll I3400310_SpreadQuantityAndWriteToCache
4 CMFG PD812 B3400310 0000000082preadQuantityAndWriteToCache I3400310_GetAndSelectRatesSequentially
5 CMFG PD812 B3400310 0000000051etAndSelectRatesSequentially I3400310_GetAndSelectRates
6 CMFG PD812 B3400310 0000000151etAndSelectRates LoadSupplyAndDemandData
7 JDEKRNL E812SYS JDEOBJ 0000001477AndDemandData jdeCallObjectV2
8 JDEKRNL E812SYS JDEOBJ 0000000001ectV2 jdeCallObject
9 JDEKRNL E812SYS JDEKNOBJ 0000000253ect JDEK_ProcessCallRequest
10 JDEKRNL E812SYS JDEKNOBJ 0000000071ssCallRequest JDEK_StartCallRequest
11 JDEKRNL E812SYS JDEKDISP 0000000006CallRequest runBusinessFunction
12 JDEKRNL E812SYS JDEKDISP 0000000003sFunction runCallObjectJob
13 JDEKRNL E812SYS JDEKDISP 0000000201ectJob JDEK_DispatchCallObjectMessage
14 XMLCALLOBJ E812SYS XMLCALLOBJ 0000000059tchCallObjectMessage XMLCallObjectDispatch
15 JDENET E812SYS NETFLOW 0000000083ectDispatch callDispatchFunction
16 JDENET E812SYS NETFLOW 0000000028chFunction kernelMsgThread
17 JDENET E812SYS NETFLOW 0000000001hread processKernelQueueMsg
18 JDENET E812SYS NETQUEUE 0000000038nelQueueMsg processKernelQueue
19 JDENET E812SYS NETPUB 0000000041nelQueue JDENET_RunKernel
20 JDENET_K E812SYS JDENET_K 0000000016Kernel main
21 JDENET_K E812SYS JDENET_K _C_pep
22 QP0ZPCPN QSYS QP0ZPCPN 0000000210Kernel InvokeTargetPgm__FP11qp0z_pcp_cb
23 QP0ZPCPN QSYS QP0ZPCPN 0000000266etPgm__FP11qp0z_pcp_cb Qp0zNewProcess
24 QP0ZPCP2 QSYS QP0ZPCP2 _CXX_PEP__Fv

--- Cause ---

*** Break In Code ***

idReturnCode = I3400310_F0007GetWorkDayCalendar1470(lpDS, lpdsB3400310Internal,&nMonth, &nYear, cDaysArray);
if (idReturnCode == ER_SUCCESS)
{
/* Weekly Schedule, Daily spread */
if (lpds4801t->cMonthWeekDayHour == _J('2'))
{
/*See if necessary to read next month calendar record */
if (lpdsB3400310Internal->dsF4801Columns.wadrqj.nMonth != lpdsB3400310Internal->dsF4801Columns.wastrt.nMonth)
{
jdeStrcpy(cDaysArray1, cDaysArray);
nMonth = lpdsB3400310Internal->dsF4801Columns.wadrqj.nMonth;
nYear = lpdsB3400310Internal->dsF4801Columns.wadrqj.nYear;
idReturnCode = I3400310_F0007GetWorkDayCalendar1470(lpDS, lpdsB3400310Internal,&nMonth, &nYear, cDaysArray);
jdeStrcpy(cDaysArray2, cDaysArray);
jdeStrcpy(cDaysArray, cDaysArray1);
}

*** Break In code ***
Issue is coming in dereferencing cDaysArray from 2nd calling when the days defined is 31 days.

as it the string array cDaysArray is defined as below,

/* copy first 32 cTypeOfDay fields into Days array */
memcpy(&cDaysArray[1], &ds3000710.cTypeOfDayReturned01, (sizeof(JCHAR) * 31));

: cDaysArray[] can store upto 31 characters. If 1 chracter is allocated for NULL Character, it can store up to 30, so if a certain month has 31 days not all data may be stored.

As a result,

jdeStrcpy(cDaysArray2, cDaysArray);

may contribute to a system crash.

Issue may be resolved by setting as below:

memcpy(&cDaysArray[0], &ds3000710.cTypeOfDayReturned01, (sizeof(JCHAR) * 31));

Set Array Index starts with 0 to hold 32 characters in the array cDaysArray[]

<Internal_Only> <Bug:11019910> not able to duplicate.
</Internal_Only>