sasagawa888 / eisl

ISLisp interpreter/compiler
Other
267 stars 22 forks source link

Array `queue` Out Of Bound when Running on MacOS #299

Closed StarSugar closed 8 months ago

StarSugar commented 9 months ago

Global variable queue_pt never seems to be decremented, and is incremented in the parallel, so array queue goes out of bound.

sasagawa888 commented 9 months ago

Thank you for the bug report. The 'dequeue' is called from 'eval_para.' It seems that 'eval_para' is not functioning correctly on macOS. What specific code is causing the issue?

StarSugar commented 9 months ago

You are welcome. It seems like neither f_plet, f_pcall or f_pexec was ever called. And it seems like main function crashes at line 339 while f_load is running.

sasagawa888 commented 9 months ago

The mechanism is set up to load a file called 'startup.lsp' if it exists at line 339. In the initial state, this file does not exist. Do you have a file named 'startup.lsp' in your environment? Is there any code written in it?

StarSugar commented 9 months ago

I am sorry I said it wrong before, it is actually error at line 317 in main.

    #0 0x14524399c in wrap_pthread_create+0x5c 
    #1 0x10df9db14 in init_para syntax.c:2634
    #2 0x10df5a45a in init_thread main.c:479
    #3 0x10df58c36 in main main.c:317
sasagawa888 commented 9 months ago

I have made a further adjustment to set the worker count to three in case of a failure to determine the number of threads at init_thread(). If this doesn't work, it is likely due to a compatibility issue between the pthread library on macOS and Linux.

StarSugar commented 9 months ago

This has no effect, please change it back for linux users.

sasagawa888 commented 9 months ago

got it. thank you.