I would suggest filing the bug report with the distribution's bug tracking system, if you are using their build.
They can then escalate the bug report to the upstream maintainer, should it turn out that it exists in a vanilla build as well.
The rationale behind this is simply that since many distributions apply patches of their own, unless you are certain that the bug exists in a vanilla build, the packager is likely in a better position to be able to test both possible configurations (vanilla and patched) than an upstream developer who might even be running their system on a completely different architecture that your distribution of choice doesn't even support.
Depending on the complexity of the program and what kind of unexplainable behavior you are seeing, it might even make sense to file a bug against the distribution's bug tracker even if you are using a vanilla build of the program in question but patched versions of any dependencies.
You can certainly escalate the bug to the upstream maintainer if you get no response from the distribution's package maintainer for a reasonable amount of time. In that case, include a link to the original report as well, for context, and cross-reference in the distribution's bug tracking system so that it is easy to go from one to the other.
Bottom line: don't bother the upstream maintainers unless it's a problem with their code or the distribution maintainer is completely unresponsive.