(OK) cBPM(段错误(吐核))—((EndWorkflowEvent*)evt)->getProcessID()—getenv 返NULL
2016-03-31 20:53
447 查看
★★★★★上面的问题——解决了:
--------> /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/events/WorkflowListener.cpp
注释掉两行:(取消注释,会出现上面问题,有待解决)
else if ( evt->getName() == "EndWorkflowEvent" )
{
CM_TRACE_CODEPATH( "Event Received:[EndWorkflowEvent]")
//processID = ((EndWorkflowEvent*)evt)->getProcessID();
//sEvent = "COMPLETED";
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
http://forums.codeblocks.org/index.php?topic=10575.5;wap2
★★★★★ ( getenv 返回值为 NULL )
--------> /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/engine/Workflow.cpp
CM_TRACE_CODEPATH( "Deleting TaskAction Object.")
delete taskAction;
设置断点
--------> /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/events/WorkflowListener.cpp
processID = ((EndWorkflowEvent*)evt)->getProcessID();
设置断点
调用
--------> /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/events/BaseWorkflowEvent.cpp
return _WF->getProcess()->getProcessId();
设置断点
调用
--------> /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/engine/Workflow.cpp
WorkflowProcesses::WorkflowProcess* Workflow::getProcess()
设置断点
{
return process;
}
--------> /opt/cBPM/criteria-lin/include/WorkflowEngine/Workflow.h
WorkflowProcesses::WorkflowProcess* process;
★★★★★上面的问题——终于解决了:( getenv 返回值为 NULL )(Program works from commandline, but not from codeblocks)
http://forums.codeblocks.org/index.php?topic=10575.5;wap2
resander:
I inserted the following three calls at the start of connectSrv routine (see a previous post on this thread):
char * odbcini = getenv ( "ODBCINI" ) ;
char * oraclehome = getenv ( "ORACLE_HOME" ) ;
char * ldlibrarypath = getenv ( "LD_LIBRARY_PATH" ) ;
char * getenv (const char *name)
returns a string that is the value of the environment variable name.
If the environment variable name is not defined, the value is a null pointer.
Starting codeblocks from Application menu
The odbcini and oraclehome variables are NULL after the getenv calls. This means they are not available for my program, which fails finding the ODBC driver and other library dependencies. The ldlibrarypath variable is .:, which is wrong.
Starting codeblocks from my HOME /home/ken and commandline as /usr/bin/codeblocks
Works.
Wikipedia says this about environment:
'In all Unix and Unix-like systems, each process has its own private set of environment variables. By default, when a process is created it inherits a duplicate environment of its parent process, except for explicit changes made by the parent when it creates the child. At API level, these changes must be done between fork and exec.'
When I start codeblocks from the commandline my environment is inherited by codeblocks. Then if codeblocks starts my-prog by exec/fork the environment would be passed on again, which is what my-prog needs.
There is a predefined program variable extern char ** environ; which is an array of property strings in the environment. When starting codeblocks from the Application menu I put these to the screen with printf and could see the environment was different from mine.
- there are fewer properties, especially the important ODBCINI,
ORACLE_HOME are missing
- LD_LIBRARY_PATH is .: which is different from my ldlibpath
- PWD is set to /home/ken/Projects/lsken2 my PWD is /home/ken
- HOME is /home/ken for both (can be used to chdir $HOME before starting
codeblocks from menu)
-------------------------
-------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++
resander:
I inserted the following three calls at the start of connectSrv routine (see a previous post on this thread):
char * odbcini = getenv ( "ODBCINI" ) ;
char * oraclehome = getenv ( "ORACLE_HOME" ) ;
char * ldlibrarypath = getenv ( "LD_LIBRARY_PATH" ) ;
char * getenv (const char *name)
returns a string that is the value of the environment variable name.
If the environment variable name is not defined, the value is a null pointer.
Starting codeblocks from Application menu
The odbcini and oraclehome variables are NULL after the getenv calls. This means they are not available for my program, which fails finding the ODBC driver and other library dependencies. The ldlibrarypath variable is .:, which is wrong.
Starting codeblocks from my HOME /home/ken and commandline as /usr/bin/codeblocks
Works.
Wikipedia says this about environment:
'In all Unix and Unix-like systems, each process has its own private set of environment variables. By default, when a process is created it inherits a duplicate environment of its parent process, except for explicit changes made by the parent when it creates
the child. At API level, these changes must be done between fork and exec.'
When I start codeblocks from the commandline my environment is inherited by codeblocks. Then if codeblocks starts my-prog by exec/fork the environment would be passed on again, which is what my-prog needs.
There is a predefined program variable extern char ** environ; which is an array of property strings in the environment. When starting codeblocks from the Application menu I put these to the screen with printf and could see the environment was different from
mine.
- there are fewer properties, especially the important ODBCINI,
ORACLE_HOME are missing
- LD_LIBRARY_PATH is .: which is different from my ldlibpath
- PWD is set to /home/ken/Projects/lsken2 my PWD is /home/ken
- HOME is /home/ken for both (can be used to chdir $HOME before starting
codeblocks from menu)
相关文章推荐
- I.MX6 PMU MMPF0100 driver porting
- 修改npm下载模块的安装位置
- MSM平台RPM
- MSM平台RPM
- rpm卸载命令
- PMAC上位机编程
- 如果做好测试PM【转载】
- APM启动流程及ArduPilot函数入口
- Head First PMP – 14 – 职业道德(Professional Responsibility)
- 利用 Behavior Driven Development 技术加强软件自动化测试
- 以叫车软件为例,说一下高阶产品经理都是怎么分析问题的
- yum使用总结
- 产品经理应该竖立的工作态度(自勉)
- 进程管理,及性能监控 ps, pstree, pidof, top, htop, pmap, vmstat, dstat
- (OK) cBPM(段错误(吐核))—((EndWorkflowEvent*)evt)->getProcessID()—getenv 返NULL
- 研发产品经理培训什么?(摘抄)
- 利用JBPM4.4的AssignmentHandler实现用户角色整合另一种构思
- error C2146: syntax error : missing ';' before identifier 'lpMenu'
- 本地录制视频和MPMoviePlayerController播放本地视频
- 《人人都是产品经理》读书笔记