Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jul 2000 09:06:17 +0300
From:      "Ari Suutari" <ari@suutari.iki.fi>
To:        <midom@dammit.lt>
Cc:        <ports@FreeBSD.org>
Subject:   FreeBSD Port: kannel-0.10.2
Message-ID:  <000601bff210$9ff475a0$0e05a8c0@intranet.syncrontech.com>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

------=_NextPart_000_0003_01BFF229.C39424B0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hi,

I just tried kannel-0.10.2 port. Compiles OK, but 
segfaults after mobile phone requests a page. 

I can think of two things that I have used with kannel
that don't exist in port:

1) I have configured it with

$ CFLAGS="-pthread" ./configure

to get -pthread flag to compiler.

2) On FreeBSD the pthread stack default size
seems to be 64k, which is too little for kannel.
I'll attach a patch to fix this one.

With these two changes I have been able to use
kannel to view our application pages with mobile phones.

      Ari S.
--
Ari Suutari <ari@suutari.iki.fi>
Lemi, Finland


------=_NextPart_000_0003_01BFF229.C39424B0
Content-Type: application/octet-stream;
	name="gwthread-pthread.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="gwthread-pthread.diff"

*** gwthread-pthread.c.orig	Tue Jul 18 15:08:24 2000
--- gwthread-pthread.c	Wed Jul 19 13:23:39 2000
***************
*** 58,63 ****
--- 58,68 ----
  pthread_key_t tsd_key;
  
  pthread_mutex_t threadtable_lock;
+ /*
+  * Thread creation parameters.
+  */
+ static pthread_attr_t	thread_attr;
+ #define MIN_THREAD_STACK_SIZE	(256 * 1024)
  
  static void lock(void) {
  	int ret;
***************
*** 172,177 ****
--- 177,183 ----
  void gwthread_init(void) {
  	int ret;
  	int i;
+ 	int stack_size;
  
  	pthread_mutex_init(&threadtable_lock, NULL);
  
***************
*** 184,189 ****
--- 190,202 ----
  		threadtable[i] = NULL;
  	}
  	active_threads = 0;
+ /*
+  * Make sure that thread stack is large enough.
+  */
+ 	pthread_attr_init(&thread_attr);
+ 	pthread_attr_getstacksize(&thread_attr, &stack_size);
+ 	if (stack_size < MIN_THREAD_STACK_SIZE)
+ 		pthread_attr_setstacksize(&thread_attr, MIN_THREAD_STACK_SIZE);
  
  	create_threadinfo_main();
  }
***************
*** 285,291 ****
  		return -1;
  	}
  
! 	ret = pthread_create(&id, NULL, &new_thread, p);
  	if (ret != 0) {
  		unlock();
  		error(ret, "Could not create new thread.");
--- 298,304 ----
  		return -1;
  	}
  
! 	ret = pthread_create(&id, &thread_attr, &new_thread, p);
  	if (ret != 0) {
  		unlock();
  		error(ret, "Could not create new thread.");

------=_NextPart_000_0003_01BFF229.C39424B0--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000601bff210$9ff475a0$0e05a8c0>