Message268969
I think Victor may be on the right track. Since the macro contains two newlines, a single call to rl_callback_read_char() is going to produce two calls back to the rl_callback_handler_install() handler to receive each line.
I can make the example from the Readline documentation <https://cnswww.cns.cwru.edu/php/chet/readline/readline.html#SEC43> crash the same way that Python does. First, add a macro to ~/.inputrc, which causes an exclamation mark (!) to enter two lines at once:
"!": "exit\ncrash\n"
Now, typing an exclamation mark will cause the example program (and Python!) to crash.
In the description of rl_callback_read_char() <https://cnswww.cns.cwru.edu/php/chet/readline/readline.html#IDX335>, it says “If the ‘lhandler’ function returns . . .”. That seems to be hinting at using something like setjmp() to avoid the function returning, which might help, but I am not sure. |
|
Date |
User |
Action |
Args |
2016-06-21 05:19:46 | martin.panter | set | recipients:
+ martin.panter, vstinner, gumnos |
2016-06-21 05:19:46 | martin.panter | set | messageid: <1466486386.89.0.290196967283.issue25259@psf.upfronthosting.co.za> |
2016-06-21 05:19:46 | martin.panter | link | issue25259 messages |
2016-06-21 05:19:46 | martin.panter | create | |
|