|
本帖最后由 xuhaiyan8825 于 2015-3-11 13:57 编辑
1. 描述
在handle的帧渲染里面,根据pick的点求交,显示交点坐标,普通的handle操作,咋出错了呢
多执行几次pick,大概20次,就报 signal 11异常。
异常记录显示如下地方报错:
(std::vector<osg::Node*, std::allocator<osg::Node*> >::vector(std::vector<osg::Node*, std::allocator<osg::Node*> > const&)
(osgUtil:ineSegmentIntersector::Intersection::Intersection(osgUtil::LineSegmentIntersector::Intersection const&)
(MainViewer:ick(osgGA::GUIEventAdapter const&, EPickEditSelectType, EPickEditHandleType)
(osg::Uniform::setElement(unsigned int, osg::Matrix3Template<float> const&)
(osg::State::updateModelViewAndProjectionMatrixUniforms()
其中 MainViewer::Pick 是我的函数
2. 代码如下:
//创建一个线段交集检测函数
osgUtil::LineSegmentIntersector::Intersections intersections;
unsigned int mask = IntersectionsMask;
osg::Matrix mvpw = getCamera()->getViewMatrix()
* getCamera()->getProjectionMatrix();
if ( getCamera()->getViewport()) {
mvpw.postMult(getCamera()->getViewport()->computeWindowMatrix());
}
osg::Matrix _inverseMVPW;
_inverseMVPW.invert(mvpw);
double hieght = getCamera()->getViewport()->height();
osg::Vec3d nearPoint = osg::Vec3d(ea.getX(), hieght - ea.getY(), 0.0) * _inverseMVPW; //透视投影中Znear平面的交点 //hieght-
osg::Vec3d farPoint = osg::Vec3d(ea.getX(), hieght - ea.getY(), 1.0) * _inverseMVPW; //透视投影中Zfar平面的交点
//求交
osg::ref_ptr<osgUtil::LineSegmentIntersector> picker =
new osgUtil::LineSegmentIntersector(nearPoint, farPoint); //线段(真实的世界坐标)
osgUtil::IntersectionVisitor iv(picker.get());
iv.setTraversalMask(mask);
getCamera()->accept(iv); //模型求交
//viewer->getCamera()->accept(iv);
if (picker->containsIntersections()) {
osgUtil::LineSegmentIntersector::Intersection intersection =
*intersections.begin();
osg::NodePath& nodePath = intersection.nodePath;
tpickPt = osg::Vec3d(intersection.getWorldIntersectPoint());
_updatetext->setText(XUtil3d::Vec32Str(tpickPt));
}
3. 完整异常信息
016: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 68b3d000
546: r0 6c7ebb28 r1 68b3d000 r2 00002824 r3 00000000
546: r4 00000000 r5 00000000 r6 00000000 r7 00000000
546: r8 00000000 r9 6ba3ea84 sl 00000000 fp 00000000
546: ip 00000000 sp 6ba3e44c lr 00000000 pc 4011e1c2 cpsr 200f0030
546: d0 6a0d12b069f5df38 d1 0000000000000000
546: d2 0000000000000000 d3 0000000000000000
546: d4 3fee0d7400000000 d5 bf500000bfee0d74
546: d6 beee0d743e000000 d7 412000003f3c0000
546: d8 40745c0000000000 d9 4084793660000000
546: d10 3eb0c6f7a0b5ed8d d11 0000000000000000
546: d12 0000000000000000 d13 0000000000000000
546: d14 0000000000000000 d15 0000000000000000
546: d16 c1b5057adf54440e d17 40506b5ea3d96000
546: d18 4075fd4945092800 d19 412516bc5a097894
546: d20 8000000000000000 d21 4125173fb4fe975f
546: d22 c0552c720f6801aa d23 3ff0000000000000
546: d24 0000000000000000 d25 3ff0000000000000
546: d26 0000000000000000 d27 0000000000000000
546: d28 0000000000000000 d29 0000000000000000
546: d30 3ff0000000000000 d31 0000000000000000
546: scr 80000018
546: backtrace:
546: #00 pc 000221c2 /system/lib/libc.so (__memcpy_base_aligned+69)
546: #01 pc 003f716d /data/app-lib/com.xmj360.stereo3d-2/libue3d.so (std::vector<osg::Node*, std::allocator<osg::Node*> >::vector(std::vector<osg::Node*, std::allocator<osg::Node*> > const&)+68)
556: #02 pc 003f7361 /data/app-lib/com.xmj360.stereo3d-2/libue3d.so (osgUtil::LineSegmentIntersector::Intersection::Intersection(osgUtil::LineSegmentIntersector::Intersection const&)+14)
556: stack:
556: 6ba3e40c 00000000
556: 6ba3e410 0003f368
556: 6ba3e414 00c29000
556: 6ba3e418 6c7af008
556: 6ba3e41c 4010cf23 /system/lib/libc.so (dlmalloc+4254)
556: 6ba3e420 0003f364
556: 6ba3e424 40145e00 /system/lib/libc.so
556: 6ba3e428 4010be85 /system/lib/libc.so (dlmalloc)
556: 6ba3e42c 0003f364
556: 6ba3e430 6ba3e5ec
556: 6ba3e434 6b918b64 /data/app-lib/com.xmj360.stereo3d-2/libue3d.so
556: 6ba3e438 0000fcd9
556: 6ba3e43c 00000001
556: 6ba3e440 6ba3ea84
556: 6ba3e444 00000000
556: 6ba3e448 00000000
556: #00 6ba3e44c 6ba3e838
556: 6ba3e450 6c7af008
556: 6ba3e454 0000fcd9
556: 6ba3e458 6c7ee36c
556: 6ba3e45c 00000001
556: 6ba3e460 6c7af008
556: 6ba3e464 6b126171 /data/app-lib/com.xmj360.stereo3d-2/libue3d.so (std::vector<osg::Node*, std::allocator<osg::Node*> >::vector(std::vector<osg::Node*, std::allocator<osg::Node*> > const&)+72)
556: #01 6ba3e468 6a109b00
556: 6ba3e46c 6ba3e830
556: 6ba3e470 6ba3e5ec
556: 6ba3e474 685674a0
556: 6ba3e478 00000000
556: 6ba3e47c 6b126365 /data/app-lib/com.xmj360.stereo3d-2/libue3d.so (osgUtil::LineSegmentIntersector::Intersection::Intersection(osgUtil::LineSegmentIntersector::Intersection const&)+18)
556: #02 6ba3e480 00000000
556: 6ba3e484 68567698
556: 6ba3e488 6a0cf740
556: 6ba3e48c 685674a0
556: 6ba3e490 00000000
556: 6ba3e494 6b128df1 /data/app-lib/com.xmj360.stereo3d-2/libue3d.so (MainViewer::Pick(osgGA::GUIEventAdapter const&, EPickEditSelectType, EPickEditHandleType)+272)
556: 6ba3e498 00008f48
556: 6ba3e49c 00000000
556: 6ba3e4a0 6a18ec48
556: 6ba3e4a4 00000000
556: 6ba3e4a8 6ba3e4d4
556: 6ba3e4ac 6b3cf80f /data/app-lib/com.xmj360.stereo3d-2/libue3d.so (osg::Uniform::setElement(unsigned int, osg::Matrix3Template<float> const&)+26)
556: 6ba3e4b0 69ffbcd8
556: 6ba3e4b4 6ba3e578
556: 6ba3e4b8 00000000
556: 6ba3e4bc 6b3b7b5d /data/app-lib/com.xmj360.stereo3d-2/libue3d.so (osg::State::updateModelViewAndProjectionMatrixUniforms()+232)
556: memory near r0:
556: 6c7ebb08 00000000 00000000 00000000 00000000
556: 6c7ebb18 00000000 00000000 00000000 00000000
556: 6c7ebb28 00000000 00000000 00000000 00000000
556: 6c7ebb38 00000000 00000000 00000000 00000000
556: 6c7ebb48 00000000 00000000 00000000 00000000
556: 6c7ebb58 00000000 00000000 00000000 00000000
556: 6c7ebb68 00000000 00000000 00000000 00000000
556: 6c7ebb78 00000000 00000000 00000000 00000000
556: 6c7ebb88 00000000 00000000 00000000 00000000
556: 6c7ebb98 00000000 00000000 00000000 00000000
556: 6c7ebba8 00000000 00000000 00000000 00000000
556: 6c7ebbb8 00000000 00000000 00000000 00000000
556: 6c7ebbc8 00000000 00000000 00000000 00000000
556: 6c7ebbd8 00000000 00000000 00000000 00000000
556: 6c7ebbe8 00000000 00000000 00000000 00000000
556: 6c7ebbf8 00000000 00000000 00000000 00000000
556: memory near r1:
556: 68b3cfe0 00000000 00000000 00000000 00000000
556: 68b3cff0 00000000 00000000 00000000 00000000
556: 68b3d000 00000000 00000000 00000000 00000000
556: 68b3d010 00000000 00000000 00000000 00000000
556: 68b3d020 00000000 00000000 00000000 00000000
556: 68b3d030 00000000 00000000 00000000 00000000
566: 68b3d040 00000000 00000000 00000000 00000000
566: 68b3d050 00000000 00000000 00000000 00000000
566: 68b3d060 00000000 00000000 00000000 00000000
566: 68b3d070 00000000 00000000 00000000 00000000
566: 68b3d080 00000000 00000000 00000000 00000000
566: 68b3d090 00000000 00000000 00000000 00000000
566: 68b3d0a0 00000000 00000000 00000000 00000000
566: 68b3d0b0 00000000 00000000 00000000 00000000
566: 68b3d0c0 00000000 00000000 00000000 00000000
566: 68b3d0d0 00000000 00000000 00000000 00000000
566: memory near r2:
566: 00002804 ffffffff ffffffff ffffffff ffffffff
566: 00002814 ffffffff ffffffff ffffffff ffffffff
566: 00002824 ffffffff ffffffff ffffffff ffffffff
566: 00002834 ffffffff ffffffff ffffffff ffffffff
566: 00002844 ffffffff ffffffff ffffffff ffffffff
566: 00002854 ffffffff ffffffff ffffffff ffffffff
566: 00002864 ffffffff ffffffff ffffffff ffffffff
566: 00002874 ffffffff ffffffff ffffffff ffffffff
566: 00002884 ffffffff ffffffff ffffffff ffffffff
566: 00002894 ffffffff ffffffff ffffffff ffffffff
566: 000028a4 ffffffff ffffffff ffffffff ffffffff
566: 000028b4 ffffffff ffffffff ffffffff ffffffff
566: 000028c4 ffffffff ffffffff ffffffff ffffffff
566: 000028d4 ffffffff ffffffff ffffffff ffffffff
566: 000028e4 ffffffff ffffffff ffffffff ffffffff
566: 000028f4 ffffffff ffffffff ffffffff ffffffff
566: memory near r9:
566: 6ba3ea64 6a119e68 6ba3eb10 4010d30f 40146000
566: 6ba3ea74 6ba3eab8 6ba3eab8 00000a42 00000000
566: 6ba3ea84 6a146428 6a0cbb40 6ba3ea8c 6ba3ea8c
566: 6ba3ea94 6a102310 6a102314 6a102314 6ba3eae0
566: 6ba3eaa4 00000000 00000000 00000000 00000000
566: 6ba3eab4 00000000 00000000 00000000 00000000
566: 6ba3eac4 00000000 00000000 00000000 00000000
566: 6ba3ead4 ffffffff 7fefffff 685674a0 6866ef28
566: 6ba3eae4 6ba3eb10 6866ef20 6865d8b8 6ba3eb24
566: 6ba3eaf4 6b2ba073 62c96de8 6865d8a8 00000000
566: 6ba3eb04 6b12bce1 6ac8d4f8 4186dbd0 6866ef20
566: 6ba3eb14 00000001 00000008 420e2f90 420e49b8
566: 6ba3eb24 4189e127 6866ef20 6acd103f 6b12ebc1
566: 6ba3eb34 6865d8b8 68c47580 4010cf23 71400001
566: 6ba3eb44 00000000 418ff6c8 4014a384 6865d8d0
566: 6ba3eb54 ffffbfff 6865d8d0 418c3919 6865d8a8
566: memory near sp:
566: 6ba3e42c 0003f364 6ba3e5ec 6b918b64 0000fcd9
566: 6ba3e43c 00000001 6ba3ea84 00000000 00000000
566: 6ba3e44c 6ba3e838 6c7af008 0000fcd9 6c7ee36c
566: 6ba3e45c 00000001 6c7af008 6b126171 6a109b00
566: 6ba3e46c 6ba3e830 6ba3e5ec 685674a0 00000000
566: 6ba3e47c 6b126365 00000000 68567698 6a0cf740
566: 6ba3e48c 685674a0 00000000 6b128df1 00008f48
566: 6ba3e49c 00000000 6a18ec48 00000000 6ba3e4d4
566: 6ba3e4ac 6b3cf80f 69ffbcd8 6ba3e578 00000000
566: 6ba3e4bc 6b3b7b5d 00000000 00000000 00000000
566: 6ba3e4cc 00000000 68657f50 3f800000 00000000
566: 6ba3e4dc 00000000 00000000 3f800000 00000000
566: 6ba3e4ec 00000000 00000000 3f800000 00000000
566: 6ba3e4fc 3ff00000 00000000 00000000 00000000
566: 6ba3e50c 00000000 00000000 00000000 00000000
576: 6ba3e51c 00000000 00000000 00000000 00000000
576: code around pc:
576: 4011e1a0 f811bf21 f8114b01 f8005b01 f8004b01
576: 4011e1b0 3a405b01 f891db0b e8b1f100 e8a051f8
576: 4011e1c0 e8b151f8 e8a051f8 3a4051f8 3240daf3
576: 4011e1d0 db043a20 51f8e8b1 51f8e8a0 32203a20
576: 4011e1e0 ea5fd01a bf247c02 c078c978 e8b1bf44
576: 4011e1f0 e8a00180 ea5f0180 bf247c82 3b04f851
576: 4011e200 3b04f840 f831bf44 f8204b02 f0124b02
576: 4011e210 bf1c0f01 7003780b 01f0e8bd 8001e8bd
576: 4011e220 4803b500 44784901 fc50f7f0 000138e4
576: 4011e230 00027e56 e1520003 9a000008 e52de004
576: 4011e240 e59f000c e59f1004 e080000f faffc21e
576: 4011e250 000138fd 00027e47 e1a02001 e3a01000
576: 4011e260 e3520084 8a000016 e92d0001 eee01b10
576: 4011e270 e2522020 3a000003 f2202150 e2522020
576: 4011e280 f400020d 2afffffc e2822020 e3120010
576: 4011e290 0a000000 f4000a0d e1b0ce82 3a000000
576: code around lr:
576: 00000000 ffffffff ffffffff ffffffff ffffffff
576: 00000010 ffffffff ffffffff ffffffff ffffffff
576: 00000020 ffffffff ffffffff ffffffff ffffffff
576: 00000030 ffffffff ffffffff ffffffff ffffffff
576: 00000040 ffffffff ffffffff ffffffff ffffffff
576: 00000050 ffffffff ffffffff ffffffff ffffffff
576: 00000060 ffffffff ffffffff ffffffff ffffffff
576: 00000070 ffffffff ffffffff ffffffff ffffffff
576: 00000080 ffffffff ffffffff ffffffff ffffffff
576: 00000090 ffffffff ffffffff ffffffff ffffffff
576: 000000a0 ffffffff ffffffff ffffffff ffffffff
576: 000000b0 ffffffff ffffffff ffffffff ffffffff
576: 000000c0 ffffffff ffffffff ffffffff ffffffff
576: 000000d0 ffffffff ffffffff ffffffff ffffffff
576: 000000e0 ffffffff ffffffff ffffffff ffffffff
576: 000000f0 ffffffff ffffffff ffffffff ffffffff
576: memory map around fault addr 68b3d000:
576: 68aba000-68b3d000 r-x /system/lib/egl/libGLESv2_tegra.so
576: 68b3d000-68b3e000 ---
576: 68b3e000-68b3f000 r-- /system/lib/egl/libGLESv2_tegra.so |
|