This Help forum is for issues relates to the latest release (1.7.2). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."
  • Page:
  • 1
  • 2

TOPIC:

'Relationship to me' 5 years 8 months ago #21

  • klausthaler
  • klausthaler's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 108

File Attachment:

File Name: clipping.ged.txt
File Size:6 KB

Now I learned about the 'show' switch (thanks), inserted the var_dump and uploaded the 3-person GEDCOM (Peter Thaler's wife came with the family)

@Jackie: I think we should concentrate on the attached GEDCOM.
Klaus

klausthaler.de/familie
webtrees 1.7.18, Apache/2.4.43 (SunOS 5.10), PHP 7.3.27, MySQL 5.5.52
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by klausthaler.

'Relationship to me' 5 years 8 months ago #22

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
I imported this tree on my own server. The relationship between I70 and I87 (father/daughter) is calculated correctly.

The "var_dump($graph)" which is showing on your server is also correct. It is simply a list of the links between individuals and families.

So, we are all using the same data and the same code - yet it works for everyone except you.

I cannot think what might cause this. Do you have other servers available? Do you see the same problem on any other server?
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 8 months ago #23

  • klausthaler
  • klausthaler's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 108
yes, I have my Windows notebook, where I tested the very code which I uploaded last week.

It works here. And works much better than ever! A 22 person distance in 1 second, that was impossible before.

I also crosschecked with uploading the Dijkstra code anew on the sever - to no effect.

It really gets interesting here. I will try to understand the code. The server runs on Sun Solaris - could big-endian make the difference?
Klaus

klausthaler.de/familie
webtrees 1.7.18, Apache/2.4.43 (SunOS 5.10), PHP 7.3.27, MySQL 5.5.52

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 8 months ago #24

  • exxamalte
  • exxamalte's Avatar
  • Visitor
  • Visitor

yes, I have my Windows notebook, where I tested the very code which I uploaded last week.
...
It really gets interesting here. I will try to understand the code. The server runs on Sun Solaris - could big-endian make the difference?


Possibly, or there is some other difference in behaviour in PHP on Solaris Sparc.
It may make sense to add a few debug statements here and there in the Dijkstra code and then compare on your Windows vs. Solaris systems where things go awry.

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 8 months ago #25

  • klausthaler
  • klausthaler's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 108
so here are some differences:
WAMP on my windows PC still has PHP-Version 5.4.3, on the Server I use 5.6.10
PC trace:
[Dijkstra.php 109] $source= I70; $target= I87; count($exclude)= 0
...[111] var_dump($this->distance)=
array (size=4)
'F33' => float INF
'I70' => int 0
'I74' => float INF
'I87' => float INF
Server trace:
[Dijkstra.php 109] $source= I70; $target= I87; count($exclude)= 0
...[111] var_dump($this->distance)= array(4) { ["F33"]=> float(0) ["I70"]=> int(0) ["I74"]=> float(0) ["I87"]=> float(0) }
in consequence on the server

[processNextNodeInQueue 55] $closest= I70
...[57] foreach
......[58] isset. $neighbor= F33 $this->distance[$neighbor]= 0
[RelationshipController.php 52] count($paths)= 0

=========== no neighbor distance is set (if I understand that part of code correctly). On my PC I read:

[processNextNodeInQueue 55] $closest= I70
...[57] foreach
......[58] isset. $neighbor= F33 $this->distance[$neighbor]= INF
.........[59] shorter_path
[processNextNodeInQueue 55] $closest= F33
...[57] foreach
......[58] isset. $neighbor= I87 $this->distance[$neighbor]= INF
.........[59] shorter_path
...[57] foreach
......[58] isset. $neighbor= I70 $this->distance[$neighbor]= 0
...[57] foreach
......[58] isset. $neighbor= I74 $this->distance[$neighbor]= INF
.........[59] shorter_path
[processNextNodeInQueue 55] $closest= I87
...[57] foreach
......[58] isset. $neighbor= F33 $this->distance[$neighbor]= 1
[processNextNodeInQueue 55] $closest= I74
...[57] foreach
......[58] isset. $neighbor= F33 $this->distance[$neighbor]= 1
[RelationshipController.php 52] count($paths)= 1
Klaus

klausthaler.de/familie
webtrees 1.7.18, Apache/2.4.43 (SunOS 5.10), PHP 7.3.27, MySQL 5.5.52

Please Log in or Create an account to join the conversation.

Last edit: by klausthaler.

'Relationship to me' 5 years 8 months ago #26

  • hermann
  • hermann's Avatar
  • Away
  • Senior Member
  • Senior Member
  • Posts: 295
btw: I just tried the "relationship to me" on my tree (ahnen.hartenthaler.eu; PHP 5.6) and found the same problem. It doesn't show the relationship between me and my brother or me and my daughter. It doesn't work for any combination I tried.

edit: my server is SunOS localhost 5.10 Generic_142901-13 i86pc and PHP is version 5.6.10 (provided by hoster Strato)
webtrees 2.0.16 (all available custom modules installed, php 7.4.15, MySQL 5.6) @ ahnen.hartenthaler.eu/
and webtrees 1.7.18 (many custom modules) @ ahnen1.hartenthaler.eu/

Please Log in or Create an account to join the conversation.

Last edit: by hermann.

'Relationship to me' 5 years 8 months ago #27

  • exxamalte
  • exxamalte's Avatar
  • Visitor
  • Visitor

so here are some differences:
WAMP on my windows PC still has PHP-Version 5.4.3, on the Server I use 5.6.10
PC trace:
...
array (size=4)
'F33' => float INF
'I70' => int 0
'I74' => float INF
'I87' => float INF
Server trace:
...
array(4) {
["F33"]=> float(0)
["I70"]=> int(0)
["I74"]=> float(0)
["I87"]=> float(0) }


There we go. Apparently the INF constant is interpreted differently. While on your Windows PC and PHP 5.4 the infinity constant apparently remains infinite, while on your Solaris server and PHP 5.6 it appears to be transformed into a zero, and hence the comparison of the array values in Dijkstra#processNextNodeInQueue probably doesn't work as expected.
Now, it would still be interesting to find out if the PHP version makes any difference. And if the issue does not appear with PHP 5.6.10 on any other operating system, it would be interesting to know how you ended up with the particular version of PHP on Solaris - did that come from a repository or did you compile PHP manually?

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 8 months ago #28

  • exxamalte
  • exxamalte's Avatar
  • Visitor
  • Visitor
Here is a PHP bug report that might be related to this issue: bugs.php.net/bug.php?id=69188
And a short discussion on some weird behaviour in PHP 5.6 in relation to INF on a PHP mailing list: www.mail-archive.com/internals@lists.php.net/msg79239.html

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 8 months ago #29

  • klausthaler
  • klausthaler's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 108
changing PHP versions to PHP 5 and PHP 3 has no effect. In this world INF= 0, defined(INF)=

I replaced the 'INF' in line 109 of Dijkstra.php with '1000000' and now it works perfect for me.

First thanks to all of you for helping and your interest! It feels great to be in such a good community.

Next we could bother the question if 'INF' must be defined in every PHP version.
Klaus

klausthaler.de/familie
webtrees 1.7.18, Apache/2.4.43 (SunOS 5.10), PHP 7.3.27, MySQL 5.5.52

Please Log in or Create an account to join the conversation.

Last edit: by klausthaler.

'Relationship to me' 5 years 8 months ago #30

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
> Next we could bother the question if 'INF' must be defined in every PHP version.

Most software uses the IEEE standard for floating point numbers.
This standard includes special values. INF = "infinity". NaN = "Not a number".

PHP includes these. php.net/manual/en/math.constants.php

> bugs.php.net/bug.php?id=69188

This appears to be the same problem. SunOS converts INF to 0
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 8 months ago #31

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
Also, this bug report is for the same hosting provider (strato.de) that you use...
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 8 months ago #32

  • exxamalte
  • exxamalte's Avatar
  • Visitor
  • Visitor

I replaced the 'INF' in line 109 of Dijkstra.php with '1000000' and now it works perfect for me.


This workaround is fine for now, because in a real-life scenario you would not have a family tree with relationships in this order of magnitude. However, I would still prefer using a constant such as PHP_INT_MAX as an alternative.
And of course, the actual bug should be fixed in PHP.

I am still not sure how many PHP versions and platforms are actually affected by this issue. If it turns out that many webtrees users may be affected, and the bug is unlikely fixed in the PHP versions used in the near future, we could build a simple fix for this issue into webtrees.

To track the issue, I created a new report: github.com/fisharebest/webtrees/issues/697

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 8 months ago #33

  • klausthaler
  • klausthaler's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 108
Strato offers PHP 5.6, 5.5 and 5.3 - all of them have the bug.

Strato checked and verified the problem and opened a ticket for the case.

exxamalte: yes, 2.147.483.647 is bigger:-)

I tried to put this into the gitcom thread. ==> "This page is taking way too long to load. Sorry about that. Please try refreshing and contact us if the problem persists."
Klaus

klausthaler.de/familie
webtrees 1.7.18, Apache/2.4.43 (SunOS 5.10), PHP 7.3.27, MySQL 5.5.52

Please Log in or Create an account to join the conversation.

Last edit: by klausthaler.

'Relationship to me' 5 years 8 months ago #34

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
> I tried to put this into the gitcom thread

github is experiencing a DDOS attack - status.github.com/messages

Try again later.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 8 months ago #35

  • hermann
  • hermann's Avatar
  • Away
  • Senior Member
  • Senior Member
  • Posts: 295
Hi Greg! The new algorithm to calculate relationships is great!!! I have done now several tests and found connections over 50 steps. Perfect. Thanks a lot! There was only one test failed because of computing time (find "all" connections from me to my wife (there is one with 35 steps)). Beside this timeout it works perfect.
I was irritated for one moment when the graphical output shows more than one path, because there is no separator line between the pathes so that the lower part of the first path is near the upper part of the second path; maybe a grey horizontal line in between would make it more intuitive that the two pathes are not connected.
webtrees 2.0.16 (all available custom modules installed, php 7.4.15, MySQL 5.6) @ ahnen.hartenthaler.eu/
and webtrees 1.7.18 (many custom modules) @ ahnen1.hartenthaler.eu/

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 3 months ago #36

  • klausthaler
  • klausthaler's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 108
got the same problem anew with version 1.73.

Cause was as the same as before, the keyword 'INF' in line 109 of webtrees/vendor/fisharebest/algorithm/src/Dijkstra.php

$this->distance = array_fill_keys(array_keys($this->graph), INF);

was not understood by the PHP version (see below) on the server and set to zero.

Changing 'INF' to 'PHP_INT_MAX' is not correct, but it works.
Klaus

klausthaler.de/familie
webtrees 1.7.18, Apache/2.4.43 (SunOS 5.10), PHP 7.3.27, MySQL 5.5.52

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 3 months ago #37

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
Can a strato.de customer give me the output of this script.
var_dump(bin2hex(pack('d', M_PI)), bin2hex(pack('f', M_PI)),bin2hex(pack('d', NAN)), bin2hex(pack('f', NAN)));
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 3 months ago #38

  • klausthaler
  • klausthaler's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 108
here you are:

Table `information_schema`.`var_dump(bin2hex(pack('d',`

MySQL-ERROR
MySQL says:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'var_dump(bin2hex(pack('d', M_PI)), bin2hex(pack('f', M_PI)),bin2hex(pack('d', NA' at line 1
Klaus

klausthaler.de/familie
webtrees 1.7.18, Apache/2.4.43 (SunOS 5.10), PHP 7.3.27, MySQL 5.5.52

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 3 months ago #39

  • klausthaler
  • klausthaler's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 108
better understood by php:

string(16) "182d4454fb210940" string(8) "db0f4940" string(16) "000000000000f8ff" string(8) "0000c0ff"
Klaus

klausthaler.de/familie
webtrees 1.7.18, Apache/2.4.43 (SunOS 5.10), PHP 7.3.27, MySQL 5.5.52

Please Log in or Create an account to join the conversation.

'Relationship to me' 5 years 3 months ago #40

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 14515
Thanks. I'll get this fixed for the next release.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum