Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 649700 - sci-electronics/freehdl-0.0.8 - segmentation fault in freehdl-v2cc at ?
Summary: sci-electronics/freehdl-0.0.8 - segmentation fault in freehdl-v2cc at ?
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: The Soldering-Iron Brotherhood
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-03-05 22:36 UTC by Vladimir
Modified: 2020-04-25 13:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
freehdl-0.0.8-declerative_region.patch (freehdl-0.0.8-declerative_region.patch,470 bytes, patch)
2018-03-05 22:36 UTC, Vladimir
Details | Diff
freehdl-0.0.8-la.patch (freehdl-0.0.8-la.patch,1.46 KB, patch)
2018-03-05 22:40 UTC, Vladimir
Details | Diff
freehdl-0.0.8-r1.ebuild (freehdl-0.0.8-r1.ebuild,1.03 KB, text/plain)
2018-03-05 22:50 UTC, Vladimir
Details
freehdl-0.0.8-r2.ebuild (freehdl-0.0.8-r2.ebuild,1.17 KB, text/plain)
2020-04-25 13:50 UTC, Vladimir
Details
freehdl-0.0.8-cpp-modern.patch (freehdl-0.0.8-cpp-modern.patch,21.77 KB, patch)
2020-04-25 13:51 UTC, Vladimir
Details | Diff
freehdl-0.0.8-acl-NULL-check.patch (freehdl-0.0.8-acl-NULL-check.patch,1.53 KB, patch)
2020-04-25 13:53 UTC, Vladimir
Details | Diff
freehdl-0.0.8-declarative_region.patch (freehdl-0.0.8-declarative_region.patch,470 bytes, patch)
2020-04-25 13:54 UTC, Vladimir
Details | Diff
freehdl-0.0.8-gvhdl_tag_command.patch (freehdl-0.0.8-gvhdl_tag_command.patch,468 bytes, patch)
2020-04-25 13:55 UTC, Vladimir
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir 2018-03-05 22:36:23 UTC
Created attachment 522474 [details, diff]
freehdl-0.0.8-declerative_region.patch

With sci-electronics/freehdl-0.0.8 the freehdl-v2cc command returns Segmentation fault even for the simplest VHDL demo (https://ghdl.readthedocs.io/en/latest/using/QuickStartGuide.html). It also does for any schematic I tried in Qucs.

I did some backtrace and suggest a patch which seems to fix this issue.

As the source file 'v2cc/v2cc-chunk.t' states,

    ;; respect to the entity). Note that the value is set to NULL if
    ;; the object/declaration/expression is not static at all!
    (IIR_DeclarativeRegion static_declarative_region (= "NULL"))

so my patch provides a simple check of the NULL pointer. I am not sure my solution is correct, but at least, it allows me to use freehdl-v2cc.
Comment 1 Vladimir 2018-03-05 22:40:59 UTC
Created attachment 522476 [details, diff]
freehdl-0.0.8-la.patch

sci-electronics/freehdl-0.0.8 installs the .la files.
This patch is to remove the references to these files, and substitute them by the correct values.

The fix is taken from these posts:
https://bugzilla.redhat.com/show_bug.cgi?id=1207310#c3
https://bugzilla.redhat.com/show_bug.cgi?id=1207310#c6
Comment 2 Vladimir 2018-03-05 22:50:12 UTC
Created attachment 522478 [details]
freehdl-0.0.8-r1.ebuild

This ebuild incorporates the two patches suggested above, and also fixes these problems:

1. undefined reference to L4ieee_Q14std_logic_1164_Y0y0_i51 and several other symbols in libieee.so

This issue is fixed by removing all the .cc files in 'ieee' subdirectory prior to build. These .cc files are generated during the build process, but they are shipped in the package archive for some reason. Probably, it was the developer's mistake. So I simply delete them, and everything builds correctly.

2. Since the .la files are deleted, in order for the later use of the libieee.so library, the '/etc/ld.so.conf.d/freehdl.conf' file is created. This was also grabbed from here: https://bugzilla.redhat.com/show_bug.cgi?id=1207310#c3
Comment 3 Vladimir 2020-04-25 13:50:00 UTC
Created attachment 634540 [details]
freehdl-0.0.8-r2.ebuild

An updated ebuild incorporating all the newly added patches. I am not sure about setting the CXXFLAGS variable inside the ebuild, but I had to add this flag in order to build FreeHDL on relatively modern system.
Comment 4 Vladimir 2020-04-25 13:51:48 UTC
Created attachment 634542 [details, diff]
freehdl-0.0.8-cpp-modern.patch

An updated patch for modern GCC versions in place of the previously used "fix-c++14.patch".
Comment 5 Vladimir 2020-04-25 13:53:19 UTC
Created attachment 634544 [details, diff]
freehdl-0.0.8-acl-NULL-check.patch

This new patch finally fixes a long-lasting problem with segfault because of the NULL pointer.
Comment 6 Vladimir 2020-04-25 13:54:16 UTC
Created attachment 634546 [details, diff]
freehdl-0.0.8-declarative_region.patch

Just fixed the file name (here and in new ebuild too).
Comment 7 Vladimir 2020-04-25 13:55:46 UTC
Created attachment 634548 [details, diff]
freehdl-0.0.8-gvhdl_tag_command.patch

I have no idea what this patch actually fixes, but I found in in Ubuntu package. So I suggest it for the developers' review.