Menu

#9 Ctrl-D (EOF) causes seg fault

v1.0 (example)
closed-fixed
fixed (1)
2
2019-07-09
2014-03-18
Duncan Roe
No

The man page advises to use Ctrl-C, but throwing a seg fault and dumping core is just so untidy. Most interactive systems exit [relatively] cleanly on EOF and the little patch attached does that for X11-Basic.
Perhaps the man page should be updated as well.

1 Attachments

Discussion

  • Markus Hoffmann

    Markus Hoffmann - 2014-03-19

    Thanks for the feedback. A Segfault (with INPUT) should of course not happen. My question is: Should INPUT just return, or should the interpreter really quit?

     
  • Markus Hoffmann

    Markus Hoffmann - 2014-03-19
    • status: unread --> open-accepted
    • assigned_to: Markus Hoffmann
     
  • Markus Hoffmann

    Markus Hoffmann - 2014-03-19

    I do not change the man page, because CTRL-C should be the code to make the interpreter quit (If a program is running, the first CTRL-C will stop the running program, and enter command input mode). If in command input mode, a CTRL-C as well as a CTRL-D will make the interpreter quit. Still open is the question, wherethere CTRL-D in an INPUT command should quit or just abord the INPUT (hence continuing with the rest of the program)

     
  • Nick Warne

    Nick Warne - 2014-03-19

    Markus, Duncan found this issue when I was testing the 'standalone' binary feature of X11-Basic preparing for a Slackware build.

    Personally I think Ctrl+D/d should just be ignored and do nothing.

    Nick

     
  • Markus Hoffmann

    Markus Hoffmann - 2014-03-19

    Hm, maybe there is a point when x11basic is invoked from a script and gets input like this
    xbasic testme.bas <<EOF
    some text here
    EOF

    Maybe it shoud really terminate on EOF... Hm...

     
  • Duncan Roe

    Duncan Roe - 2014-03-19

    I suggest x11basic has to stop on receiving EOF. Python does that, as does expect, tclsh and even bash (possibly on repeated EOF)

     
  • Markus Hoffmann

    Markus Hoffmann - 2019-07-09

    It has been solved in following way:CTRL-D now quits the interpreter in interactive mode, but on INPUT only the INPUT command is aborted and the rest of the program can continue.

    Thank you for mentioning this issue. And also for your patch and comments.

     

    Last edit: Markus Hoffmann 2019-07-09
  • Markus Hoffmann

    Markus Hoffmann - 2019-07-09
    • labels: --> fixed
    • status: open-accepted --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.