exception in C code

落爺英雄遲暮 提交于 2019-12-10 17:45:49

问题


Wondering what this exception is about?

NTUnhandledExceptionHandler@NTExceptionHandler@@CGJPAU_EXCEPTION_POINTERS@@@Z! jdenet_k.exe?

=====Call stack of thread 5612=====
_LogNTCallStackDump@8! jdel.dll  
?NTUnhandledExceptionHandler@NTExceptionHandler@@CGJPAU_EXCEPTION_POINTERS@@@Z! jdenet_k.exe  
0x78c65b6.<nosymbols>! qstatus.dll  
0x771bd29e.<nosymbols>! ntdll.dll  
0x771bd45f.<nosymbols>! ntdll.dll  

====> Exception C0000005 ACCESS_VIOLATION occurred in thread 5612 with call stack:
_jdeStrcmp@8! jdeunicode.dll  
_IB4210030_SetCrossReferenceItemData@20! CSALES.dll  
_IB4210030_ReconcileSalesOrderLineData@24! CSALES.dll  
_IB4210030_IProcessSalesOrderLine@20! CSALES.dll  
_IB4210030_ProcessNextUnprocessedSalesOrderLine@20! CSALES.dll  
_ProcessNextUnprocessedSalesOrderLine@20! CSALES.dll  
_IB4210900_ProcessUnprocessedLines@12! CSALES.dll  
_IB4210900_PerformSalesOrderAction@32! CSALES.dll  
_SalesOrderApplCtrlEX@12! CSALES.dll  
_jdeCallObjectV2@44! jdekrnl.dll



There is also another related error in one of the log files:

====> Exception C0000005 ACCESS_VIOLATION occurred in thread 5612
call stack dumped in file <E:\JDEdwards\E812\DDP\log\jde_11740_1310990285_1_dmp.log>: iParam: 0000000000
INFO: Entering kernel signal handler, process exiting soon: iParam: 1310990289
INFO: Done setting IPC Handle State structures to abandoned, process exiting immediately: iParam: 1310990289

回答1:


emphasized textIt looks as if the function jdeStrcmp() (stdcall function) in jdeunicode.dll caused an exception (an access violation, in other words, some pointer was bad or nil).

In my opinion, a good DLL won't let an exception escape, but apparently this one did.

Update

Letting an exception escape is usually no problem for a caller that was written in the same language as the DLL. It can be disastrous for a caller that was not. I speak from experience here. The function should of course somehow signal the caller that something happened. How that happens is a matter of design. Letting exceptions escape is certainly the wrong way.

See this SO question too, about exceptions crossing module boundaries. Or this one (same language, different version!). Or google for it. You'll see many reasons and examples of why exceptions crossing module boundaries are a Bad Idea(tm).

One example of a language that can't catch exceptions that escape a (native) DLL is C#, e.g. in this SO question. I assume the same applies to other .NET languages, as well as a score of native languages.




回答2:


Clearly you've got some "JD Edwards" application, which uses the .dll's jdeunicode.dll and jdekrnl.dll. The failure is located in function "JdeStrcmp()", in jdeunicode.dll.

JdeStrcmp() either:

a) has a bug

 ... or ...

b) fails to detect null or illegal arguments

SUGGESTIONS:

  • If your application uses JdeStrcmp() directly, make sure you check for null or illegal string arguments when you're comparing two strings. It would be useful to write test cases for different combinations of 8-bit ASCII and 16-bit Unicode strings while you're at it.

  • If you purchased this J.D. Edwards application and/or development library, contact their technical support. Perhaps they have an update you can install.



来源:https://stackoverflow.com/questions/7181329/exception-in-c-code

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!