Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined offset: 25 in phpFITFileAnalysis.php on line 1228 #49

Open
OlafvdSpek opened this issue Sep 11, 2018 · 12 comments
Open

Undefined offset: 25 in phpFITFileAnalysis.php on line 1228 #49

OlafvdSpek opened this issue Sep 11, 2018 · 12 comments
Assignees

Comments

@OlafvdSpek
Copy link

1228: $this->types = $this->endianness[$architecture];

Undefined offset: 25 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1228
Undefined offset: 139 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1228
Undefined offset: 97 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1228
Undefined offset: 113 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1228
Undefined offset: 119 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1228
Undefined offset: 109 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1228
Undefined offset: 108 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1228
@OlafvdSpek OlafvdSpek changed the title Undefined offset: 25 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1228 Undefined offset: 25 in phpFITFileAnalysis.php on line 1228 Sep 11, 2018
@OlafvdSpek
Copy link
Author

array_unique() expects parameter 1 to be array, integer given in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1535

@adriangibbons
Copy link
Owner

Hi @OlafvdSpek - obviously something is going quite horribly wrong! The $architecture should only be 0 or 1 for big or little-endianess.

Are you able to share a FIT file where this is happening? What type of activity and what device have you used to record it?

Cheers, Adrian.

@adriangibbons adriangibbons self-assigned this Sep 12, 2018
@OlafvdSpek
Copy link
Author

Sure, what's your email address?

@adriangibbons
Copy link
Owner

You can save a file as a .TXT and upload it here if that works? Cheers

@OlafvdSpek
Copy link
Author

I'd like the file to stay (semi) private..

@OlafvdSpek
Copy link
Author

Hi Adrian,

Any luck?

@OlafvdSpek
Copy link
Author

@adriangibbons Ping ;)

@adriangibbons
Copy link
Owner

adriangibbons commented Oct 5, 2019

Hi @OlafvdSpek

Are you still having issues? You'd shared two files with me via email:

garmin.fit
As discussed via email, neither of us is able to reproduce the error and everything seems OK.

1.fit
This doesn't seem like an activity is recorded in the file (which is only 494 bytes) - maybe something went wrong when recording this.

This is confirmed if I upload to Strava:

Screen Shot 2019-10-05 at 10 43 54 am

@OlafvdSpek
Copy link
Author

OlafvdSpek commented Oct 8, 2019

$ php test-fit.php 1.fit 
PHP Warning:  array_unique() expects parameter 1 to be array, integer given in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1543

Warning: array_unique() expects parameter 1 to be array, integer given in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1543
$ php test-fit.php 2.fit  
PHP Notice:  Undefined offset: 14 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1232

Notice: Undefined offset: 14 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1232
PHP Notice:  Undefined offset: 73 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1232

Notice: Undefined offset: 73 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1232
PHP Notice:  Undefined offset: 14 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1232

Notice: Undefined offset: 14 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1232
PHP Notice:  Undefined offset: 14 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1232

Notice: Undefined offset: 14 in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 1232
PHP Fatal error:  Uncaught Error: Unsupported operand types in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php:2720
Stack trace:
#0 vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php(1143): adriangibbons\phpFITFileAnalysis->processHrMessages()
#1 test-fit.php(6): adriangibbons\phpFITFileAnalysis->__construct('2.fit')
#2 {main}
  thrown in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 2720

Fatal error: Uncaught Error: Unsupported operand types in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php:2720
Stack trace:
#0 vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php(1143): adriangibbons\phpFITFileAnalysis->processHrMessages()
#1 test-fit.php(6): adriangibbons\phpFITFileAnalysis->__construct('2.fit')
#2 {main}
  thrown in vendor/adriangibbons/php-fit-file-analysis/src/phpFITFileAnalysis.php on line 2720
$ composer info
adriangibbons/php-fit-file-analysis v3.2.2 A PHP class for analysing FIT files created by Garmin GPS devices
$ md5sum *.fit
acc6b419f903165f9a6cc4dd8e8a60d2  1.fit
60df7628d0105886a16f63dfcfdc846c  2.fit
c4b2b452ad461e1415b6f337d3e4523b  issue-49.fit
$ cat test-fit.php 
<?php
require __DIR__ . '/vendor/autoload.php';

// echo $_SERVER['argv'][1], ":\n";

new adriangibbons\phpFITFileAnalysis($_SERVER['argv'][1]);
$ php --version
PHP 7.0.33-11+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Sep  2 2019 13:31:10) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.33-11+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
    with blackfire v1.27.1~linux-x64-non_zts70, https://blackfire.io, by Blackfire

@OlafvdSpek
Copy link
Author

This doesn't seem like an activity is recorded in the file (which is only 494 bytes) - maybe something went wrong when recording this.

Hi Adrian,

Maybe, but shouldn't the lib be able to handle that without PHP warnings?
I've emailed you 2.fit, a file that causes other warnings / errors. Let me know if you can reproduce them.

@adriangibbons
Copy link
Owner

Just made a quick commit that should fix the issue with 1.fit
Family, work, life, other projects have been preventing me from progressing the other issues.

@OlafvdSpek
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants