php-fit-file-analysis icon indicating copy to clipboard operation
php-fit-file-analysis copied to clipboard

Undefined offset: 25 in phpFITFileAnalysis.php on line 1228

Open OlafvdSpek opened this issue 5 years ago • 12 comments

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 avatar Sep 11 '18 12:09 OlafvdSpek

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

OlafvdSpek avatar Sep 11 '18 14:09 OlafvdSpek

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 avatar Sep 12 '18 10:09 adriangibbons

Sure, what's your email address?

OlafvdSpek avatar Sep 13 '18 12:09 OlafvdSpek

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

adriangibbons avatar Sep 16 '18 02:09 adriangibbons

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

OlafvdSpek avatar Sep 16 '18 08:09 OlafvdSpek

Hi Adrian,

Any luck?

OlafvdSpek avatar May 15 '19 07:05 OlafvdSpek

@adriangibbons Ping ;)

OlafvdSpek avatar Sep 30 '19 08:09 OlafvdSpek

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

adriangibbons avatar Oct 05 '19 02:10 adriangibbons

$ 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 avatar Oct 08 '19 09:10 OlafvdSpek

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.

OlafvdSpek avatar Oct 08 '19 09:10 OlafvdSpek

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.

adriangibbons avatar Nov 07 '19 09:11 adriangibbons

Thanks!

OlafvdSpek avatar Nov 07 '19 10:11 OlafvdSpek