Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1192849

Summary: hamlib-python crashes on import
Product: [Fedora] Fedora Reporter: Jacek Radzikowski <jacek.radzikowski>
Component: hamlibAssignee: Lucian Langa <lucilanga>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: bobjensen, hobbes1069, jplesnik, jskarvad, lucilanga, mgautier, randyn3lrx, sindrepb
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: hamlib-3.0-1.fc24 hamlib-3.0-2.fc23 hamlib-3.0-2.fc22 hamlib-3.0-2.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-03 17:48:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1180257    
Bug Blocks:    

Description Jacek Radzikowski 2015-02-15 23:09:28 UTC
Description of problem:
Attempt to import Hamlib from python script results in the following error:
-----
 python testhamlib.py 
Traceback (most recent call last):
  File "testhamlib.py", line 2, in <module>
    import Hamlib
  File "/usr/lib64/python2.7/site-packages/Hamlib.py", line 28, in <module>
    _Hamlib = swig_import_helper()
  File "/usr/lib64/python2.7/site-packages/Hamlib.py", line 24, in swig_import_helper
    _mod = imp.load_module('_Hamlib', fp, pathname, description)
ImportError: /usr/lib64/python2.7/site-packages/_Hamlib.so: undefined symbol: struct_Rot_get_position
-----


Version-Release number of selected component (if applicable):
hamlib-1.2.15.3-12.fc21.x86_64
hamlib-python-1.2.15.3-12.fc21.x86_64


How reproducible:
The bug is triggered by the following script:
------
#!/usr/bin/python
import Hamlib
------

Steps to Reproduce:
1. Run the test script: python testhamlib.py

Actual results:
Test script crashes:
$ python testhamlib.py 
Traceback (most recent call last):
  File "testhamlib.py", line 2, in <module>
    import Hamlib
  File "/usr/lib64/python2.7/site-packages/Hamlib.py", line 28, in <module>
    _Hamlib = swig_import_helper()
  File "/usr/lib64/python2.7/site-packages/Hamlib.py", line 24, in swig_import_helper
    _mod = imp.load_module('_Hamlib', fp, pathname, description)
ImportError: /usr/lib64/python2.7/site-packages/_Hamlib.so: undefined symbol: struct_Rot_get_position


Expected results:
No errors

Comment 1 Richard Shaw 2015-02-17 14:31:26 UTC
I can confirm I get the same results on F20... Not sure what's going on. 

It seems to be in there somewhere:
$ grep  "struct_Rot_get_position" /usr/lib/python2.7/site-packages/_Hamlib.so 
Binary file /usr/lib/python2.7/site-packages/_Hamlib.so matches

Comment 2 Jacek Radzikowski 2015-04-30 00:47:07 UTC
I would like to ping on this bug. Is the package still maintained?

Comment 3 Richard Shaw 2015-04-30 03:09:16 UTC
Upstream (if you can call it that, it's basically one guy and some frequent contributors) is active, but most of the effort it going into Hamlib3. I'll see if I can get him to take a look.

Comment 4 Richard Shaw 2015-07-02 02:08:30 UTC
Upstream has not been able to duplicate the problem, it seems to be specific to Fedora and I'm out of ideas.

Comment 5 Michael Schwendt 2015-07-19 13:10:13 UTC
Can you comment on the "implicit declaration of function" warnings in the build.log?

https://kojipkgs.fedoraproject.org//packages/hamlib/1.2.15.3/12.fc21/data/logs/x86_64/build.log

Comment 6 Richard Shaw 2015-07-19 14:07:33 UTC
(In reply to Michael Schwendt (Fedora Packager Sponsors Group) from comment #5)
> Can you comment on the "implicit declaration of function" warnings in the
> build.log?
> 
> https://kojipkgs.fedoraproject.org//packages/hamlib/1.2.15.3/12.fc21/data/
> logs/x86_64/build.log

No, that file is generated by swig... Looking at the first one:

$ grep -r Rig_get_mode .
./bindings/Hamlib.py:    def get_mode(self, *args): return _Hamlib.Rig_get_mode(self, *args)
./bindings/rig.swg:void Rig_get_mode(Rig *self, unsigned *mode, int *width, vfo_t vfo)

I don't know swig at all but that looks like a declaration?

Comment 7 Matthieu Gautier 2015-07-19 16:58:12 UTC
It seems that is a problem with swig package itself.

See bug 1180257

Comment 8 Jitka Plesnikova 2015-09-21 07:00:55 UTC
I removed the swig's patch which caused the issue from all Fedoras.

I checked that hamlib rebuilt against the latest swig solved the bug.

Comment 9 Richard Shaw 2015-09-22 02:09:23 UTC
Fantastic! When you submit the updates can you add this bug so it closes when they go to stable?

Comment 10 Jitka Plesnikova 2015-09-22 06:53:56 UTC
hamlib has to be rebuilt against new swig to solve the issue. It is necessary regenerated the invalid code in hamlib.

I'll create the overrides and rebuild hamlib for all Fedoras.

Comment 11 Fedora Update System 2015-09-22 07:49:35 UTC
hamlib-3.0-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16404

Comment 12 Fedora Update System 2015-09-22 08:09:41 UTC
hamlib-3.0-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16407

Comment 13 Fedora Update System 2015-09-22 08:11:05 UTC
hamlib-3.0-2.fc21 has been submitted as an update to Fedora 21. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16408

Comment 14 Richard Shaw 2015-09-22 12:59:05 UTC
You were too fast for me! I just updated to hamlib 3.0 and in the process was fixing the binding package names (i.e. hamlib-python -> python-hamlib) but missed updating a couple of "Requires:".

There's supposed to be 3.0.1 releasing soon so I may just wait, it only affects the devel package.

Comment 15 Fedora Update System 2015-09-23 03:55:34 UTC
hamlib-3.0-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hamlib'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16404

Comment 16 Fedora Update System 2015-09-23 05:23:00 UTC
hamlib-3.0-2.fc21 has been pushed to the Fedora 21 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hamlib'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16408

Comment 17 Fedora Update System 2015-09-23 21:23:11 UTC
hamlib-3.0-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hamlib'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16407

Comment 18 Fedora Update System 2015-10-03 17:48:55 UTC
hamlib-3.0-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 19 Fedora Update System 2015-10-03 21:15:27 UTC
hamlib-3.0-2.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 20 Fedora Update System 2015-10-03 21:51:44 UTC
hamlib-3.0-2.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.