seanjensengrey / mosh-scheme

Automatically exported from code.google.com/p/mosh-scheme
Other
0 stars 0 forks source link

reentrant call to put-string causes segfault #198

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
(let ((op (make-custom-textual-output-port
            "test"
            (lambda (string start count)
              (put-string (current-output-port) string start count)
              count)
            #f
            #f
            #f)))
  (put-string op "...\n"))

What is the expected output? What do you see instead?
Expected "Test"
result:
  proc = (m . 1)
  zsh: segmentation fault  mosh customport-segv.scm

What version of the product are you using? On what operating system?
Mosh from git
Linux amd64 & i386

Please provide any additional information below.
The backtrace I get from gdb is not very useful, but I include it anyway:

  Starting program: /usr/local/bin/mosh customport-segv.scm
  [Thread debugging using libthread_db enabled]
  proc = (m . 1)

  Program received signal SIGSEGV, Segmentation fault.
  0x0000000001237a00 in ?? ()
  (gdb) bt
  #0  0x0000000001237a00 in ?? ()
  #1  0x000000000000000b in ?? ()
  #2  0x0000000001223e40 in ?? ()
  #3  0x0000000000000000 in ?? ()

ypsilon handles this example and prints "Test".
Ikarus terminates successfully but gives no output.  I'm not sure if the case 
is legal or not...

Original issue reported on code.google.com by amoe...@gmail.com on 22 Mar 2011 at 9:32

GoogleCodeExporter commented 9 years ago
Fixed with ugly workaround.
https://github.com/higepon/mosh/commit/346c92e58733e7f05419549526256c98fa7cbce8

We should clean up this some day :D.

Original comment by hige...@gmail.com on 22 Mar 2011 at 1:25

GoogleCodeExporter commented 9 years ago
Reopend as enhancement. 

Reason:
- This workaround won't cover any other cases like custom-input-port, 
custom-binary port, ...
- This entry should be a known-issue of 0.2.7 release.

Original comment by oku...@gmail.com on 22 Mar 2011 at 1:56

GoogleCodeExporter commented 9 years ago

Original comment by hige...@gmail.com on 26 Apr 2011 at 1:59