Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Segmentation fault #250

Closed
leon-vv opened this issue Jan 22, 2015 · 5 comments
Closed

Segmentation fault #250

leon-vv opened this issue Jan 22, 2015 · 5 comments

Comments

@leon-vv
Copy link
Contributor

leon-vv commented Jan 22, 2015

The following file:

(with-output-to-file "test.txt"
    (write "TEST"))

causes a segmentation fault on my system (Ubuntu x64).
Gdb backtrace output:

#0  0x00007fd009eee406 in pic_apply () from /usr/local/lib/libpicrin.so
#1  0x00007fd009eeec00 in pic_apply0 () from /usr/local/lib/libpicrin.so
#2  0x00007fd009ee36a4 in pic_wind () from /usr/local/lib/libpicrin.so
#3  0x00007fd009ee3869 in pic_load_point () from /usr/local/lib/libpicrin.so
#4  0x00007fd009ee393d in escape_call () from /usr/local/lib/libpicrin.so
#5  0x00007fd009eee8f6 in pic_apply () from /usr/local/lib/libpicrin.so
#6  0x00007fd009eeec36 in pic_apply1 () from /usr/local/lib/libpicrin.so
#7  0x00007fd009ef4c61 in native_exception_handler () from /usr/local/lib/libpicrin.so
#8  0x00007fd009eee8f6 in pic_apply () from /usr/local/lib/libpicrin.so
#9  0x00007fd009eeec36 in pic_apply1 () from /usr/local/lib/libpicrin.so
#10 0x00007fd009ef5227 in pic_raise_continuable () from /usr/local/lib/libpicrin.so
#11 0x00007fd009ef53d6 in pic_raise () from /usr/local/lib/libpicrin.so
#12 0x00007fd009ef5429 in pic_throw () from /usr/local/lib/libpicrin.so
#13 0x00007fd009ef52b6 in pic_error () from /usr/local/lib/libpicrin.so
#14 0x00007fd009ef539a in pic_errorf () from /usr/local/lib/libpicrin.so
#15 0x00007fd009eeda2e in pic_apply () from /usr/local/lib/libpicrin.so
#16 0x00007fd009eeec00 in pic_apply0 () from /usr/local/lib/libpicrin.so
#17 0x00007fd009ee3732 in pic_dynamic_wind () from /usr/local/lib/libpicrin.so
#18 0x00007fd009ee379c in pic_cont_dynamic_wind () from /usr/local/lib/libpicrin.so
#19 0x00007fd009eee8f6 in pic_apply () from /usr/local/lib/libpicrin.so
#20 0x00007fd009eeec36 in pic_apply1 () from /usr/local/lib/libpicrin.so
#21 0x00007fd009ee6b97 in pic_port_call_with_port () from /usr/local/lib/libpicrin.so
#22 0x00007fd009eee8f6 in pic_apply () from /usr/local/lib/libpicrin.so
#23 0x00007fd009ef56cb in pic_eval () from /usr/local/lib/libpicrin.so
#24 0x00007fd009efa9cb in pic_load_port () from /usr/local/lib/libpicrin.so
#25 0x00007fd009f012db in pic_load () from /usr/local/lib/libpicrin.so
#26 0x00007fd009f0133d in pic_load_load () from /usr/local/lib/libpicrin.so
#27 0x00007fd009eee8f6 in pic_apply () from /usr/local/lib/libpicrin.so
#28 0x00007fd009eeebbf in pic_funcall () from /usr/local/lib/libpicrin.so
#29 0x0000000000400e04 in main ()

The actual correct program:

(with-output-to-file "test.txt"
    (lambda ()
        (write "TEST")))

works as expected.

@KeenS
Copy link
Member

KeenS commented Jan 23, 2015

@leon-vv

(with-output-file "test.txt"
(write "TEST"))

Do you mean with-output-to-file? Then, verified.

KeenS added a commit that referenced this issue Jan 23, 2015
@KeenS
Copy link
Member

KeenS commented Jan 23, 2015

@wasabiz
I found that when you call (#f) in parameterize, invalid application error is raised, this is usual. Then, the error encounters NULL pointer. If not in parameterize, the error doesn't occur.
Because I'm not so familiar with the implementation of error handler and parameter, please fix this in issue-250 branch.

@nyuichi
Copy link
Member

nyuichi commented Jan 23, 2015

@leon-vv

Thank you for your test & report.

@KeenS

Hmm.. Null pointer is too bad. Actually a month ago I changed the internal structure of parameter implementation and that might have caused such the strange behavior.

I'm not so familiar with the implementation of error handler and parameter

You can learn it from now on :)

@leon-vv
Copy link
Contributor Author

leon-vv commented Jan 23, 2015

@KeenS yes that should've been it. Will edit 👍

@KeenS
Copy link
Member

KeenS commented Jun 9, 2015

53a9e72 fixes this issue.

@KeenS KeenS closed this as completed Jun 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants