librelist archives

« back to archive

Using multicorn cause Segmentation fault on debian 64bits

Using multicorn cause Segmentation fault on debian 64bits

From:
Grégoire Robin
Date:
2012-01-17 @ 14:08
Hi, 

 

I tried to use the imap data wrapper and other wrapper included but I got a
seg fault :/ 

 

CREATE EXTENSION multicorn => Everything is OK

 

CREATE SERVER multicorn_imap FOREIGN DATA WRAPPER multicorn

options (

  wrapper 'multicorn.imapfdw.ImapFdw'

);

 

I am disconnected from the server. And in postrgres.log I have this :
2012-01-17 14:29:25 CET LOG:  processus serveur (PID 6024) a ?t? arr?t? par
le signal 11 : Segmentation fault

 

I run a debian squeeze X86_64 using python 2.6 and pg_config tell :

 

# pg_config

BINDIR = /usr/lib/postgresql/9.1/bin

DOCDIR = /usr/share/doc/postgresql-doc-9.1

HTMLDIR = /usr/share/doc/postgresql-doc-9.1

INCLUDEDIR = /usr/include/postgresql

PKGINCLUDEDIR = /usr/include/postgresql

INCLUDEDIR-SERVER = /usr/include/postgresql/9.1/server

LIBDIR = /usr/lib

PKGLIBDIR = /usr/lib/postgresql/9.1/lib

LOCALEDIR = /usr/share/locale

MANDIR = /usr/share/postgresql/9.1/man

SHAREDIR = /usr/share/postgresql/9.1

SYSCONFDIR = /etc/postgresql-common

PGXS = /usr/lib/postgresql/9.1/lib/pgxs/src/makefiles/pgxs.mk

CONFIGURE = '--with-tcl' '--with-perl' '--with-python' '--with-pam'
'--with-krb5' '--with-gssapi' '--with-openssl' '--with-libxml'
'--with-libxslt' '--with-ldap' '--with-tclconfig=/usr/lib/tcl8.5'
'--with-tkconfig=/usr/lib/tk8.5' '--with-includes=/usr/include/tcl8.5'
'PYTHON=/usr/bin/python' '--mandir=/usr/share/postgresql/9.1/man'
'--docdir=/usr/share/doc/postgresql-doc-9.1'
'--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/'
'--datadir=/usr/share/postgresql/9.1' '--bindir=/usr/lib/postgresql/9.1/bin'
'--libdir=/usr/lib/' '--libexecdir=/usr/lib/postgresql/'
'--includedir=/usr/include/postgresql/' '--enable-nls'
'--enable-integer-datetimes' '--enable-thread-safety' '--enable-debug'
'--disable-rpath' '--with-ossp-uuid' '--with-gnu-ld' '--with-pgport=5432'
'--with-system-tzdata=/usr/share/zoneinfo' 'CFLAGS=-g -O2 -fPIC
-DLINUX_OOM_ADJ=0 -fPIC -DLINUX_OOM_ADJ=0' 'LDFLAGS= -Wl,--as-needed
-Wl,--as-needed' 'CPPFLAGS='

CC = gcc

CPPFLAGS = -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/tcl8.5

CFLAGS = -g -O2 -fPIC -DLINUX_OOM_ADJ=0 -fPIC -DLINUX_OOM_ADJ=0 -Wall
-Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement
-Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -g

CFLAGS_SL = -fpic

LDFLAGS = -Wl,--as-needed -Wl,--as-needed -Wl,--as-needed

LDFLAGS_EX =

LDFLAGS_SL =

LIBS = -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lkrb5 -lcom_err
-lgssapi_krb5 -lz -lreadline -lcrypt -ldl -lm

VERSION = PostgreSQL 9.1.2

 

Any idea ? 

 

Re: [multicorn] Using multicorn cause Segmentation fault on debian 64bits

From:
Ronan Dunklau
Date:
2012-01-17 @ 16:18
Hi.

On 17/01/2012 15:08, Grégoire ROBIN wrote:


> I run a debian squeeze X86_64 using python 2.6 and pg_config tell :

Multicorn has never been tested against python2.6.
We used a python2.7 module named importlib.
I just got rid of this module, backporting it into multicorn itself.
This fix has just been pushed, so if you try to run the git version it
should now work.

Let me know if you encounter any other issue while running multicorn.


Regards,

--
Ronan Dunklau

Re: [multicorn] Using multicorn cause Segmentation fault on debian 64bits

From:
Grégoire Robin
Date:
2012-01-17 @ 18:48
Just awesome, thank you so much. 
I develop in half a day a mssql fdw :)

\o/



> -----Message d'origine-----
> De : multicorn@librelist.com [mailto:multicorn@librelist.com] De la part de
> Ronan Dunklau
> Envoyé : mardi 17 janvier 2012 17:18
> À : multicorn@librelist.com
> Objet : Re: [multicorn] Using multicorn cause Segmentation fault on debian
> 64bits
> 
> Hi.
> 
> On 17/01/2012 15:08, Grégoire ROBIN wrote:
> 
> 
> > I run a debian squeeze X86_64 using python 2.6 and pg_config tell :
> 
> Multicorn has never been tested against python2.6.
> We used a python2.7 module named importlib.
> I just got rid of this module, backporting it into multicorn itself.
> This fix has just been pushed, so if you try to run the git version it 
should now
> work.
> 
> Let me know if you encounter any other issue while running multicorn.
> 
> 
> Regards,
> 
> --
> Ronan Dunklau

Re: [multicorn] Using multicorn cause Segmentation fault on debian 64bits

From:
Grégoire Robin
Date:
2012-01-18 @ 09:38
Are you interessted in a mssql fdw based on pymssql ? 
It works fine on mssql 2003.

Where can i send it ? 


> -----Message d'origine-----
> De : multicorn@librelist.com [mailto:multicorn@librelist.com] De la part de
> Grégoire ROBIN
> Envoyé : mardi 17 janvier 2012 19:48
> À : multicorn@librelist.com
> Objet : RE: [multicorn] Using multicorn cause Segmentation fault on debian
> 64bits
> 
> Just awesome, thank you so much.
> I develop in half a day a mssql fdw :)
> 
> \o/
> 
> 
> 
> > -----Message d'origine-----
> > De : multicorn@librelist.com [mailto:multicorn@librelist.com] De la
> > part de Ronan Dunklau Envoyé : mardi 17 janvier 2012 17:18 À :
> > multicorn@librelist.com Objet : Re: [multicorn] Using multicorn cause
> > Segmentation fault on debian 64bits
> >
> > Hi.
> >
> > On 17/01/2012 15:08, Grégoire ROBIN wrote:
> >
> >
> > > I run a debian squeeze X86_64 using python 2.6 and pg_config tell :
> >
> > Multicorn has never been tested against python2.6.
> > We used a python2.7 module named importlib.
> > I just got rid of this module, backporting it into multicorn itself.
> > This fix has just been pushed, so if you try to run the git version it
> > should now work.
> >
> > Let me know if you encounter any other issue while running multicorn.
> >
> >
> > Regards,
> >
> > --
> > Ronan Dunklau

Re: [multicorn] Using multicorn cause Segmentation fault on debian 64bits

From:
Grégoire Robin
Date:
2012-01-18 @ 10:43
You'll find the fork here : 
https://github.com/Nodashi/Multicorn

And the mssqlfdw here : 
https://github.com/Nodashi/Multicorn/blob/master/python/multicorn/mssqlfdw.py

I'm not really into python so maybe you can optimize the code, but it 
works great for me

Thanks for your work. 



> -----Message d'origine-----
> De : multicorn@librelist.com [mailto:multicorn@librelist.com] De la part de
> Ronan Dunklau
> Envoyé : mercredi 18 janvier 2012 10:36
> À : multicorn@librelist.com
> Objet : Re: [multicorn] Using multicorn cause Segmentation fault on debian
> 64bits
> 
> You can fork multicorn on github, and we'll look at it.
> 
> Thank you for your contribution !
> 
> --
> Ronan Dunklau
> 
> 
> 
> On 18/01/2012 10:38, Grégoire ROBIN wrote:
> > Are you interessted in a mssql fdw based on pymssql ?
> > It works fine on mssql 2003.
> >
> > Where can i send it ?
> >
> >
> >> -----Message d'origine-----
> >> De : multicorn@librelist.com [mailto:multicorn@librelist.com] De la
> >> part de Grégoire ROBIN Envoyé : mardi 17 janvier 2012 19:48 À :
> >> multicorn@librelist.com Objet : RE: [multicorn] Using multicorn cause
> >> Segmentation fault on debian 64bits
> >>
> >> Just awesome, thank you so much.
> >> I develop in half a day a mssql fdw :)
> >>
> >> \o/
> >>
> >>
> >>
> >>> -----Message d'origine-----
> >>> De : multicorn@librelist.com [mailto:multicorn@librelist.com] De la
> >>> part de Ronan Dunklau Envoyé : mardi 17 janvier 2012 17:18 À :
> >>> multicorn@librelist.com Objet : Re: [multicorn] Using multicorn
> >>> cause Segmentation fault on debian 64bits
> >>>
> >>> Hi.
> >>>
> >>> On 17/01/2012 15:08, Grégoire ROBIN wrote:
> >>>
> >>>
> >>>> I run a debian squeeze X86_64 using python 2.6 and pg_config tell :
> >>>
> >>> Multicorn has never been tested against python2.6.
> >>> We used a python2.7 module named importlib.
> >>> I just got rid of this module, backporting it into multicorn itself.
> >>> This fix has just been pushed, so if you try to run the git version
> >>> it should now work.
> >>>
> >>> Let me know if you encounter any other issue while running multicorn.
> >>>
> >>>
> >>> Regards,
> >>>
> >>> --
> >>> Ronan Dunklau
> >
> >

SQLServer FDW (was: Using multicorn cause Segmentation fault on debian 64bits)

From:
Ronan Dunklau
Date:
2012-01-18 @ 17:51
Looking at the code and how similar it looks to the sqlite database
foreign data wrapper, I thought it would be better to refactor those
modules in a common "remote relational database" foreign data wrapper.

Your code was fine, but I think a more general approach would benefit
other users as well (they won't have to implement one FDW per database
since all quirks are already taken care of by sqlalchemy).

If you're interested, you can test it on the column_types branch.

This branch breaks the foreign data wrapper API, because it replaces the
column names list in the constructor arguments by a mapping from column
names to column definitions (including the types).

There is still work to do with it, but that should not be much:

- restricting the query to the needed column
- restricting the query using the quals

The required options are:

db_url: an sqlalchemy connection string, the format for mssql is here:

http://www.sqlalchemy.org/docs/dialects/mssql.html#module-sqlalchemy.dialects.mssql.pymssql
tablename: the tablename in the foreign database.

I don't know if this would be an acceptable solution for you. In
particular, I don't really know the performance implication of using
sqlalchemy for this.

Regards,

--
Ronan Dunklau

On 18/01/2012 11:43, Grégoire ROBIN wrote:
> You'll find the fork here : 
> https://github.com/Nodashi/Multicorn
> 
> And the mssqlfdw here : 
https://github.com/Nodashi/Multicorn/blob/master/python/multicorn/mssqlfdw.py
> 
> I'm not really into python so maybe you can optimize the code, but it 
works great for me
> 
> Thanks for your work. 
> 
> 
> 
>> -----Message d'origine-----
>> De : multicorn@librelist.com [mailto:multicorn@librelist.com] De la part de
>> Ronan Dunklau
>> Envoyé : mercredi 18 janvier 2012 10:36
>> À : multicorn@librelist.com
>> Objet : Re: [multicorn] Using multicorn cause Segmentation fault on debian
>> 64bits
>>
>> You can fork multicorn on github, and we'll look at it.
>>
>> Thank you for your contribution !
>>
>> --
>> Ronan Dunklau
>>
>>
>>
>> On 18/01/2012 10:38, Grégoire ROBIN wrote:
>>> Are you interessted in a mssql fdw based on pymssql ?
>>> It works fine on mssql 2003.
>>>
>>> Where can i send it ?
>>>
>>>
>>>> -----Message d'origine-----
>>>> De : multicorn@librelist.com [mailto:multicorn@librelist.com] De la
>>>> part de Grégoire ROBIN Envoyé : mardi 17 janvier 2012 19:48 À :
>>>> multicorn@librelist.com Objet : RE: [multicorn] Using multicorn cause
>>>> Segmentation fault on debian 64bits
>>>>
>>>> Just awesome, thank you so much.
>>>> I develop in half a day a mssql fdw :)
>>>>
>>>> \o/
>>>>
>>>>
>>>>
>>>>> -----Message d'origine-----
>>>>> De : multicorn@librelist.com [mailto:multicorn@librelist.com] De la
>>>>> part de Ronan Dunklau Envoyé : mardi 17 janvier 2012 17:18 À :
>>>>> multicorn@librelist.com Objet : Re: [multicorn] Using multicorn
>>>>> cause Segmentation fault on debian 64bits
>>>>>
>>>>> Hi.
>>>>>
>>>>> On 17/01/2012 15:08, Grégoire ROBIN wrote:
>>>>>
>>>>>
>>>>>> I run a debian squeeze X86_64 using python 2.6 and pg_config tell :
>>>>>
>>>>> Multicorn has never been tested against python2.6.
>>>>> We used a python2.7 module named importlib.
>>>>> I just got rid of this module, backporting it into multicorn itself.
>>>>> This fix has just been pushed, so if you try to run the git version
>>>>> it should now work.
>>>>>
>>>>> Let me know if you encounter any other issue while running multicorn.
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> --
>>>>> Ronan Dunklau
>>>
>>>
> 
> 

Re: [multicorn] Using multicorn cause Segmentation fault on debian 64bits

From:
Ronan Dunklau
Date:
2012-01-18 @ 09:35
You can fork multicorn on github, and we'll look at it.

Thank you for your contribution !

--
Ronan Dunklau



On 18/01/2012 10:38, Grégoire ROBIN wrote:
> Are you interessted in a mssql fdw based on pymssql ? 
> It works fine on mssql 2003.
> 
> Where can i send it ? 
> 
> 
>> -----Message d'origine-----
>> De : multicorn@librelist.com [mailto:multicorn@librelist.com] De la part de
>> Grégoire ROBIN
>> Envoyé : mardi 17 janvier 2012 19:48
>> À : multicorn@librelist.com
>> Objet : RE: [multicorn] Using multicorn cause Segmentation fault on debian
>> 64bits
>>
>> Just awesome, thank you so much.
>> I develop in half a day a mssql fdw :)
>>
>> \o/
>>
>>
>>
>>> -----Message d'origine-----
>>> De : multicorn@librelist.com [mailto:multicorn@librelist.com] De la
>>> part de Ronan Dunklau Envoyé : mardi 17 janvier 2012 17:18 À :
>>> multicorn@librelist.com Objet : Re: [multicorn] Using multicorn cause
>>> Segmentation fault on debian 64bits
>>>
>>> Hi.
>>>
>>> On 17/01/2012 15:08, Grégoire ROBIN wrote:
>>>
>>>
>>>> I run a debian squeeze X86_64 using python 2.6 and pg_config tell :
>>>
>>> Multicorn has never been tested against python2.6.
>>> We used a python2.7 module named importlib.
>>> I just got rid of this module, backporting it into multicorn itself.
>>> This fix has just been pushed, so if you try to run the git version it
>>> should now work.
>>>
>>> Let me know if you encounter any other issue while running multicorn.
>>>
>>>
>>> Regards,
>>>
>>> --
>>> Ronan Dunklau
> 
>