![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Yup ... that's really close. I'm going to do a few tests to try to figure out what's going on with my environment and let you know if I come up with anything odd. |
#2
| |||
| |||
|
|
I use the FreeBSD PostgreSQL port and I set the option to use threads so that pl/python will work with PostgreSQL. |
#3
| |||
| |||
|
|
"Brian B." <brian-pgsql (AT) bbdab (DOT) org> writes: I use the FreeBSD PostgreSQL port and I set the option to use threads so that pl/python will work with PostgreSQL. What option is that, exactly? It's entirely possible that something has decided that the backend is going to be multithreaded and is only giving the "main" thread a 1MB-or-so stack. If so, I would regard this as a build error. We do not want threading libraries linked into the backend. |

#4
| |||
| |||
|
|
When setting the "LIBC_R" option, the FreeBSD port essentially sets CFLAGS to -D_THREAD_SAFE and LDFLAGS to -pthread. This is probably due to the Python procedural handler not being able to link with PostgreSQL until PostgreSQL is built pthread-aware. |
#5
| |||
| |||
|
|
"Brian B." <brian-pgsql (AT) bbdab (DOT) org> writes: When setting the "LIBC_R" option, the FreeBSD port essentially sets CFLAGS to -D_THREAD_SAFE and LDFLAGS to -pthread. This is probably due to the Python procedural handler not being able to link with PostgreSQL until PostgreSQL is built pthread-aware. Hmm, is that a FreeBSD-specific restriction? I've not had any such trouble on Linux or Mac OS X. |
#6
| |||
| |||
|
|
BTW, something that would be interesting is to figure out what the thread stack size actually is (I assume this is available in the FreeBSD docs) and experiment to find what is the maximum value max_stack_depth can be set to without letting infinite_recurse() dump core. |
#7
| |||
| |||
|
|
You may be onto something, there. After doing some searching, I have found the FreeBSD thread stack size as a default of 64KB! |
#8
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |