reboot() problem - page 3 - General Discussion and Assistance - CHDK Forum supplierdeeply

reboot() problem

  • 43 Replies
  • 8339 Views
*

Offline philmoz

  • *****
  • 3156
    • Photos
Re: reboot() problem
« Reply #20 on: 27 / November / 2014, 13:38:22 »
Advertisements
Ups... I attached all needed modules now.

The main.bin.dump file in modules.rar is empty (0 bytes length).

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

*

Offline timgor

  • ***
  • 150
Re: reboot() problem
« Reply #21 on: 27 / November / 2014, 14:43:50 »
It should be ok now.
I should notice that the crash is not related to the reboot() function only. Once it happened just after the manual start of the camera.

By the way, the last record
(2014:11:26 22:29:56)
in the MODULES.LOG
has been done when I turn camera on to get ROMLOG file
The actual crash happened on (2014:11:26 20:57:25)

I don't know architecture of the CHDK but my guess is that there is something wrong when it loads module for first time after starting. (That's just my guess and it can be completely wrong)
« Last Edit: 27 / November / 2014, 15:54:41 by timgor »

*

Offline philmoz

  • *****
  • 3156
    • Photos
Re: reboot() problem
« Reply #22 on: 27 / November / 2014, 16:40:53 »
It should be ok now.
I should notice that the crash is not related to the reboot() function only. Once it happened just after the manual start of the camera.

By the way, the last record
(2014:11:26 22:29:56)
in the MODULES.LOG
has been done when I turn camera on to get ROMLOG file
The actual crash happened on (2014:11:26 20:57:25)

I don't know architecture of the CHDK but my guess is that there is something wrong when it loads module for first time after starting. (That's just my guess and it can be completely wrong)

Is the script set to auto-run? Can you post the script please?

It looks like the crash happens when it tries to draw the MD display.
I suspect it's a race condition, where the module has not finished loading / initializing before the display function is called.

Phil.
« Last Edit: 27 / November / 2014, 16:45:21 by philmoz »
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: reboot() problem
« Reply #23 on: 27 / November / 2014, 18:30:47 »
I suspect it's a race condition, where the module has not finished loading / initializing before the display function is called.
FWIW,  I've been chasing a bug in new code that now looks a lot like module mechanism corruption if I call things (without a delay) in the main spytask loop?  Does that make sense?
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline philmoz

  • *****
  • 3156
    • Photos
Re: reboot() problem
« Reply #24 on: 27 / November / 2014, 18:44:02 »
I suspect it's a race condition, where the module has not finished loading / initializing before the display function is called.
FWIW,  I've been chasing a bug in new code that now looks a lot like module mechanism corruption if I call things (without a delay) in the main spytask loop?  Does that make sense?

Could be the same issue, if the module load is done in a different task.

If my analysis is correct it may take some time to fully investigate and fix.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: reboot() problem
« Reply #25 on: 27 / November / 2014, 18:46:01 »
Could be the same issue, if the module load is done in a different task.  If my analysis is correct it may take some time to fully investigate and fix.
Can confirm that a 2 second delay before a module routine is called from spytask clears up the problem. 
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3156
    • Photos
Re: reboot() problem
« Reply #26 on: 27 / November / 2014, 19:06:33 »
Could be the same issue, if the module load is done in a different task.  If my analysis is correct it may take some time to fully investigate and fix.
Can confirm that a 2 second delay before a module routine is called from spytask clears up the problem.

If you can post sample code that demonstrates the problem it may help.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

Re: reboot() problem
« Reply #27 on: 27 / November / 2014, 19:34:01 »
If you can post sample code that demonstrates the problem it may help.
I'll see what I can do to find a simple example.   I had module logging enabled as well - that might not be a good thing.
Ported :   A1200    SD940   G10    Powershot N    G16


*

Offline timgor

  • ***
  • 150
Re: reboot() problem
« Reply #28 on: 27 / November / 2014, 20:53:00 »
There is a sample script that produces the crash.
The CHDK as well as the script are auto started.

*

Offline philmoz

  • *****
  • 3156
    • Photos
Re: reboot() problem
« Reply #29 on: 27 / November / 2014, 22:35:03 »
If you can post sample code that demonstrates the problem it may help.
I'll see what I can do to find a simple example.   I had module logging enabled as well - that might not be a good thing.

Had a look at the module handling code and I think I know where it might be failing (module pointer set to 0 during module load, if task switch occurs it can call module function through null pointer).

I don't have a camera handy at the moment so if you can test the attached patch that would be a big help.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

 

Related Topics