Re: Debian Linux
Posted in 2003
Jack wrote:
> Andreas Breitfeld <abreitfe@de.ibm.com> wrote in message
> news:<blbgln$13do$1@gazette.almaden.ibm.com>...
>> Cindy Lichtenauer wrote:
>>
>> > Anyone have any successful experience with Informix on Debian Linux?
>> >
>> > Will IDS 9.4 run on it?
>>
>> Yes, but for Debian 3.0r1 you need a patched libpthread.so for IDS 9.4.
>>
>> Andreas
>>
>> ------------
>> Build a patched libpthread.so (see attached
>> libifxpthread-glibc225.patch) using following steps as user root:
>> # cp libifxpthread-glibc225.patch /tmp
>> Install kernel headers (Debian 3.0r1 official binary CD #6):
>> # apt-cdrom
>> # apt-get install kernel-headers
>> compile glibc sources (Debian 3.0r1 official source CD #1):
>> # apt-cdrom
>> # mkdir source
>> # cd source
>> # apt-get --compile source glibc>> Patch the glibc sources:
>> # cd glibc-2.2.5/glibc-2.2.5/linuxthreads
>> # cat /tmp/libifxpthread-glibc225.patch | patch -b>> Compile libpthread.so:
>> # cd ../../i386-linux/obj
>> # make
>> Install libifxpthread.so.4:
>> # export INFORMIXDIR=/opt/informix (example, IDS 9.40 directory)
>> # cp linuxthreads/libpthread.so $INFORMIXDIR/lib/libifxpthread.so.4
>> # chown informix:informix $INFORMIXDIR/lib/libifxpthread.so.4
>> # chmod 755 $INFORMIXDIR/lib/libifxpthread.so.4
>> # ln -s $INFORMIXDIR/lib/libifxpthread.so.4 /var/lib/libpthread.so.0>> Check oninit for right path to libpthread.so.0:
>> # ldd $INFORMIXDIR/bin/oninit
>> libpthread.so.0 => /var/lib/libpthread.so.0
>>
>> --
>
> hello,
>
> Could you point me to a place where this lib or patch exist? Thanks.
> Regards,
> Jack
Obviously the attached file was removed by some News archives. Following is
the text of libifxpthread-glibc225.patch (please take care because line
wraps):
--- ./internals.h.ori Wed Apr 23 15:09:34 2003
+++ ./internals.h Wed Apr 23 15:18:39 2003
@@ -267,6 +267,15 @@
extern char *__pthread_initial_thread_bos;
+/* lowest bottom of stack of any other thread ever allocated
+ This is used for checking stack pointer between this value
+ and __pthread_initial_thread_bos to check other threads
+ before checking initial threads stack. This enables switching
+ the stack of the initial thread (in user level multithreading)
+ and make thread_self() working correctly. see also internals.h */
+
+extern char *__pthread_other_threads_lowest_bos;
+
/* Indicate whether at least one thread has a user-defined stack (if 1),
or all threads have stacks supplied by LinuxThreads (if 0). */
@@ -382,16 +391,27 @@
return THREAD_SELF;
#else
char *sp = CURRENT_STACK_FRAME;
- if (sp >= __pthread_initial_thread_bos)
- return &__pthread_initial_thread;
- else if (sp >= __pthread_manager_thread_bos
- && sp < __pthread_manager_thread_tos)
+ if (sp >= __pthread_manager_thread_bos
+ && sp < __pthread_manager_thread_tos)
return &__pthread_manager_thread;
- else if (__pthread_nonstandard_stacks)
- return __pthread_find_self();
- else
#ifdef _STACK_GROWS_DOWN
- return (pthread_descr)(((unsigned long)sp | (STACK_SIZE-1))+1) - 1;
+ else
+ {
+ if(__pthread_nonstandard_stacks)
+ {
+ pthread_descr pd;
+ if( (pd = __pthread_find_self()) != NULL )
+ return pd;
+ }
+ else
+ {
+ if( __pthread_other_threads_lowest_bos != NULL &&
+ sp < __pthread_initial_thread_bos &&
+ sp >= __pthread_other_threads_lowest_bos )
+ return (pthread_descr)(((unsigned long)sp | (STACK_SIZE-1))+1) - 1;
+ }
+ }
+ return &__pthread_initial_thread;
#else
return (pthread_descr)((unsigned long)sp &~ (STACK_SIZE-1));
#endif
--- ./pthread.c.ori Wed Apr 23 15:19:18 2003
+++ ./pthread.c Wed Apr 23 15:22:55 2003
@@ -168,6 +168,15 @@
char *__pthread_initial_thread_bos;
+/* lowest bottom of stack of any other thread ever allocated
+ This is used for checking stack pointer between this value
+ and __pthread_initial_thread_bos to check other threads
+ before checking initial threads stack. This enables switching
+ the stack of the initial thread (in user level multithreading)
+ and make thread_self() working correctly. see also internals.h */
+
+char *__pthread_other_threads_lowest_bos = NULL;
+
/* File descriptor for sending requests to the thread manager. */
/* Initially -1, meaning that the thread manager is not running. */
@@ -717,8 +726,12 @@
/* __pthread_handles[0] is the initial thread, __pthread_handles[1] is
the manager threads handled specially in thread_self(), so start at 2
*/
h = __pthread_handles + 2;
- while (! (sp <= (char *) h->h_descr && sp >= h->h_bottom)) h++;
- return h->h_descr;
+ while (! (sp <= (char *) h->h_descr && sp >= h->h_bottom &&
+ h < (__pthread_handles + PTHREAD_THREADS_MAX) )) h++;
+ if( h < (__pthread_handles + PTHREAD_THREADS_MAX) )
+ return h->h_descr;
+ else
+ return NULL;
}
#else
--- ./manager.c.ori Wed Apr 23 15:24:25 2003
+++ ./manager.c Wed Apr 23 15:27:56 2003
@@ -487,6 +487,10 @@
return -1;
}
+ if( __pthread_other_threads_lowest_bos == NULL ||
+ __pthread_other_threads_lowest_bos > new_thread_bottom )
+ __pthread_other_threads_lowest_bos = new_thread_bottom;
+
/* We manage to get a stack. Protect the guard area pages if
necessary. */
guardaddr = map_addr;