Aw: Re: problem with example 'dlg02'

cage cage-dev at twistfold.it
Mon Jan 30 17:53:53 UTC 2023


On Sun, Jan 29, 2023 at 10:54:52PM +0100, you wrote:
> Hello cage,

Hi!!

[...]

> I  also tried  to narrow  down the  source of  the error,  basically
> getting to the same conclusion, that  it is a low-level cffi problem
> in  accessing the  alternate  character  set ACS  used  to draw  the
> borders.

>  I also tried [...] I guess  _something_ changed in the underlying C
> libraries, which are updated all the  time, and code that worked for
> years now doesn't, a pretty scary thought.

It is, indeed! O_O

>
> But after a helpful discussion in #sbcl, the cause and thankfully a solution was quickly found.

🎉🎉

> For the sake of completeness, this is a minimal ncurses example, based on your test-menu, which triggers the bug without any of the library overhead except cffi:

[...]

> As soon as the function is called at run time, as in
>
> (defun main ()
>   (initscr)
>   (addch (cffi:mem-aref (cffi:foreign-symbol-pointer "acs_map")
>                         :uint32
>                         (char-code #\l)))
>   (refresh)
>   (getch)
>   (endwin))
>
> the error doesnt occur any more. So the fix for the whole library is just that one line in the acs function, which is the only place the acs_map C array is accessed. I'm going to push that
+change in a minute, when you find time, please test and confirm that it also works for you.

I have tested both the example above  and the original code i posted a
couple of days ago, I can confirm both work like a charm! :)

> Thanks for the report and the test case, it greatly accelerated the search.

Thanks to you for all your work!

Also I have learnt something new about sbcl and cffi! :))

Now after your patch i should be  able to update tinmop and unlock the
proposed updating of croatoan on  guix (a kind person seems interested
on working on packaging the library!).

for reference:

https://issues.guix.gnu.org/issue/60944

Bye!
C.



More information about the croatoan-devel mailing list