Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.

View Entry Info: Recording crashes in 6.2.008

Category:
Possible Bug
What ViX Image build number are you using?
Please provide your ViX Team image build number. Menu > Information > About > Build number > ENTER THIS NUMBER e.g. 4.2.028
6.2.008
Have you tried a flash WITHOUT settings restore?
Have you tried this? PLEASE SELECT YES OR NO.
No
Have you tried a flash WITH settings restore?
Have you tried this? PLEASE SELECT YES OR NO.
Yes
Attachments
Page 2 of 2 FirstFirst 12
Results 16 to 30 of 30

Thread: Recording crashes in 6.2.008

  1. #16
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,807
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    Quote Originally Posted by Huevos View Post
    The crash log you supplied does not show that as the problem. The bad characters are coming from RecordTimer.py and should be fixed at source, not in RedirectOutput.py.
    Might need it in both.
    You don't have total control over what is on the file-system in general, so need to be able to cater for reporting anything.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  2. #17

    Title
    Member
    Join Date
    Jun 2022
    Posts
    70
    Thanks
    1
    Thanked 33 Times in 19 Posts
    Quote Originally Posted by Huevos View Post
    The crash log you supplied does not show that as the problem. The bad characters are coming from RecordTimer.py and should be fixed at source, not in RedirectOutput.py.
    If it makes more sense, here what I did to RedirectOutput.py

    try:
    ePythonOutput(self.line, self.level)
    except:
    s = ''
    for i in self.line:
    s = s + str(ord(i)) + ' '
    ePythonOutput(s, self.level)
    ePythonOutput(self.line, self.level) # Let is crash

    After receiving and converting that debug back to string:

    [Trashcan] Failed to stat t\udce4htisade.ts: in method 'eBackgroundFileEraser_erase', argument 2 of type 'std::string const &'\n

    This is "self.line" that caused crash. That original exception was inside try/except.

  3. The Following User Says Thank You to ocean For This Useful Post:

    twol (22-08-22)

  4. #18

    Title
    Member
    Join Date
    Jun 2022
    Posts
    70
    Thanks
    1
    Thanked 33 Times in 19 Posts
    @twol thanks for the fix, but I don't think simply ignoring characters is the correct way. It fixes the crash, but does not erase the file.

    Question now is why file_eraser.cpp does not accept bytes in python3, if it was bytes in python2?

    Can it be modified to take also bytes, I think that would be the correct fix.

    It would also make sense to add try/except to RedirectOutput (including some debug output to except block if it happens)

    Logging should never crash and there are other places in code where same could happen.

  5. #19
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,671
    Thanks
    2,009
    Thanked 4,964 Times in 3,280 Posts
    Can you get the exception from the debug log so we can analyse the problem.
    Help keep OpenViX servers online.Please donate!

  6. #20

    Title
    Member
    Join Date
    Jun 2022
    Posts
    70
    Thanks
    1
    Thanked 33 Times in 19 Posts
    Quote Originally Posted by Huevos View Post
    Can you get the exception from the debug log so we can analyse the problem.
    Exception in Trashcan or RedirectOutput?

    Both are caused by '\udce4' in str.

    I tried fixing enigma.eBackgroundFileEraser.getInstance().erase(f n) using bytes, but exception "argument 2 of type 'std::string const &"

    Does anyone know reason why, since it was bytes in python2? Any other way to make bytes work here? Only other option is to fix '\udce4' issues in C

  7. #21
    twol's Avatar
    Title
    Moderator
    Join Date
    Apr 2012
    Posts
    8,432
    Thanks
    997
    Thanked 2,902 Times in 2,254 Posts
    Quote Originally Posted by ocean View Post
    @twol thanks for the fix, but I don't think simply ignoring characters is the correct way. It fixes the crash, but does not erase the file.

    Question now is why file_eraser.cpp does not accept bytes in python3, if it was bytes in python2?

    Can it be modified to take also bytes, I think that would be the correct fix.

    It would also make sense to add try/except to RedirectOutput (including some debug output to except block if it happens)

    Logging should never crash and there are other places in code where same could happen.
    " It fixes the crash, but does not erase the file." - I know I am still looking at it!! Just wanted the crash removed.
    The issue with your file names is that in python3 we have to use an encoding that will handle the conversion to Unicode string .... and we are guessing ... the "standard" is utf-8 (suits English speaking countries because that's the same as Ascii more or less), but doesn't handle your file names

    "Question now is why file_eraser.cpp does not accept bytes in python3, if it was bytes in python2?" - it accepts a string (of bytes) which can be Ascii(py2) or Unicode (py3). Python 2 will actually handle both (ascii and Unicode if used ) transparently.
    In py3 you can have either a unicode string or bytes that can be handled by core & I/O routines, where a Unicode byte can be encoded into 1-> 4 bytes in a byte string, depending on the encoding (and visa versa).
    Of course, the python3 developers tell you not to touch any byte string unless you know the encoding, which is kind of nice in theory but in our case rubbish, as our inputs come at us from all over --- including helpful Windows file names.

    You need to read up on py2 vs py3 - its not that simple. If it was we wouldn't have these and many other issues.... espedcially coming from an initial python2 base where we initially supported both python versions.

    I agree on both your last 2 points, but we also need to be able to identify and fix the initial issue.
    Gigablue Quad 4K & UE 4K
    .........FBC Tuners:
    ------------------> GT-Sat unicable LNB to 1.5M dish(28.2E)
    ------------------> Gigablue unicable LNB to 80 cm dish(19.2E)
    .......................> FBC & DVB-S2X into 90cm dish (27.5W) Opticum robust Unicable LNB
    AX HD61, Edision Osmio 4K+, Zgemma H9Combo, Octagon SF8008 , gbtrio4k, h9se using unicable ports
    Zgemma H9 C/S into Giga4K

  8. #22
    twol's Avatar
    Title
    Moderator
    Join Date
    Apr 2012
    Posts
    8,432
    Thanks
    997
    Thanked 2,902 Times in 2,254 Posts
    Quote Originally Posted by ocean View Post
    Exception in Trashcan or RedirectOutput?

    Both are caused by '\udce4' in str.

    I tried fixing enigma.eBackgroundFileEraser.getInstance().erase(f n) using bytes, but exception "argument 2 of type 'std::string const &"

    Does anyone know reason why, since it was bytes in python2? Any other way to make bytes work here? Only other option is to fix '\udce4' issues in C
    I guess you are pushing a unicode string to FileEraser not bytes.
    No - we have to learn how to resolve the unicode string byte ( \udce4 )and others in python
    Last edited by twol; 24-08-22 at 14:43.
    Gigablue Quad 4K & UE 4K
    .........FBC Tuners:
    ------------------> GT-Sat unicable LNB to 1.5M dish(28.2E)
    ------------------> Gigablue unicable LNB to 80 cm dish(19.2E)
    .......................> FBC & DVB-S2X into 90cm dish (27.5W) Opticum robust Unicable LNB
    AX HD61, Edision Osmio 4K+, Zgemma H9Combo, Octagon SF8008 , gbtrio4k, h9se using unicable ports
    Zgemma H9 C/S into Giga4K

  9. #23
    twol's Avatar
    Title
    Moderator
    Join Date
    Apr 2012
    Posts
    8,432
    Thanks
    997
    Thanked 2,902 Times in 2,254 Posts
    ...............deleted
    Last edited by twol; 24-08-22 at 15:57.
    Gigablue Quad 4K & UE 4K
    .........FBC Tuners:
    ------------------> GT-Sat unicable LNB to 1.5M dish(28.2E)
    ------------------> Gigablue unicable LNB to 80 cm dish(19.2E)
    .......................> FBC & DVB-S2X into 90cm dish (27.5W) Opticum robust Unicable LNB
    AX HD61, Edision Osmio 4K+, Zgemma H9Combo, Octagon SF8008 , gbtrio4k, h9se using unicable ports
    Zgemma H9 C/S into Giga4K

  10. #24
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,671
    Thanks
    2,009
    Thanked 4,964 Times in 3,280 Posts
    Quote Originally Posted by ocean View Post
    Does anyone know reason why, since it was bytes in python2?
    Python2 did not have bytes.

    Code:
    Python 2.7.18 (v2.7.18:8d21aa21f2, Apr 20 2020, 13:25:05) [MSC v.1500 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    >>> b'abc'
    'abc'
    >>> type(b'abc')
    <type 'str'>
    >>>
    Code:
    Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    >>> b'abc'
    b'abc'
    >>> type(b'abc')
    <class 'bytes'>
    >>>
    Help keep OpenViX servers online.Please donate!

  11. #25
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,807
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    Quote Originally Posted by twol View Post
    The issue with your file names is that in python3 we have to use an encoding that will handle the conversion to Unicode string ....
    No, we don't . A filename (and pathname) should be kept as bytes. If it is created from a Unicode string it should be decoded to bytes.


    Of course, the python3 developers tell you not to touch any byte string unless you know the encoding, which is kind of nice in theory but in our case rubbish, as our inputs come at us from all over --- including helpful Windows file names.
    Indeed, they have no encoding at all. They are just a collection of bytes. You can name a file anything with any combination of bytes you wish, in any order (except '/' and '\0'). Hence they should always be kept as bytes and passed on as such.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  12. #26
    twol's Avatar
    Title
    Moderator
    Join Date
    Apr 2012
    Posts
    8,432
    Thanks
    997
    Thanked 2,902 Times in 2,254 Posts
    Quote Originally Posted by birdman View Post
    No, we don't . A filename (and pathname) should be kept as bytes. If it is created from a Unicode string it should be decoded to bytes.


    Indeed, they have no encoding at all. They are just a collection of bytes. You can name a file anything with any combination of bytes you wish, in any order (except '/' and '\0'). Hence they should always be kept as bytes and passed on as such.
    “ If it is created from a Unicode string it should be decoded to bytes.“ ………. how do you (en)code it?
    „ You can name a file anything with any combination of bytes you wish, in any order“ - and how is an application supposed to know what those bytes represent?
    Gigablue Quad 4K & UE 4K
    .........FBC Tuners:
    ------------------> GT-Sat unicable LNB to 1.5M dish(28.2E)
    ------------------> Gigablue unicable LNB to 80 cm dish(19.2E)
    .......................> FBC & DVB-S2X into 90cm dish (27.5W) Opticum robust Unicable LNB
    AX HD61, Edision Osmio 4K+, Zgemma H9Combo, Octagon SF8008 , gbtrio4k, h9se using unicable ports
    Zgemma H9 C/S into Giga4K

  13. #27
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,671
    Thanks
    2,009
    Thanked 4,964 Times in 3,280 Posts
    Quote Originally Posted by birdman View Post
    They are just a collection of bytes. You can name a file anything with any combination of bytes you wish.
    And that collection of bytes was created from a charset. And also if we want to send a "collection of bytes" to the GUI we need to know the charset they were saved from so we can display them correctly.
    Help keep OpenViX servers online.Please donate!

  14. #28
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,807
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    Quote Originally Posted by twol View Post
    “ If it is created from a Unicode string it should be decoded to bytes.“ ………. how do you (en)code it?
    Code:
    [gmllaptop]: python3 
    Python 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0] on linux 
    Type "help", "copyright", "credits" or "license" for more information. 
    >>> str = "déjà" 
    >>> bytes = str.encode() 
    >>> print(bytes) 
    b'd\xc3\xa9j\xc3\xa0'
    „ You can name a file anything with any combination of bytes you wish, in any order“ - and how is an application supposed to know what those bytes represent?
    They represent a filename (or rather "an entry in the file-system"). That is all.
    Last edited by birdman; 25-08-22 at 01:58.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  15. #29
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,807
    Thanks
    237
    Thanked 1,659 Times in 1,307 Posts
    Quote Originally Posted by Huevos View Post
    And that collection of bytes was created from a charset. And also if we want to send a "collection of bytes" to the GUI we need to know the charset they were saved from so we can display them correctly.
    Which is nothing to do with the file-system.
    The relevant thing is that the filename has to be kept as bytes. If you wish to display this that is another matter, but you then only convert it for display - you have to retain the original bytes for actual file-system activity.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  16. #30
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,671
    Thanks
    2,009
    Thanked 4,964 Times in 3,280 Posts
    Quote Originally Posted by birdman View Post
    Which is nothing to do with the file-system.
    The relevant thing is that the filename has to be kept as bytes. If you wish to display this that is another matter, but you then only convert it for display - you have to retain the original bytes for actual file-system activity.
    You're welcome to provide a working solution.
    Help keep OpenViX servers online.Please donate!

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.