You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the issue does not happen with the Github release x86_64 binary for v3.88.8. We are nevertheless impacted because we always build releases from source.
Trace Output
No trace output can be obtained with --log-level=5, trufflehog crashes in init.
Expected Behavior
Running trufflehog --version should print a version.
Actual Behavior
Any invocation of trufflehog fails with the following stack trace:
Run the binary on a server with a high-end CPU (tested machines all used an Intel Xeon 5318Y)
Environment
OS: Linux
Versions: 5.10.62, 5.15.106, 6.6.69
Additional Context
This bug still stumps us to this day because there's no visible side effect that might explain why this issue occurs only on certain machines. Building the trufflehog binary with Go 1.24 statically and transferring the binary on a various set of hosts, it seems that:
The binary fails to run on hosts with a 96-core CPU (Intel Xeon 5318Y), while it works on an 80-core CPU (Intel Xeon 5218R) and 8-core CPU (Intel Core i7-8550U)
Debugging the binary shows that on the failing host, wazero crashes in the execution engine when making a call back to Go through the Go ABI -- which likely changed with go1.24. On the successful hosts the instructions bail before said ABI call.
Running the binary under strace does not reveal anything odd -- both the failing and successful runs open the same files, read the same content, and generally perform the exact same operations with the same side effects leading up to the failure point.
This failure seems to have been discovered recently in go-re2 (see wasilibs/go-re2#190), and upgrading wazero once the issue has been fixed should fix this bug.
However, given that wazero is likely to break again each time Go changes its internal ABI, and that we value far more stability across Go upgrades, we'd like to request that a build tag is made available to switch between the standard library regexp package and go-re2. The binary release can still use go-re2 by default, but users that compile their trufflehog release from source will still very likely experience this same bug when new Go versions come out.
At the very least, from our perspective, we don't care much about the regexp engine in use, but we prefer smoother Go upgrades in our build farm, so having some build tag to switch back to std regexp during compilation would work for us, if that option is on the table. gitleaks seems to be doing the same: https://github.com/gitleaks/gitleaks/tree/master/regexp.
TruffleHog Version
Tested with these commits, compiled from source:
Note that the issue does not happen with the Github release x86_64 binary for v3.88.8. We are nevertheless impacted because we always build releases from source.
Trace Output
No trace output can be obtained with --log-level=5, trufflehog crashes in init.
Expected Behavior
Running
trufflehog --version
should print a version.Actual Behavior
Any invocation of trufflehog fails with the following stack trace:
Steps to Reproduce
Environment
Additional Context
This bug still stumps us to this day because there's no visible side effect that might explain why this issue occurs only on certain machines. Building the trufflehog binary with Go 1.24 statically and transferring the binary on a various set of hosts, it seems that:
This failure seems to have been discovered recently in go-re2 (see wasilibs/go-re2#190), and upgrading wazero once the issue has been fixed should fix this bug.
However, given that wazero is likely to break again each time Go changes its internal ABI, and that we value far more stability across Go upgrades, we'd like to request that a build tag is made available to switch between the standard library regexp package and go-re2. The binary release can still use go-re2 by default, but users that compile their trufflehog release from source will still very likely experience this same bug when new Go versions come out.
References
invalid table access
wasilibs/go-re2#190The text was updated successfully, but these errors were encountered: