Project

General

Profile

Actions

Support Request #1257

closed

ADTFS-47830 Failed access to streamItem with ADTF File Library

Added by hidden over 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Customer:
ELEKTROBIT
Department:
SUPPORT
Requester's Priority:
Normal
Support Level:
3rd Level
Resolution:
Solved Issue
Product Issue Numbers:
Platform:
Windows 7 64bit
Topic:
FileLibrary::Common
FAQ Links:

Description

Supportanfrage

Hallo,

es ist nicht möglich aus einem ADTF3-dATFile an ein streamItem durchGetNextItem() zu kommen. Wir haben das auch mit dem Fileaccess Beispiel der ADFTFile Library versucht.
Der Zugriff ergibt immer einen Nullpointer.

Zeile 63 bis 65 in der beigefügten cpp

Habt Ihr da eine Lösung?

Danke und Grüße,
Anja

Lösung

Entgegen Kommentar 13 und 14 treten die Segfaults erst bei der von Stephan genannten Zeile auf und fileItem_.stream_item.get() passt wunderbar. Da das erste Item ein StreamType ist, liefert der std::dynamic_pointer_cast<DefaultSample> natuerlich einen nullptr. Also alles in bester Ordnung, ist einfach nur ein Fehler in der modifizierten fileaccess.cpp. Wie man richtig auf die StreamItems zugreift sieht man in access_file_data weiter unten. (siehe Kommentare)


Files

fileaccess.cpp (10.8 KB) fileaccess.cpp hidden, 2017-10-24 10:00
example_file.7z (13.6 MB) example_file.7z hidden, 2017-11-02 09:45
Actions #1

Updated by hidden over 6 years ago

  • Project changed from Public Support to 7
  • Topic set to FileLibrary::Common
  • Customer set to ELEKTROBIT
  • Department set to SUPPORT
  • Affected Products ADTF 3.1.0 added
  • Platform Windows 7 64bit added
Actions #2

Updated by hidden over 6 years ago

  • File deleted (image001.gif)
Actions #3

Updated by hidden over 6 years ago

@Matthias, bitte zur Bearbeitung weitergeben.

Actions #4

Updated by hidden over 6 years ago

  • Status changed from New to In Progress
Actions #5

Updated by hidden over 6 years ago

  • Affected Products ADTF File Library 0.1.0 (BETA) added
  • Affected Products deleted (ADTF 3.1.0)
Actions #6

Updated by hidden over 6 years ago

Kannst Du bitte den Quellcode noch anhängen? Aus der Verwendund im adtf_dattool weiß ich aber schon mal, dass es prinzipiell funktioniert.

Actions #7

Updated by hidden over 6 years ago

Kannst Du bitte den Quellcode noch anhängen? Aus der Verwendund im adtf_dattool weiß ich aber schon mal, dass es prinzipiell funktioniert.

Anja ?

Actions #8

Updated by hidden over 6 years ago

  • Status changed from In Progress to Customer Feedback Required
Actions #9

Updated by hidden over 6 years ago

Hallo Florian,

sorry, ich war die letzte Woche krank, deshalb gab es noch keine Antwort von mir.

Mehr Code habe ich gar nicht den ich dir noch zur Verfügung stellen kann. Wir haben nach dem es bei uns Nullpointer gab einfach in eurem Fileaccess bsp. der ADTF File library den Zugriff ausprobiert, ohne Erfolg. Wenn du in Zeile 65 den Zugriff auf das stream_item debuggst gibt es einen Nullpointer.

Dafür habe ich euch die angepasste cpp bereits geschickt.

Danke und Grüße,

Anja

On Mon Oct 23 2017 10:04:22 GMT+0200 (W. Europe Daylight Time), srv_ict-a-sync-0010 wrote:

Subject: EB Support - Issue #1257 ADTFS-47830 kein Zugriff auf das streamItem bei ADTF3 dat files
From:
To: -
CC: -
Send Date: 19.Okt.17 9:58
Received Date: 19.Okt.17 9:58

- Please enter your reply or information you would like to add to your support request right above this line.Issue #1257 has been updated by Florian Roth.

Kannst Du bitte den Quellcode noch anhängen? Aus der Verwendund im adtf_dattool weiß ich aber schon mal, dass es prinzipiell funktioniert.

Anja ?

Actions #10

Updated by hidden over 6 years ago

Genau darum geht es, es war kein Anhang dabei^^

Actions #11

Updated by hidden over 6 years ago

Achso. Na dann hier noch mit Anhang. ;-)

Grüße,

Anja

On Tue Oct 24 2017 08:49:21 GMT+0200 (W. Europe Daylight Time), srv_ict-a-sync-0010 wrote:

Subject: EB Support - Issue #1257 ADTFS-47830 kein Zugriff auf das streamItem bei ADTF3 dat files
From: <mailto:>
To: -
CC: -
Send Date: 23.Okt.17 4:00
Received Date: 23.Okt.17 4:00

- Please enter your reply or information you would like to add to your support request right above this line.Issue #1257 has been updated by Florian Roth.

Genau darum geht es, es war kein Anhang dabei^^

Actions #12

Updated by hidden over 6 years ago

  • Status changed from Customer Feedback Required to In Progress
Actions #13

Updated by hidden over 6 years ago

Hallo Anja,

ich denke es geht um

auto fileItem_ = reader.GetNextItem();
std::cout << "Chunk count       : " << fileItem_.stream_id   << std::endl;
std::cout << "Extension count   : " << fileItem_.stream_item.get() << std::endl;
std::cout << "Stream count      : " << fileItem_.time_stamp.count()  << std::endl;       

fileItem_.stream_item.get() liefert bei euch einen nullptr?

Das klappt bei uns problemlos, ich kann mir nur vorstellen, dass das an der verwendeten DAT Datei liegt. Könnt ihr uns die bitte auch zukommen lassen?

Actions #14

Updated by hidden over 6 years ago

Hallo,

anbei das file. Es ist das Beispielfile von ADTF 3.1.0 welches unter \src\examples\datfiles zu finden ist.

Genau die Aufrufe auf das fileItem_ geben Nullpointer.

Danke und Grüße,
Anja

Actions #16

Updated by hidden over 6 years ago

Auch das funktioniert:

[heimlich@pre]$ valgrind /home/heimlich/devel/tmp/adtf_file-0.1.0/bin/debug/fileaccess ~/devel/tmp/example_file.adtfdat /tmp/test2.csv                                                                                                                  ~/Downloads/adtf_file-0.1.0/build
==3952== Memcheck, a memory error detector
==3952== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3952== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==3952== Command: /home/heimlich/devel/tmp/adtf_file-0.1.0/bin/debug/fileaccess /home/heimlich/devel/tmp/example_file.adtfdat /tmp/test2.csv
==3952== 
File: /home/heimlich/devel/tmp/example_file.adtfdat

File Header
------------------------------------------------------------------------------
File version      : 1024 - ADTF 3 and higher
Date              : 20.10.16 - 10:22:11
Duration          : 14805306
Short description : 
Long description  : 
Chunk count       : 1469
Extension count   : 9
Stream count      : 2

Streams
------------------------------------------------------------------------------
Stream #1 : VIDEO
    MetaType       : adtf/image
        pixel_height - 240
        pixel_width - 320
        max_byte_size - 76800
        data_endianess - 1
        format_name - GREY(8)
Stream #2 : NESTED_STRUCT
    MetaType       : adtf2/legacy
        sub - 0
        md_struct - tNestedStruct
        flags - 0
        md_definitions - <?xml version="1.0" encoding="iso-8859-1" standalone="no"?><adtf:ddl xmlns:adtf="adtf"><header><language_version>3.00</language_version><author>VOIGTLPI</author><date_creation>20.10.2016</date_creation><date_change>20.10.2016</date_change><description>ADTF generated</description></header><units /><datatypes><datatype description="predefined ADTF tUInt32 datatype" max="4294967295" min="0" name="tUInt32" size="32" /><datatype description="predefined ADTF tFloat64 datatype" max="1.797693e+308" min="-1.797693e+308" name="tFloat64" size="64" /><datatype description="predefined ADTF tUInt8 datatype" max="255" min="0" name="tUInt8" size="8" /><datatype description="predefined ADTF tUInt16 datatype" max="65535" min="0" name="tUInt16" size="16" /><datatype description="predefined ADTF tInt32 datatype" max="2147483647" min="-2147483648" name="tInt32" size="32" /><datatype description="predefined ADTF tInt64 datatype" max="9223372036854775807" min="-9223372036854775808" name="tInt64" size="64" /><datatype description="predefined ADTF tFloat32 datatype" max="3.402823e+38" min="-3.402823e+38" name="tFloat32" size="32" /></datatypes><enums /><structs><struct alignment="1" name="tNestedStruct" version="1"><element alignment="1" arraysize="1" byteorder="LE" bytepos="0" name="sHeaderStruct" type="tHeaderStruct" /><element alignment="1" arraysize="1" byteorder="LE" bytepos="12" name="sSimpleStruct" type="tSimpleStruct" /></struct><struct alignment="1" name="tHeaderStruct" version="1"><element alignment="1" arraysize="1" byteorder="LE" bytepos="0" name="ui32HeaderVal" type="tUInt32" /><element alignment="1" arraysize="1" byteorder="LE" bytepos="4" name="f64HeaderVal" type="tFloat64" /></struct><struct alignment="1" name="tSimpleStruct" version="1"><element alignment="1" arraysize="1" byteorder="LE" bytepos="0" name="ui8Val" type="tUInt8" /><element alignment="1" arraysize="1" byteorder="LE" bytepos="1" name="ui16Val" type="tUInt16" /><element alignment="1" arraysize="1" byteorder="LE" bytepos="3" name="ui32Val" type="tUInt32" /><element alignment="1" arraysize="1" byteorder="LE" bytepos="7" name="i32Val" type="tInt32" /><element alignment="1" arraysize="1" byteorder="LE" bytepos="11" name="i64Val" type="tInt64" /><element alignment="1" arraysize="1" byteorder="LE" bytepos="19" name="f64Val" type="tFloat64" /><element alignment="1" arraysize="1" byteorder="LE" bytepos="27" name="f32Val" type="tFloat32" /></struct></structs><streams /></adtf:ddl>
        major - 0

File data
------------------------------------------------------------------------------
==3952== 
==3952== HEAP SUMMARY:
==3952==     in use at exit: 480 bytes in 2 blocks
==3952==   total heap usage: 8,410 allocs, 8,408 frees, 35,946,542 bytes allocated
==3952== 
==3952== LEAK SUMMARY:
==3952==    definitely lost: 480 bytes in 2 blocks
==3952==    indirectly lost: 0 bytes in 0 blocks
==3952==      possibly lost: 0 bytes in 0 blocks
==3952==    still reachable: 0 bytes in 0 blocks
==3952==         suppressed: 0 bytes in 0 blocks
==3952== Rerun with --leak-check=full to see details of leaked memory
==3952== 
==3952== For counts of detected and suppressed errors, rerun with: -v
==3952== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Actions #17

Updated by hidden over 6 years ago

Hallo,

allerdings frage ich mich wo jetzt die Unterschiede zwischen euch und uns liegen? Habt Ihr eventuell eine neuere Version der ADTF file library?

Ich habe gerade nach irgendeiner Versionsangabe gesucht. Im fileaccess steht:

/**
*
* ADTF File Access example
*
* @file
* Copyright &copy; Audi Electronics Venture GmbH. All rights reserved
*
* $Author: voigtlpi $
* $Date: 2014-10-31 14:01:50 +0100 (Fr, 31 Okt 2014) $
* $Revision: 30555 $
*
* @remarks
*
*/

Bekommen haben wir sie so Anfang Juni diesen Jahres.

Best regards,
Anja Winkler
EB Assist ADTF Support-Team
---------------------

Actions #18

Updated by hidden over 6 years ago

  • Support Level changed from 2nd Level to 3rd Level

Hallo Anja,

wir verwenden die selbe ADTF File Library Version 0.1.0.
Mit dem eurem fileaccess Beispiel + adtfdat file kann ich den Fehler unter Windows nachvollziehen.

Bei mir tritt der Fehler in Zeile 65 auf:

auto timee = sample_data->GetTimeStamp().count();

@Martin, kannst du das auch nachvollziehen?

Actions #19

Updated by hidden over 6 years ago

Hi Stephan und Anja,

ja, das kann ich jetzt nachvollziehen, entgegen Kommentar 13 und 14 treten die Segfaults erst bei der von Stephan genannten Zeile auf und fileItem_.stream_item.get() passt wunderbar. Da das erste Item ein StreamType ist, liefert der std::dynamic_pointer_cast<DefaultSample> natuerlich einen nullptr. Also alles in bester Ordnung, ist einfach nur ein Fehler in der modifizierten fileaccess.cpp. Wie man richtig auf die StreamItems zugreift sieht man in access_file_data weiter unten.
Grüße,

Martin

Actions #20

Updated by hidden over 6 years ago

  • Status changed from In Progress to Customer Feedback Required
Actions #21

Updated by hidden over 6 years ago

Ok, danke fürs Anschauen und eure Hilfe.

Viele Grüße,

Anja
EB Assist ADTF Support-Team

Actions #22

Updated by hidden over 6 years ago

  • Subject changed from ADTFS-47830 kein Zugriff auf das streamItem bei ADTF3 dat files to ADTFS-47830 Failed access to streamItem with ADTF File Library
  • Description updated (diff)
  • Status changed from Customer Feedback Required to To Be Closed
  • Resolution set to Solved Issue
Actions #23

Updated by hidden over 6 years ago

  • Status changed from To Be Closed to Closed
Actions #24

Updated by hidden about 6 years ago

  • Project changed from 7 to Public Support
  • Private changed from Yes to No
Actions

Also available in: Atom PDF