Skip to content

shell_print_commands() crashes #16

Open
@joemcool

Description

@joemcool

Calling shell_print_commands() causes a crash. On my ESP8266 module, this manifests as a reboot with an exception cause of 3 (LoadStoreErrorCause). I believe this is caused by using PSTR() to store command strings in PROGMEM/flash, and then trying to print them with shell_println() instead of shell_println_pm(). I believe Arduino boards like the Uno and Mega would be affected by this as well, but don't have one to test with.

Steps to reproduce:
--Register a command with the command wrapped in a PSTR() call. e.g. shell_register(command_mycommand, PSTR("mycommand"));
--Call shell_print_commands()

I was using PSTR() because its what is done in the examples, and seems to be what the library expects. I have plenty of RAM available on my module, so I've moved away from the PSTR() calls as a temporary solution and things are working. However, it seems cleaner to fix this issue by adding an #ifdef ARDUINO wrapper to the shell_print_commands() function's loop so that the correct print_ln function gets called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions