Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » ptr
ptr [message #24189] Sun, 03 January 2010 23:48 Go to next message
sapiency is currently offline  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 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Go to previous message
sapiency is currently offline  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

Previous Topic: VectorIndex
Next Topic: crash on exit from XmlView example
Goto Forum:
  


Current Time: Sun Apr 28 15:49:11 CEST 2024

Total time taken to generate the page: 0.05664 seconds