Home » U++ Library support » U++ Core » ptr
ptr [message #24189] |
Sun, 03 January 2010 23:48  |
sapiency
Messages: 56 Registered: September 2008
|
Member |
|
|
hi,
I attached an example with Ptr/Pte. I looked at the code (Ptr.h),
but could not find the reason why it crashes.
"segmentation fault"
Does I expect too much from Ptr?
regards
reinhard
ps: coded and tested on linux ...
|
|
|
Re: ptr [message #24190 is a reply to message #24189] |
Mon, 04 January 2010 00:38   |
|
Hi Reinhard,
The problem is not in Ptr. It is in your toString() methods. JPerson::toString() calls NPerson::toString() which calls JPerson::toString etc., creating infinite loop. Over 58200 times on my machine, before something went wrong (overflow?) and it threw segmentation fault.
Best regards,
Honza
|
|
|
Re: ptr [message #24201 is a reply to message #24190] |
Mon, 04 January 2010 15:32  |
sapiency
Messages: 56 Registered: September 2008
|
Member |
|
|
Hi,
thanks ... the example runs after removing this stupid bug. In my real application I still had another problem, which is solved now.
I simple forgot to include the headerfile of JPerson in the source file of NPerson. It compiled without any warning, but crashed at runtime.
But now it works ...
thanks and a Happy New Year!
Reinhard
[Updated on: Mon, 04 January 2010 15:32] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Apr 30 01:50:27 CEST 2025
Total time taken to generate the page: 0.03733 seconds
|