Modify

Ticket #67 (assigned defect)

Opened 7 years ago

Last modified 3 days ago

PySyck does not work on 64 bit machine

Reported by: miki@… Owned by: xi
Priority: normal Component: pysyck
Severity: normal Keywords:
Cc:

Description

Trying to use latest version of syck from CVS and PySyck from svn on the 64 bit machine.

When compiling syck regular built syck we get:

mtebeka@news01:src - 13:55 $ cd pysyck-trunk/
/home/mtebeka/src/pysyck-trunk
mtebeka@news01:pysyck-trunk - 13:55 $ rm -fr build/
mtebeka@news01:pysyck-trunk - 13:55 $ python setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.5
creating build/lib.linux-x86_64-2.5/syck
copying lib/syck/__init__.py -> build/lib.linux-x86_64-2.5/syck
copying lib/syck/dumpers.py -> build/lib.linux-x86_64-2.5/syck
copying lib/syck/loaders.py -> build/lib.linux-x86_64-2.5/syck
running build_ext
checking for syck.h
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I../syck/lib -I/usr/local/include/python2.5 -c ./_check_syck.c -o ./_check_syck.o
In file included from ../syck/lib/syck.h:39,
                 from ./_check_syck.c:2:
../syck/lib/syck_st.h:12: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:13: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:27: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:28: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:29: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:30: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:31: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:32: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:33: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:33: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:34: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:34: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:35: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:35: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:35: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:35: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:36: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:44: warning: function declaration isn’t a prototype
In file included from ./_check_syck.c:2:
../syck/lib/syck.h:385: warning: function declaration isn’t a prototype
../syck/lib/syck.h:412: warning: function declaration isn’t a prototype
../syck/lib/syck.h:438: warning: function declaration isn’t a prototype
../syck/lib/syck.h:439: warning: function declaration isn’t a prototype
../syck/lib/syck.h:440: warning: function declaration isn’t a prototype
checking for libsyck.a
gcc -pthread ./_check_syck.o -L../syck/lib -lsyck -o ./_check_syck
checking syck version
syck version: 0.61
building '_syck' extension
creating build/temp.linux-x86_64-2.5
creating build/temp.linux-x86_64-2.5/ext
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I../syck/lib -I/usr/local/include/python2.5 -c ext/_syckmodule.c -o build/temp.linux-x86_64-2.5/ext/_syckmodule.o
In file included from ../syck/lib/syck.h:39,
                 from ext/_syckmodule.c:3:
../syck/lib/syck_st.h:12: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:13: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:27: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:28: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:29: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:30: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:31: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:32: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:33: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:33: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:34: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:34: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:35: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:35: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:35: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:35: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:36: warning: function declaration isn’t a prototype
../syck/lib/syck_st.h:44: warning: function declaration isn’t a prototype
In file included from ext/_syckmodule.c:3:
../syck/lib/syck.h:385: warning: function declaration isn’t a prototype
../syck/lib/syck.h:412: warning: function declaration isn’t a prototype
../syck/lib/syck.h:438: warning: function declaration isn’t a prototype
../syck/lib/syck.h:439: warning: function declaration isn’t a prototype
../syck/lib/syck.h:440: warning: function declaration isn’t a prototype
ext/_syckmodule.c: In function ‘PySyckEmitter_node_handler’:
ext/_syckmodule.c:1691: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
ext/_syckmodule.c:1722: warning: passing argument 3 of ‘PyString_AsStringAndSize’ from incompatible pointer type
ext/_syckmodule.c: In function ‘PySyckEmitter_mark’:
ext/_syckmodule.c:1921: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
gcc -pthread -shared build/temp.linux-x86_64-2.5/ext/_syckmodule.o -L../syck/lib -lsyck -o build/lib.linux-x86_64-2.5/_syck.so
/usr/bin/ld: ../syck/lib/libsyck.a(emitter.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
../syck/lib/libsyck.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
mtebeka@news01:pysyck-trunk - 13:55 $ 

So I've compiled syck with CFLAGS=-fPIC ./configure && make

Then PySyck builds just fine, however:

mtebeka@news01:lib.linux-x86_64-2.5 - 13:57 $ python -c 'import syck; syck.dump("hello")'
Fatal Python error: PyEval_RestoreThread: NULL tstate
Aborted
mtebeka@news01:lib.linux-x86_64-2.5 - 13:57 $ 

Attachments

_syckmodule.diff Download (7.7 KB) - added by xi 6 years ago.
a patch to remove GIL management
64-bit.patch Download (701 bytes) - added by anonymous 5 years ago.
fix compile warnings on 64-bit machine

Change History

comment:1 Changed 6 years ago by xi

  • Status changed from new to assigned

I have no idea what could case the segfault on a 64 bit machine. Could you possibly post a stack trace?

I'm not even sure if it's a PySyck issue, it might be a bug in the syck code. Could you try to build and run some of the test programs in source:pysyck/trunk/sandbox? For instance, source:pysyck/trunk/sandbox/syck-parser/syck-parser.c or source:pysyck/trunk/sandbox/emit-it/emit-it.c

I've attached a patch to pysyck, which might help with the issue. Please let me know whether it works or not.

Changed 6 years ago by xi

a patch to remove GIL management

comment:2 Changed 5 years ago by ethan.glasser.camp@…

I came across a couple problems with running PySyck on a 64-bit machine (a VPS actually). I didn't get any seg faults, but I did get mysterious failures with objects not getting marked in the emitter. I fixed it by changing a couple "int" types to Py_ssize_t to fix the compile warnings.

Changed 5 years ago by anonymous

fix compile warnings on 64-bit machine

comment:3 Changed 5 years ago by ethan.glasser.camp@…

It seems like pysyck is deprecated, and users should migrate towards pyyaml. If this is true, could you please mark it on the front page?

Ethan

comment:4 Changed 3 days ago by maskodok <galihadiputro87@…>

The only thing more I could hope for is documentation of all these features (other than reading through the code).  Cipto Junaedy Is this in process? Can I help? About  Unit Link Terbaik di Indonesia Commonwealth Life Investra Link

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as assigned
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from xi. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.