This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrfjprog bug: gets stuck due to temporary directory permissions

Hi,

while flashing devices in production testing our customer ran into the following problem.

modemFW_flash.py got stuck in an infinite loop, making no progess but consuming 100% CPU.

Running it with strace revealed the tool was repeatedly doing this:

stat("/tmp/nrfjprogdll/highlevel/fileXrbQJF", 0x7ffc0cd5fed0) = -1 ENOENT (No such file or directory)

This failure to access temporary files turned out to be due to the directory tree /tmp/nrfjprogdll being owned by a different user, and the directories in that tree did not have write permission for "other".  Perhaps the tool had tried to create the file, which failed due to not having "write" access, and the tool had ignored the error, then thinks it will magically appear if it just calls stat() often enough.

There are several things wrong here:

1) Temporary directory has fixed path, making it impossible for different users to run the tool.

2) Temporary directory from previous use was not cleaned up.

3) Fixed path directory tree which needs to be shared between users is not created with permissions which would allow sharing.

4) Failure to access files is not handled gracefully. The tool should exit with error code if it cannot access files and directories it needs. When retrying due to error codes returned, there should be a time delay to avoid using 100% CPU and also a limit for retries, after which the tool would give up.

Parents
  • Hello, 

    I will forward your case to our R&D team and get back to you within today or tomorrow. 

    Edit: What version of nrfjprog is your customer using, and what device are they using ? Do you have more information to share?

    Kind regards,
    Øyvind

  • Hi,

    the customer has pynrfjprog 10.8.0 and nRF command line tools 10.7.0., JLink 6.72.

    I am not exactly sure of their processor model, but it is one that has integrated cellular modem and GPS.

  • Hello, 

    Thank you for the information. I was, unfortunately, not able to forward your inquiry yesterday. But will do now and have an answer within the day.

    Kind regards,
    Øyvind 

Reply
  • Hello, 

    Thank you for the information. I was, unfortunately, not able to forward your inquiry yesterday. But will do now and have an answer within the day.

    Kind regards,
    Øyvind 

Children
No Data