Bug 248326 - net-p2p/transmission-cli missing flag NDEBUG
Summary: net-p2p/transmission-cli missing flag NDEBUG
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexandre C. Guimarães
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-28 14:50 UTC by ondra
Modified: 2020-07-31 00:53 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (rigoletto)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ondra 2020-07-28 14:50:50 UTC
Current version 3.0 of daemon crashing on TR_ASSERT macros.
More info https://github.com/transmission/transmission/issues/1359

I don't know, which way is the best for fix this

via CMakeList in projet
https://gist.github.com/beam/db0d38387b1602ba0eca41f51dc809ed/revisions
via Makefile port
https://gist.github.com/beam/cfb267bf76fb8e8a99dab7eea30e7ffd/revisions
via patch CMakeList
https://gist.github.com/beam/8073838b05054808b4c8a4a38692df86/revisions

Thanks for help.
Comment 1 Alexandre C. Guimarães freebsd_committer 2020-07-29 08:25:54 UTC
Hi. o/

I'm not experiencing this issue but if I understood correctly, for some reason transmission is being built with debug support by default, and due to some bug the  debug support is making transmission crash.

So, in this scenario, adding `NDEBUG` should fix the crash but not the bug yet. Is that correct?

That said, enabling it on the port `Makefile` sound more correct but I don't see a reason to check if WITH_DEBUG is ON because it is not, hence

`CFLAGS+= -DNDEBUG`

should be enough.

Thanks!
Comment 2 ondra 2020-07-29 08:54:41 UTC
As I understand it, this is not transmission bug. It doesn't crash, its abort.

In my case it abort (SIGABRT) transmission on this:
https://github.com/transmission/transmission/blob/master/libtransmission/peer-io.c#L1324
This TR_ASSERT_MSG marco should by disabled in Release by NDEBUG.
https://github.com/transmission/transmission/issues/1359#issuecomment-664992553

I check WITH_DEBUG because i think NDEBUG should be set for CMAKE_BUILD_TYPE=Release only.
https://stackoverflow.com/questions/34302265/does-cmake-build-type-release-imply-dndebug

Flag WITH_DEBUG=YES changing CMAKE_BUILD_TYPE to Debug  and i don't know if NDEBUG should or should not be set
Comment 3 Alexandre C. Guimarães freebsd_committer 2020-07-29 18:40:52 UTC
Hi, 

I got the idea of the bug from this comment:

https://github.com/transmission/transmission/issues/1359#issuecomment-665005124

Please, could you confirm setting `NDEBUG` ON fixed in practice the abort issue for you?

Thanks!
Comment 4 ondra 2020-07-30 10:06:57 UTC
Yes, NDEBUG flag fixed abort issues in my case.
Comment 5 commit-hook freebsd_committer 2020-07-31 00:53:03 UTC
A commit references this bug:

Author: rigoletto
Date: Fri Jul 31 00:52:41 UTC 2020
New revision: 543840
URL: https://svnweb.freebsd.org/changeset/ports/543840

Log:
  net-p2p/transmission-*: build without debug symbols.

  PR:		248326
  Submitted by:	ondra@bimovi.cz

Changes:
  head/net-p2p/transmission-cli/Makefile
  head/net-p2p/transmission-daemon/Makefile
  head/net-p2p/transmission-gtk/Makefile
  head/net-p2p/transmission-qt/Makefile
  head/net-p2p/transmission-utils/Makefile
Comment 6 Alexandre C. Guimarães freebsd_committer 2020-07-31 00:53:40 UTC
Thank you. :-D