dk / Prima

prima.eu.org
Other
106 stars 27 forks source link

Prima::Application + threads segfault #43

Closed Corion closed 7 years ago

Corion commented 7 years ago

Prima-threads.t.txt

This is a weird interaction between Prima and threads, but it only manifests itself when just compiling things, not when running a program. See the attached test file which shows that:

  1. Running a program that consists of

use Prima 'Application'; use threads;

exits without problem

  1. Compiling such a program with "perl -wc" crashes at the end on Perl 5.22, Windows.

I'm not sure where/how to track down the reason - I guess it has something to do with a resource that is not allocated at compile time and then freed in global cleanup, and usually is initialized. I don't know where/how threads.pm comes into play or if that is just bad luck.

dk commented 7 years ago

Hi Max,

It seems that END is not called in -c mode, which causes the bug. I've removed the corresponding init() part, so the script that you added won't work anyway because Prima::Application won't get initialized. But it won't coredump.

Please try if that works for you

Corion commented 7 years ago

No, sorry, that doesn't change the symptoms. I've commented out that line for a try and it didn't change anything either.

dk commented 7 years ago

Oh yes sorry, I didn't try under Windows. Please try now?

Corion commented 7 years ago

Yep, that fixes the issue for me as well!

Thanks for the prompt response!