LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.
GNU General Public License v3.0
201 stars 39 forks source link

Core dumped when exiting pyexiv2 #17

Closed toaarnio closed 4 years ago

toaarnio commented 4 years ago

I'm getting various memory allocation related errors when exiting pyexiv2 -- even if I'm just importing it and then immediately exiting. To be clear, everything works just fine, it's just that there's this annoying un-catchable error at the end.

Here's a minimal example:

$ python3 -c "import pyexiv2"
free(): invalid pointer
Aborted (core dumped)
$
$ uname -a
Linux A190311601-1903 4.4.0-17763-Microsoft #253-Microsoft Mon Dec 31 17:49:00 PST 2018 x86_64 x86_64 x86_64 GNU/Linux
$
$ pip3 show pyexiv2
Name: pyexiv2
Version: 2.1.0
Summary: Read/Write metadata of digital image, including EXIF, IPTC, XMP.
Home-page: https://github.com/LeoHsiao1/pyexiv2
Author: LeoHsiao
Author-email: leohsiao@foxmail.com
License: UNKNOWN
Location: /home/toaarnio/.local/lib/python3.6/site-packages
Requires:
Required-by:

I'm running Ubuntu 18.04.4 LTS under Windows 10.

LeoHsiao1 commented 4 years ago

Hi, I reproduced the bug on the WSL (Ubuntu 18.04.2 LTS) . When I press Ctrl+D to exit the Python interpreter, it will core dump:

leo@Leo:~$ python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyexiv2
>>>
double free or corruption (out)
Aborted (core dumped)
leo@Leo:~$

But when I execute exit( ) , it doesn't happen :

leo@Leo:~$ python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyexiv2
>>> exit()
leo@Leo:~$

This is the first time I've seen this kind of problem. I'll spend a few days to debug it.

LeoHsiao1 commented 4 years ago

I have released a new version, v2.2.0, please try it.

toaarnio commented 4 years ago

It's working! Great, thank you!

github-actions[bot] commented 3 years ago

This issue has been automatically closed because there has been no activity for a month.