none
BUG in 'MountedVolume' implementation (Embedded Compact 7) RRS feed

  • Question

  • Hello Dear All,

    I think I found a bug in volume mounting code or at least unsafe code in Embedded Compact 7.

    This code is a part of 'private' code area and is not available for cloning and modifications.

    We are facing an issue with USB sticks.

    Occasionally they hang during to various issue (mostly hardware).

    Main problem is when software tries accessing file API (like GetFileAttributes) to such volumes hangs dead.

    When investigating one of those 'mysterious hang' issue a spotted the possible issue in MountedVolume_t class which handles, well, volume access.

    EnterWithWait function of above class has chance of endless looping if device is in 'not available' state and does not want to get out of this state.

    So if device is 'not available' and keeps being 'not available' this function never return and all calls to file API will dead hang with no chance to recover.

    This is exactly what I am seeing.

    API call hangs for ever and the only way to get software to unlock is to physically remove USB stick from device.

    I would prefer that this function return some error in such case but not (obviously) to dead lock.

    Also I am pretty sure this bug can affect devices other than USB mass storage.

    MS people, could you please clarify the issue?

    Thanks,

    Alexey

    Tuesday, October 25, 2016 2:44 PM

Answers

  • Hi Alexey,

    Can you please confirm the hardware you are using? BSP? Config.txt? Size and format of the various USB devices you have tried? We need to know far more about the related setup and we will need it to occur with one of the BSPs we support in house, such as CEPC.

    For example, can you please provide detail so that someone else could reproduce your experience?

    ENVIRONMENT:

    What Computers, OS and devices are involved with this repro? How are they connected? Are all of the latest updates applied?

    REPRO STEPS:

    What steps would someone else need to follow to see the issue?

    RESULTS:

    What did you Expect to happen?

    What did Actually happen?

    NOTES:

    Any other details/workarounds potentially related info? Error messages?

    If is only occurs on the hardware platform you are using, you will have to trace your issue through the BSP supplier.

    Sincerely,

    IoTGirl



    Tuesday, October 25, 2016 4:41 PM
    Moderator

All replies

  • Hi Alexey,

    Can you please confirm the hardware you are using? BSP? Config.txt? Size and format of the various USB devices you have tried? We need to know far more about the related setup and we will need it to occur with one of the BSPs we support in house, such as CEPC.

    For example, can you please provide detail so that someone else could reproduce your experience?

    ENVIRONMENT:

    What Computers, OS and devices are involved with this repro? How are they connected? Are all of the latest updates applied?

    REPRO STEPS:

    What steps would someone else need to follow to see the issue?

    RESULTS:

    What did you Expect to happen?

    What did Actually happen?

    NOTES:

    Any other details/workarounds potentially related info? Error messages?

    If is only occurs on the hardware platform you are using, you will have to trace your issue through the BSP supplier.

    Sincerely,

    IoTGirl



    Tuesday, October 25, 2016 4:41 PM
    Moderator
  • Hello,

    Unfortunately this problem cannot be reproduced easily or predictable.

    I think it is related to USB stick hardware failing to respond or something similar.

    Sorry about that.

    I understand that it is unlikely that this issue gets attention but still think that it would be safer to return from API with some error code explaining the problem instead of spinning there forever.

    At least it can help in case of faulty USB sticks.

    Thanks,

    Alexey

    Thursday, October 27, 2016 3:04 PM
  • Hi Alexey,

    Unfortunately, it is not a matter of attention but really that we can't solve an issue we can't reproduce.  If you do find a repro that you can share please do not hesitate to follow up.

    Sincerely,

    IoTGirl

    Thursday, October 27, 2016 3:53 PM
    Moderator
  • Alexey

    If you have any binary (DLL or EXE) and one of the source code files, it can be cloned.

    I am not suggesting that it is as easy as when you have full source and the sources file, but I am saying that it can be done.

    For more, take a look at: http://geekswithblogs.net/BruceEitman/archive/2010/03/23/platform-builder-cloning--the-linker-is-your-friend.aspx



    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman
    I work for Eurotech

    Thursday, October 27, 2016 7:56 PM
    Moderator
  • Bruce,

    Thank you very much for your advice.

    I know how cloning works and used it numerous times.

    Code I mentioned belongs to 'private' part and can't be cloned.

    IMO it is not allowed to modify 'private' OS code at all, please correct me if I wrong.

    You can have a look at %drive%:\WINCE700\private\winceos\COREOS\storage\fsdmgr\mountedvolume.hpp

    As I said before I saw this issue in crash dump so I submitted the message.

    I think we can close it.

    Thanks,

    Alexey


    Friday, October 28, 2016 11:57 AM
  • Alexey

    Your opinion doesn't count on modifying the private code.  What counts is the license agreement.  It has been a while since I have read it, and I am not a lawyer, but I don't recall a restriction on modifying it.



    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman
    I work for Eurotech

    Monday, October 31, 2016 12:27 PM
    Moderator