我已使用以下说明为Windows构建openj9:https://github.com/eclipse/openj9/blob/master/buildenv/Build_Instructions_V8.md#windows
当我尝试以下代码(Visual Studio 2017)时:
J9PortLibraryVersion portver;
J9PORT_SET_VERSION(&portver, J9PORT_CAPABILITY_MASK);
J9PortLibrary *portlib;
int32_t rc = j9port_allocate_library(&portver, &portlib);
if (rc != 0)
{
printf("j9port_allocate_library failed with: %d\n", rc);
return 1;
}
rc = j9port_create_library(portlib, &portver, sizeof(J9PortLibrary));
if (rc != 0)
{
printf("j9port_create_library failed with %d\n", rc);
return 1;
}
rc = j9port_startup_library(portlib);
if (rc != 0)
{
printf("j9port_startup_library failed with %d\n", rc);
return 1;
}
printf("j9port_startup_library: %d\n", rc);
我在j9port_startup_library
:Exception thrown at 0x00007FFF0FC9430A (j9thr29.dll) in sample.exe: 0xC0000005: Access violation reading location 0x0000000000000000.
检查portlib显示portGlobals是NULL
,我认为它不应该是static omrthread_monitor_t
monitor_allocate(omrthread_t self, intptr_t policy, intptr_t policyData)
{
omrthread_monitor_t newMonitor;
omrthread_library_t lib = self->library;
。
当我在调试器外部运行exe时,我看到以下断言(由于某种原因我在调试器中看不到):
** ASSERTION FAILED ** j9prt.504 at common / j9port.c:404 Assert_PRT_true((omrthread_self()!=((void *)0)))
** ASSERTION FAILED ** omrport.0 at ../../omr/port/common/omrport.c:515 Assert_PRT_true((omrthread_self() !=((void *)0)))
我错过了一个步骤或导致此访问冲突的原因吗?
编辑:我使用Visual Studio 2010在Windows 7 x64上重建项目,并在VS2010中运行MCE,VS向我显示我们崩溃了omrthread.c
<a>
答案 0 :(得分:-1)
这是在Eclipse OpenJ9 github项目中提出的:https://github.com/eclipse/openj9/issues/1564
答案是按如下方式初始化端口库:
return io.reactivex.Observable.fromIterable(objects).filter(new Predicate<SomeObject>() {
@Override
public boolean test(SomeObject aObject) throws Exception {
return aObject.isSomething();
}
}).first(aDefaultObject);