manuel-serrano / bigloo

a practical Scheme compiler
http://www-sop.inria.fr/indes/fp/Bigloo
Other
135 stars 19 forks source link

TGKILL instead of PTHREADKILL #36

Closed svenha closed 3 years ago

svenha commented 4 years ago

After upgrading to Ubuntu 19.10, bigloo is configured with TGKILL instead of PTHREADKILL. What does this mean? (Recette for pthread will fail in thread-start test.)

svenha commented 4 years ago

More details:

gccx32 /var/tmp/actestsh.c -o /var/tmp/Xactestsh -lpthread
/var/tmp/actestsh.c: In function ‘main’:
/var/tmp/actestsh.c:5:28: error: ‘pthread_kill’ undeclared (first use in this function); did you mean ‘pthread_self’?
fprintf( stderr, "%p", &pthread_kill );
                        ^~~~~~~~~~~~
                        pthread_self
/var/tmp/actestsh.c:5:28: note: each undeclared identifier is reported only once for each function it appears in
svenha commented 4 years ago

I have a fix, see pull request #37

svenha commented 4 years ago

There might be more problems related to pthreads. For example, if building a 32bit version, recette will fail for 11 tests in pthread/recette.

manuel-serrano commented 4 years ago

Hi Sven,

I did not notice any problems on my 32bit platforms but I will investigate. Thanks anyhow for the configuration fix.

svenha commented 4 years ago

Here are more details for the failed tests in pthread/recette. If I have no stack limit or extremely high stack limits (ulimit -S -s 4200000), it works. Any lower stack value causes these test failures.

svenha commented 4 years ago

@manuel-serrano I have more details for the latest unstable version (build for 32-bit). The critical stack size is 4194304. Every value below this value causes an error in pthread or fthread, e.g.

ulimit -S -s 4194300 && make fulltest

Whether I disable gmp or not, does not make any difference. Same for pcre.

manuel-serrano commented 4 years ago

Hi Sven,

I don't think this reflects a particular problem with Bigloo. I have tried the following:

#include <stdio.h>
#include <pthread.h>
#include <errno.h>
#include <string.h>

static void *start_routine( void *x ) { ; }

int main() {
   pthread_t pth;
   fprintf( stderr, "th=%d\n", pthread_create( &pth, 0L, start_routine, 0L ) );
   fprintf( stderr, "%s", strerror( errno ) );
}

and I have compiled that file on a 32bit platform:

gcc foo.c -lpthread

This program run fine with no limit but if you apply the limit you have mentioned I get an error:

th=11
Cannot allocate memory