Bug 191871 - comms/trustedqsl trustedqsl-2.0.2 crashes on 10.0-STABLE
Summary: comms/trustedqsl trustedqsl-2.0.2 crashes on 10.0-STABLE
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Stephen Hurd
URL: https://github.com/jj1bdx/trustedqsl-...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-15 04:01 UTC by Kenji Rikitake
Modified: 2014-07-18 23:29 UTC (History)
2 users (show)

See Also:


Attachments
comms/trustedqsl build log (20.84 KB, text/plain)
2014-07-15 04:01 UTC, Kenji Rikitake
no flags Details
tqsl gdb backtrace log (13.75 KB, text/plain)
2014-07-15 04:02 UTC, Kenji Rikitake
no flags Details
This is an experimental meta-patch for the shurd's patch of XMLelement (1.26 KB, patch)
2014-07-17 02:27 UTC, Kenji Rikitake
no flags Details | Diff
Patches for CLI tools, src/converter.cpp and src/gen_crq.cpp (670 bytes, patch)
2014-07-17 02:44 UTC, Kenji Rikitake
no flags Details | Diff
Quick and dirty work-around (922 bytes, application/octet-stream)
2014-07-17 12:39 UTC, Stephen Hurd
no flags Details
tqsl crash log after shurd's patch (12.58 KB, text/plain)
2014-07-17 12:52 UTC, Kenji Rikitake
no flags Details
Updated port with better shaed_ptr usage. (5.48 KB, application/x-gzip)
2014-07-17 23:46 UTC, Stephen Hurd
no flags Details
tqsl failure log (gdb backtrace) after the patch of 2.0.2_1 (13.07 KB, text/plain)
2014-07-18 00:09 UTC, Kenji Rikitake
no flags Details
Patch for openssl_cert.cpp to fix tqsl crash (1.08 KB, patch)
2014-07-18 02:00 UTC, Kenji Rikitake
no flags Details | Diff
Patch for openssl_cert.cpp to fix tqsl crash (1.21 KB, patch)
2014-07-18 02:46 UTC, Kenji Rikitake
no flags Details | Diff
Finally, a working fix (I think) (6.73 KB, application/x-gtar)
2014-07-18 12:48 UTC, Stephen Hurd
no flags Details
TrustedQSL 2.0.3 port (5.81 KB, application/x-gtar)
2014-07-18 20:10 UTC, Stephen Hurd
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kenji Rikitake 2014-07-15 04:01:44 UTC
Created attachment 144677 [details]
comms/trustedqsl build log

Two major issues:
* distfiles' checksum do not match.
* tqsl does not run and crashes with bus error or segmentation fault.

See the attachment files for the build and gdb backtrace log.
Comment 1 Kenji Rikitake 2014-07-15 04:02:25 UTC
Created attachment 144678 [details]
tqsl gdb backtrace log
Comment 2 Kenji Rikitake 2014-07-16 03:44:27 UTC
I've tried to change the following points and so far the command line tools under src/ (formerly tqsllib CLI tools) are working.  I'm not familiar with the C++ class of dungeons, but I think using the std::shared_ptr on XMLelement no longer works.

* Enable USE_GCC
* Remove all patches regarding std::shared_ptr

See the diffs of the following two GitHub repo tags:

https://github.com/jj1bdx/trustedqsl-private-port/tree/2.0.2-r357863
https://github.com/jj1bdx/trustedqsl-private-port/tree/2.0.2-jj1bdx-CLI-tools
Comment 3 Stephen Hurd freebsd_committer freebsd_triage 2014-07-16 20:52:24 UTC
I'll take this.  They have a braindead tendency to re-roll their distfiles at random and haven't responded to my emails on the subject.
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-07-16 21:07:38 UTC
A commit references this bug:

Author: shurd
Date: Wed Jul 16 21:07:19 UTC 2014
New revision: 362112
URL: http://svnweb.freebsd.org/changeset/ports/362112

Log:
  Copy the version matching the port to my public_distfiles
  and set MASTER_SITES to local for now.  Will fix this soon.

  PR:		ports/191871

Changes:
  head/comms/trustedqsl/Makefile
Comment 5 Kenji Rikitake 2014-07-17 02:27:50 UTC
Created attachment 144737 [details]
This is an experimental meta-patch for the shurd's patch of XMLelement

Actually this is a patch for patches under directory files/.

I am a C++ beginner and I don't really understand how shared_ptr should be handled, but this resolved the build issues of command line tools under src/.
I am sure that I am doing a wrong thing because std::make_shared will create
a new object rather than referring to a raw pointer. I don't know how to handle
this, but I will submit this anyway FYI.

I still cannot make tqsl running, though now it doesn't crash but hang.

I hope shurd will solve this issue soon.
Comment 6 Kenji Rikitake 2014-07-17 02:44:12 UTC
Created attachment 144738 [details]
Patches for CLI tools, src/converter.cpp and src/gen_crq.cpp

This is an enhancement bugfix patch for the CLI tools in src/, namely converter.cpp and gen_crq.cpp.
Comment 7 Stephen Hurd freebsd_committer freebsd_triage 2014-07-17 07:10:27 UTC
Can you provide sample usages you would like me to test in the updated port?  I've never used the command-line stuff, so some examples of what should work would be very helpful.
Comment 8 Stephen Hurd freebsd_committer freebsd_triage 2014-07-17 07:21:07 UTC
Did you originally install from the package or from the port?
Comment 9 Kenji Rikitake 2014-07-17 09:12:58 UTC
(In reply to Stephen Hurd from comment #8)
> Did you originally install from the package or from the port?

From the comm/trustedqsl port.
Comment 10 Kenji Rikitake 2014-07-17 09:15:13 UTC
(In reply to Stephen Hurd from comment #7)
> Can you provide sample usages you would like me to test in the updated port?
> I've never used the command-line stuff, so some examples of what should work
> would be very helpful.

I've never used `tqsl` from the command line either yet.

The sample usage here is:

converter a-log-file.adi

to obtain the converter.tq7 as the result, then make it a .tq8 with

gzip -c -9 converter.tq7 > a-log-file.tq8
Comment 11 Stephen Hurd freebsd_committer freebsd_triage 2014-07-17 12:39:26 UTC
Created attachment 144750 [details]
Quick and dirty work-around

Could you try the attached dirty hack?  This one basically adds a memory leak to prevent early object destruction and *seems* to at least fix tqsl here.  If this works, at least I'll know what the problem is.
Comment 12 Kenji Rikitake 2014-07-17 12:51:32 UTC
(In reply to Stephen Hurd from comment #11)
> Created attachment 144750 [details]
> Quick and dirty work-around
> 
> Could you try the attached dirty hack?  This one basically adds a memory
> leak to prevent early object destruction and *seems* to at least fix tqsl
> here.  If this works, at least I'll know what the problem is.

It still fails and causes segmentation fault. I'll attach the gdb crash log
as tqsl-stillfail-gdb.txt.
Comment 13 Kenji Rikitake 2014-07-17 12:52:29 UTC
Created attachment 144752 [details]
tqsl crash log after shurd's patch
Comment 14 Stephen Hurd freebsd_committer freebsd_triage 2014-07-17 23:46:18 UTC
Created attachment 144763 [details]
Updated port with better shaed_ptr usage.

This should work better, I've dropped the extra wrapper class and am using shared_ptr directly now.

Please test.
Comment 15 Kenji Rikitake 2014-07-18 00:09:34 UTC
Created attachment 144764 [details]
tqsl failure log (gdb backtrace) after the patch of 2.0.2_1

The command line tools now work OK, but tqsl has got crashed again. The failure log suggests creation of ~/.tqsl/cert_status.xml has been failed.
Comment 16 Kenji Rikitake 2014-07-18 00:19:53 UTC
Now 2.0.3 is available:
http://sourceforge.net/projects/trustedqsl/files/TrustedQSL/v2.0.3/
FYI
Comment 17 Stephen Hurd freebsd_committer freebsd_triage 2014-07-18 01:45:19 UTC
Comment on attachment 144764 [details]
tqsl failure log (gdb backtrace) after the patch of 2.0.2_1

The 2.0.3 is likely the RC for the next release.  I'm not chasing RCs again until I manage to actually contact the authours.

As for the tqsl crash, I should be able to look at it when I'm in front of my system at home (about another seven hours).  I expect it's a straightforward fix now.
Comment 18 Kenji Rikitake 2014-07-18 02:00:03 UTC
Created attachment 144768 [details]
Patch for openssl_cert.cpp to fix tqsl crash

I revised the openssl_cert.cpp to explicitly define the shared pointers in tqsl_setCertificateStatus().

See also https://github.com/jj1bdx/trustedqsl-private-port/commit/3b4c8aee8dc2dddaf85315af3a37bbebd2fac13b
Comment 19 Kenji Rikitake 2014-07-18 02:02:10 UTC
I've made a fix to openssl_cert.cpp. Please test this.

BTW I have no objection on chasing strategy of the upstream change.

(In reply to Stephen Hurd from comment #17)
> Comment on attachment 144764 [details]
> tqsl failure log (gdb backtrace) after the patch of 2.0.2_1
> 
> The 2.0.3 is likely the RC for the next release.  I'm not chasing RCs again
> until I manage to actually contact the authours.
> 
> As for the tqsl crash, I should be able to look at it when I'm in front of
> my system at home (about another seven hours).  I expect it's a
> straightforward fix now.
Comment 20 Kenji Rikitake 2014-07-18 02:44:51 UTC
Comment on attachment 144768 [details]
Patch for openssl_cert.cpp to fix tqsl crash

This patch is obsolete. Use the new one.
Comment 21 Kenji Rikitake 2014-07-18 02:46:05 UTC
Created attachment 144769 [details]
Patch for openssl_cert.cpp to fix tqsl crash

This is a revised patch for openssl_cert.cpp to fix the usage of the shared_ptr in tqsl_setCertificateStatus().
Comment 22 Kenji Rikitake 2014-07-18 02:48:21 UTC
(In reply to Kenji Rikitake from comment #18)
> Created attachment 144768 [details]
> Patch for openssl_cert.cpp to fix tqsl crash
> 
> I revised the openssl_cert.cpp to explicitly define the shared pointers in
> tqsl_setCertificateStatus().
> 
> See also
> https://github.com/jj1bdx/trustedqsl-private-port/commit/
> 3b4c8aee8dc2dddaf85315af3a37bbebd2fac13b

See also updating diff at
https://github.com/jj1bdx/trustedqsl-private-port/commit/26a88f70a48f54fbf1ea9dec08efe6b68ca27cb0
Comment 23 Stephen Hurd freebsd_committer freebsd_triage 2014-07-18 12:48:11 UTC
Created attachment 144778 [details]
Finally, a working fix (I think)

After a number of long trips down dead ends, I think I've finally gotten it all set.

Please test this, I'm running it on Redports overnight, and will hopefully be able to commit it tomorrow.

Thanks for all the help!
Comment 24 Kenji Rikitake 2014-07-18 13:04:25 UTC
(In reply to Stephen Hurd from comment #23)
> Created attachment 144778 [details]
> Finally, a working fix (I think)
> 
> After a number of long trips down dead ends, I think I've finally gotten it
> all set.
> 
> Please test this, I'm running it on Redports overnight, and will hopefully
> be able to commit it tomorrow.
> 
> Thanks for all the help!

Looks OK to me. Many thanks!
Comment 25 Stephen Hurd freebsd_committer freebsd_triage 2014-07-18 20:10:37 UTC
Created attachment 144784 [details]
TrustedQSL 2.0.3 port

It looks like the 2.0.3 release is a "real" release and not an RC.  Since it has the following changelist description, it's worth chasing:

Fix defect that doesn't allow adding station locations if only a single
callsign certificate is installed.
Comment 26 commit-hook freebsd_committer freebsd_triage 2014-07-18 21:42:52 UTC
A commit references this bug:

Author: shurd
Date: Fri Jul 18 21:42:34 UTC 2014
New revision: 362230
URL: http://svnweb.freebsd.org/changeset/ports/362230

Log:
  Fix TQSL issues when build with Clang (previous patches were not enough)
  Update to 2.0.3
  Add options for the extra (deprecated) command-line utilities

  From ChangeLog.txt:
  - Fix defect that doesn't allow adding station locations if only a single
    callsign certificate is installed.

  Thanks Kenji!

  PR:		ports/191871

Changes:
  head/comms/trustedqsl/Makefile
  head/comms/trustedqsl/distinfo
  head/comms/trustedqsl/files/patch-src_converter.cpp
  head/comms/trustedqsl/files/patch-src_gen_crq.cpp
  head/comms/trustedqsl/files/patch-src_location.cpp
  head/comms/trustedqsl/files/patch-src_openssl_cert.cpp
  head/comms/trustedqsl/files/patch-src_xml.cpp
  head/comms/trustedqsl/files/patch-src_xml.h
  head/comms/trustedqsl/pkg-plist
Comment 27 Kenji Rikitake 2014-07-18 23:09:00 UTC
Confimed 2.0.3 worked OK. Many thanks Stephen!

(In reply to commit-hook from comment #26)
> A commit references this bug:
> 
> Author: shurd
> Date: Fri Jul 18 21:42:34 UTC 2014
> New revision: 362230
> URL: http://svnweb.freebsd.org/changeset/ports/362230
> 
> Log:
>   Fix TQSL issues when build with Clang (previous patches were not enough)
>   Update to 2.0.3
>   Add options for the extra (deprecated) command-line utilities
> 
>   From ChangeLog.txt:
>   - Fix defect that doesn't allow adding station locations if only a single
>     callsign certificate is installed.
> 
>   Thanks Kenji!
> 
>   PR:		ports/191871
> 
> Changes:
>   head/comms/trustedqsl/Makefile
>   head/comms/trustedqsl/distinfo
>   head/comms/trustedqsl/files/patch-src_converter.cpp
>   head/comms/trustedqsl/files/patch-src_gen_crq.cpp
>   head/comms/trustedqsl/files/patch-src_location.cpp
>   head/comms/trustedqsl/files/patch-src_openssl_cert.cpp
>   head/comms/trustedqsl/files/patch-src_xml.cpp
>   head/comms/trustedqsl/files/patch-src_xml.h
>   head/comms/trustedqsl/pkg-plist
Comment 28 Stephen Hurd freebsd_committer freebsd_triage 2014-07-18 23:29:17 UTC
Committed and tested.