NotImplementedError in XMP reading cause segfault
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pyexiv2 |
Fix Committed
|
High
|
Olivier Tilloy |
Bug Description
NotImplementedError in XMP reading cause a crash of my application
with segfault if reading XMP value is directly into a try-except clause.
the code is trivial :
obj = pyexiv2.
obj.read()
...
xk = obj.xmp_keys
for k in xk:
try:
xmp[k] = obj[k].value
except:
pass
else :
xmp = False
>>> Erreur de segmentation
if I try :
for k in xk:
print k, obj[k].value
try:
xmp[k] = obj[k].value
except:
pass
>>>
...
File "oqapy.py", line 2806, in read_infos
self.datas_list = self.meta.
File "/home/
print k, obj[k].value
File "/usr/lib/
self.
File "/usr/lib/
self._value = self._convert_
File "/usr/lib/
raise NotImplementedE
NotImplementedE
Without the line print and with gdb :
$ gdb python
(gdb) set args oqapy.py
(gdb) run
Starting program: /usr/bin/python oqapy.py
[Thread debugging using libthread_db enabled]
Pyexiv version : (0, 2, 2)
Program received signal SIGSEGV, Segmentation fault.
0x0096b4a5 in std::basic_
from /usr/lib/
But, if I insert the loop enterely in the clause try-except :
try:
for k in xk:
xmp[k] = obj[k].value
except:
pass
That's work !
Ok, the following XMP are lost, but no crash
Ubuntu 10.04 + 10.10
python 2.6
pyexiv 0.2.2
Changed in pyexiv2: | |
importance: | Undecided → High |
status: | New → Confirmed |
Thanks for the report Vincent.
Could you please attach an image that causes the issue? I’m curious to see what this "Flash" type is for XMP tags, I’ve never seen it before.
The indentation in your first example seems to be incorrect, and I don’t quite understand the else clause, but the try…except block should definitely catch the exception.