Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'bat cache --build' crashes on armv7 #1149

Closed
eggbean opened this issue Aug 23, 2020 · 17 comments · Fixed by #1495
Closed

'bat cache --build' crashes on armv7 #1149

eggbean opened this issue Aug 23, 2020 · 17 comments · Fixed by #1495
Labels
help wanted Extra attention is needed upstream-error A bug in an upstream component

Comments

@eggbean
Copy link

eggbean commented Aug 23, 2020

I have been able to add a .tmTheme for Sublime Text with success, but I cannot get this .tmLanguage file working. It is for the configuration file language for Mikrotik routers.

https://github.com/Kentzo/MikrotikScript/blob/master/MikrotikScript.tmLanguage

Is there anything I can do to make this work?

I added the file to ~/.config/bat/syntaxes/ and did bat cache --build, but it didn't work. Is there anything more I need to do?

@eggbean eggbean added the question Further information is requested label Aug 23, 2020
@sharkdp
Copy link
Owner

sharkdp commented Aug 23, 2020

Does the syntax show up when you run bat --list-languages?

@eggbean
Copy link
Author

eggbean commented Aug 23, 2020

No, it doesn't. Is the TextMate format for syntaxes not supported, like it is for themes? I have tried to use a ruby-based converter to turn it into .sublime-syntax format, but I haven't had any luck with it.

@sharkdp
Copy link
Owner

sharkdp commented Aug 23, 2020

Ah, I missed that. No, it is not supported. You can use Sublime Text to convert it (see README here: https://github.com/sharkdp/bat/tree/master/assets)

@eggbean eggbean changed the title Why doesn't this .tmTheme syntax work? Why doesn't this .tmLanguage syntax work? Aug 24, 2020
@eggbean
Copy link
Author

eggbean commented Aug 27, 2020

I had to get some help with the conversion, but I get a segmentation fault error when I try bat cache -b with the converted file.

This is the converted file:
http://sprunge.us/NYvb7P

Apparently it's probably not a problem with the syntect library and could be bat specific?

https://forum.sublimetext.com/t/trying-to-convert-tmlanguage-syntax-to-sublime-syntax/53427/6?u=eggbean

@sharkdp
Copy link
Owner

sharkdp commented Sep 7, 2020

It does work fine for me:

▶ wget -O ~/.config/bat/syntaxes/mikrotik.sublime-syntax http://sprunge.us/NYvb7P  
…

▶ bat cache --build
Writing theme set to /home/shark/.cache/bat/themes.bin ... okay
Writing syntax set to /home/shark/.cache/bat/syntaxes.bin ... okay
Writing metadata to folder /home/shark/.cache/bat ... okay

▶ bat --list-languages | grep Mikrotik
Mikrotik Script:rsc

Note that the file has Windows line endings. But it doesn't seem to cause any problems for me.

@eggbean
Copy link
Author

eggbean commented Sep 8, 2020

I just tried again. Yes, it works on x86_64, but it results in Segmentation Fault on ARM.

I usually do router stuff on a Raspberry Pi which is connected to it. Not a major problem, as I could just use my laptop instead, but is this something I could resolve?

@eth-p
Copy link
Collaborator

eth-p commented Sep 9, 2020

A segfault? That (likely) isn't going to be happening somewhere in our Rust code, as we don't make much use of unsafe.

I suspect this is going to turn out to be an issue with a dependency, but I don't have an ARM platform to test it on. Are you able to get us a stack trace, and is there any more info you can give us about your platform?

E.g. Processor model, was bat compiled with armhf, etc.

@sharkdp
Copy link
Owner

sharkdp commented Sep 20, 2020

A segfault? That (likely) isn't going to be happening somewhere in our Rust code, as we don't make much use of unsafe.

Another option could be an illegal instruction if the executable was compiler for a non-compatible platform. But that would usually trigger a SIGILL.

@eggbean
Copy link
Author

eggbean commented Sep 21, 2020

Sorry, I forgot to reply earlier. It's a Raspberry Pi 3B, so it has a Quad Core 1.2GHz Broadcom BCM2837 64bit CPU. It's running
Raspberry Pi OS and I think the package must be from the Debian repository.

$ apt info bat
Package: bat
Version: 0.15.4
Status: install ok installed
Priority: optional
Section: utils
Maintainer: David Peter <mail@david-peter.de>
Installed-Size: unknown
Provides: bat
Conflicts: bat-musl
Homepage: https://github.com/sharkdp/bat
Download-Size: unknown
APT-Manual-Installed: yes
APT-Sources: /var/lib/dpkg/status
Description: A cat(1) clone with wings.
 A cat(1) clone with syntax highlighting and Git integration.

This is the output of strace. Is this enough?
http://sprunge.us/CGV3Wv

@sharkdp
Copy link
Owner

sharkdp commented Sep 21, 2020

Interesting. It looks like it crashes directly after the whole mikrotik.sublime-syntax has been successfully read.

The next step inside syntect (the library which does the syntax highlighting and manages sublime syntaxes) is the serde deserialization from YAML to an actual Rust object (no, syntect does not use serde_yaml for that). Maybe something goes wrong in this step? I will try to debug this on a RPi.

@sharkdp
Copy link
Owner

sharkdp commented Sep 21, 2020

@eggbean Maybe you could run bat with gdb (even if it's not a debug build) to get a partial backtrace?

> gdb bat
gdb> run cache --build

# wait for it to crash

gdb> backtrace

@eggbean
Copy link
Author

eggbean commented Sep 22, 2020

$ gdb bat
GNU gdb (Raspbian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from bat...(no debugging symbols found)...done.
(gdb) run cache --build
Starting program: /usr/bin/bat cache --build
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00670480 in ?? ()
(gdb) backtrace
#0  0x00670480 in ?? ()
#1  0x0068dbc0 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)

@sharkdp
Copy link
Owner

sharkdp commented Sep 22, 2020

(gdb) backtrace
#0 0x00670480 in ?? ()
#1 0x0068dbc0 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Ahh, damn. That's not very helpful, unfortunately.

I went ahead and tried to reproduce this on my RPi 3b. I see the exact same crash as well!

Next, I tried to minimize the mikrotik.sublime-syntax file, to see if it is actually related to the content. Turns out it is! This is the "minimal" example which still leads to a crash:

%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Dummy
scope: dummy
contexts:
  main:
    - match: '(?<words> 2ghz\-10mhz\-power\-channels| 2ghz\-11n\-channels| 2ghz\-5mhz\-power\-channels| 2ghz\-b\-channels| 2ghz\-g\-channels| 2ghz\-g\-turbo\-channels| 5ghz\-10mhz\-power\-channels| 5ghz\-11n\-channels| 5ghz\-5mhz\-power\-channels| 5ghz\-channels| 5ghz\-turbo\-channels| 6to4\-interface| 802\.3\-sap| 802\.3\-type| AH| DNS| ESP| NET\-BIOS| SNMP| ac\-name| accept\-dynamic\-neighbors| accept\-redirects| accept\-router\-advertisements| accept\-source\-route| accept| accessible\-via\-web| account\-local\-traffic| accounting| action| active\-flow\-timeout| active\-mode| active\-port\-type| active| adaptive\-noise\-immunity| add\-arp| add\-default\-route| add\-lifetime| add\-mac\-cookie| add\-relay\-info| address\-families| address\-family| address\-list\-timeout| address\-list| address\-pool| address\-prefix\-length| address6| addresses| address| addtime| adjacent\-neighbors| admin\-mac| advertise\-dns| advertise\-filter| advertise\-interval| advertise\-mac\-address| advertise\-timeout| advertise\-url| advertised\-l2mtu| advertise| affinity\-exclude| affinity\-include\-all| affinity\-include\-any| ageing\-time| age| ah\-algorithm| ah\-key| ah\-spi| alarm\-setting| alert\-timeout| allocate\-udp\-ports\-from| allow\-address| allow\-as\-in| allow\-disable\-external\-interface| allow\-fast\-path| allow\-guests| allow\-remote\-requests| allow\-sharedkey| allow\-target| allowed\-number| allow| always\-broadcast| always\-from\-cache| antenna\-gain| antenna\-mode| ap\-tx\-limit| apn| append\-bgp\-communities| append\-route\-targets| area\-id| area\-prefix| area| arp\-dst\-address| arp\-dst\-mac\-address| arp\-gratuitous| arp\-hardware\-type| arp\-interval| arp\-ip\-targets| arp\-opcode| arp\-packet\-type| arp\-ping| arp\-src\-address| arp\-src\-mac\-address| arp\-timeout| arp| as\-override| ascii| as| attribute\-filter| audio\-max| audio\-min| audio\-monitor| auth\-algorithms| auth\-algorithm| auth\-key| auth\-method| authenticate| authentication\-key\-id| authentication\-key| authentication\-password| authentication\-protocol| authentication\-types| authentication| authoritative| auth| auto\-bandwidth\-avg\-interval| auto\-bandwidth\-range| auto\-bandwidth\-reserve| auto\-bandwidth\-update\-interval| auto\-mac| auto\-negotiation| auto\-send\-supout| automatic\-supout| autonomous| backup\-designated\-router| bandwidth\-limit| bandwidth| band| basic\-rates\-a\/g| basic\-rates\-b| battery\-charge| battery\-voltage| baud\-rate| bearing| bgp\-as\-path\-length| bgp\-as\-path| bgp\-atomic\-aggregate| bgp\-communities| bgp\-local\-pref| bgp\-med| bgp\-origin| bgp\-prepend| bgp\-weight| bidirectional\-timeout| blink| block\-access| blockade\-k\-factor| board| body| boot\-device| boot\-file\-name| boot\-protocol| bootp\-support| bridge\-cost| bridge\-horizon| bridge\-mode| bridge\-path\-cost| bridge\-port\-priority| bridge| broadcast| bsd\-syslog| burst\-time| bytes| ca\-fingerprint| ca\-identity| cable\-setting| cable\-test| cache\-administrator| cache\-entries| cache\-hit\-dscp| cache\-max\-ttl| cache\-on\-disk| cache\-size| capabilities| cc| certificate| chain| challenge\-password| change\-tcp\-mss| channel\-time| channel\-width| channel| check\-certificate| check\-gateway| check\-interval| check\-status| chip\-info| cipher| cisco\-style\-id| cisco\-style| cisco\-vpls\-nlri\-len\-fmt| client\-id| client\-to\-client\-reflection| client\-tx\-limit| cluster\-id| code| comment| common\-name| compression| confederation\-peers| confederation| connect\-to| connection\-bytes| connection\-limit| connection\-mark| connection\-rate| connection\-state| connection\-type| connect| contact| contents| content| contrast| cost| country| count| cpu\-frequency| cpu| current\-bytes| current\-mac\-address| data\-bits| data\-channel| data| date\-and\-time| days\-valid| dead\-interval| default\-ap\-tx\-limit| default\-authentication| default\-cable\-settings| default\-client\-tx\-limit| default\-cost| default\-forwarding| default\-group| default\-name| default\-originate| default\-periodic\-calibration| default\-profile| default\-route\-distance| default\-vlan\-id| default| delay\-threshold| designated\-port\-count| designated\-router| device\-id| device| dfs\-mode| dh\-group| dhcp\-options| dhcp\-option| dhcp\-server| dial\-command| dial\-on\-demand| direction| directory| disable\-csma| disable\-running\-check| disabled| disconnect\-timeout| discover| disk\-file\-count| disk\-file\-name| disk\-lines\-per\-file| disk\-stop\-on\-full| distance| distribute\-default| distribute\-for\-default\-route| dns\-name| dns\-server| do\-not\-fragment| domain\-id| domain\-tag| domain| down\-delay| down\-flood\-thresholds| down\-script| dpd\-interval| dpd\-maximum\-failures| dscp| dst\-address\-list| dst\-address\-type| dst\-address| dst\-delta| dst\-end| dst\-host| dst\-limit| dst\-mac\-address| dst\-path| dst\-port| dst\-start| duid| duration| dynamic\-label\-range| eap\-methods| edge\-port\-discovery| edge\-port| edge| email\-to| email| enable\-nstreme| enable\-polling| enabled| enc\-algorithms| enc\-algorithm| encryption\-password| encryption\-protocol| engine\-id| esp\-auth\-algorithm| esp\-auth\-key| esp\-enc\-algorithm| esp\-enc\-key| esp\-spi| eui\-64| exchange\-mode| exclude\-groups| export\-pub\-key| export\-route\-target| external\-fdb| file\-limit| file\-name| file| filter\-direction| filter\-interface| filter\-ip\-address| filter\-ip\-protocol| filter\-mac\-address| filter\-mac\-protocol| filter\-mac| filter\-operator\-between\-entries| filter\-port| filter\-stream| fingerprint\-algorithm| firmware| flow\-control\-auto| flow\-control\-rx| flow\-control\-tx| flow\-control| force\-aes| force\-backup\-booter| forward\-delay| forwarding| forward| fragment\-offset| fragment| frame\-lifetime| frame\-size| framer\-limit| framer\-policy| frames\-per\-second| frequency\-mode| frequency\-offset| frequency| from\-address| from\-date| from\-pool| from\-time| from| full\-duplex| garbage\-timer| gateway\-class| gateway\-keepalive| gateway\-selection| gateway| generate\-key| generate\-policy| generic\-timeout| graph| group\-ciphers| group\-key\-update| group| hash\-algorithm| hello\-interval| hide\-ssid| hold\-time| holding\-priority| hop\-limit| hoplimit| hops| horizon| host\-name| host| hotspot\-address| hotspot| ht\-ampdu\-priorities| ht\-amsdu\-limit| ht\-amsdu\-threshold| ht\-basic\-mcs| ht\-chains| ht\-channel\-width| ht\-guard\-interval| ht\-rates| ht\-rxchains| ht\-streams| ht\-supported\-mcs| ht\-txchains| html\-directory| http\-cookie\-lifetime| http\-proxy| hw\-fragmentation\-threshold| hw\-protection\-mode| hw\-protection\-threshold| hw\-retries| hwmp\-default\-hoplimit| hwmp\-prep\-lifetime| hwmp\-preq\-destination\-only| hwmp\-preq\-reply\-and\-forward| hwmp\-preq\-retries| hwmp\-preq\-waiting\-time| hwmp\-rann\-interval| hwmp\-rann\-lifetime| hwmp\-rann\-propagation\-delay| iaid| icmp\-options| icmp\-rate\-limit| icmp\-rate\-mask| icmp\-timeout| identification| identity| idle\-timeout| ignore\-as\-path\-len| ignore\-directip\-modem| igp\-flood\-period| import\-route\-target| import| in\-bridge\-port| in\-bridge| in\-buffer\-errors| in\-errors| in\-filter| in\-header\-errors| in\-interface| in\-no\-policies| in\-no\-states| in\-policy\-blocked| in\-policy\-errors| in\-prefix\-list| in\-state\-expired| in\-state\-invalid| in\-state\-mismatches| in\-state\-mode\-errors| in\-state\-protocol\-errors| in\-state\-sequence\-errors| in\-template\-mismatches| inactive\-flow\-timeout| include\-igp| incoming\-filter| incoming\-packet\-mark| info\-channel| ingress\-priority| inherit\-attributes| inject\-summary\-lsas| insert\-queue\-before| instance| interface\-name| interface\-type| interfaces| interface| interim\-update| interval| invert\-math| ip\-address| ip\-forwarding| ip\-forward| ip\-header\-size| ip\-packet\-size| ip\-protocol| ipsec\-protocols| ipv4\-options| ipv6| jump\-target| k\-factor| keep\-max\-sms| keep\-result| keepalive\-timeout| keepalive\-time| keepalive| key\-bits| key\-chain| key\-id| key\-name| key\-size| key\-usage| key| kind| l2mtu| l2router\-id| lacp\-rate| last\-packet\-before| latency\-distribution\-max| latency\-distribution\-scale| latency| latitude| layer7\-protocol| learning| lease\-script| lease\-time| leds| level| life\-time| lifebytes| lifetime| limit\-bytes\-in| limit\-bytes\-out| limit\-bytes\-total| limit\-uptime| limit| line\-voltage| link\-monitoring| list| load| local\-address| local\-port| local\-tx\-speed| local\-udp\-tx\-size| locality| locally\-originated\-bgp| local| location| log\-prefix| login\-by| longitude| loop\-detect| low\-battery| lsr\-id| mac\-address| mac\-auth\-password| mac\-cookie\-timeout| mac\-protocol| make\-static| managed\-address\-configuration| management\-protection\-key| management\-protection| manual\-sa| manual\-tx\-powers| master\-interface| master\-port| match\-chain| max\-cache\-object\-size| max\-cache\-size| max\-client\-connections| max\-connections| max\-fresh\-time| max\-message\-age| max\-mru| max\-mtu| max\-prefix\-limit| max\-prefix\-restart\-time| max\-server\-connections| max\-sessions| max\-station\-count| max\-udp\-packet\-size| mbps| mdix\-enable| memory\-limit| memory\-lines| memory\-scroll| memory\-stop\-on\-full| mesh\-portal| mesh| messages\-rx| messages\-tx| method| metric\-bgp| metric\-connected| metric\-default| metric\-ospf| metric\-other\-ospf| metric\-rip| metric\-static| metric| mii\-interval| min\-runtime| min\-rx| mirror\-source| mirror\-target| mode\-cfg| modem\-init| modem\-signal\-treshold| mode| monitor| mpls\-mtu| mpls\-te\-area| mpls\-te\-router\-id| mq\-pfifo\-limit| mrru| mschapv2\-password| mschapv2\-username| mss| mtu| multicast\-buffering| multicast\-helper| multihop| multiple\-channels| multiplier| my\-id\-user\-fqdn| name| nas\-port\-type| nat\-traversal| neighbor\-id| neighbors| neighbor| netmask| network\-type| network| new\-connection\-mark| new\-dscp| new\-mss| new\-packet\-mark| new\-priority| new\-routing\-mark| new\-ttl| next\-server| nexthop\-choice| no\-ping\-delay| noise\-floor\-threshold| note| nth| ntp\-server| null\-modem| num| nv2\-cell\-radius| nv2\-noise\-floor\-offset| nv2\-preshared\-key| nv2\-qos| nv2\-queue\-count| nv2\-security| offline\-time| on\-alert| on\-backup| on\-battery| on\-event| on\-fail\-retry\-time| on\-interface| on\-line| on\-link| on\-login| on\-logout| on\-master| one\-session\-per\-host| only\-headers| only\-one| open\-status\-page| organization| organziation| orig\-mac\-address| origination\-interval| originator| ospf\-type| other\-configuration| out\-bridge\-port| out\-bridge| out\-bundle\-check\-errors| out\-bundle\-errors| out\-errors| out\-filter| out\-interface| out\-no\-states| out\-policy\-blocked| out\-policy\-dead| out\-policy\-errors| out\-prefix\-list| out\-state\-expired| out\-state\-mode\-errors| out\-state\-protocol\-errors| out\-state\-sequence\-errors| outgoing\-filter| outgoing\-packet\-mark| output\-voltage| overloaded\-output| p2p| packet\-mark| packet\-size| packet\-type| packets| page\-refresh| parent\-proxy\-port| parent\-proxy| parent\-queue| parity| passive| password| path\-cost| path\-vector\-limit| path| pci\-info| pcq\-burst\-rate| pcq\-burst\-threshold| pcq\-burst\-time| pcq\-classifier| pcq\-dst\-address\-mask| pcq\-dst\-address6\-mask| pcq\-limit| pcq\-rate| pcq\-src\-address\-mask| pcq\-src\-address6\-mask| pcq\-total\-limit| peek\-rate| per\-connection\-classifier| periodic\-calibration\-interval| periodic\-calibration| pfifo\-limit| pfs\-group| pfs| phone| phy\-regs| pin| platform| poe\-out| poe\-priority| point\-to\-point\-port| point\-to\-point| policy\-group| policy| poll\-interval| pool\-name| pool\-prefix\-length| port\-count| port\-number| port\-type| ports| port| pps| preamble\-mode| preemption\-mode| pref\-src| preferred\-gateway| preferred\-lifetime| prefix\-length| prefix| primary\-ntp| primary\-path| primary\-retry\-interval| primary\-server| primary| priority| prism\-cardtype| private\-algo| private\-key| private\-pre\-shared\-key| profile| propagate\-ttl| proposal\-check| proposal| proprietary\-extensions| proprietary\-extension| protocol\-mode| protocol| psd| pw\-mtu| pw\-type| query\-server\-timeout| query\-total\-timeout| queue\-type| queue| quick| ra\-delay| ra\-interval| ra\-lifetime| radio\-name| radius\-accounting| radius\-default\-domain| radius\-eap\-accounting| radius\-interim\-update| radius\-location\-name| radius\-mac\-authentication| radius\-mac\-caching| radius\-mac\-format| radius\-mac\-mode| random\-data| random| ranges| range| rate\-limit| rate\-selection| rate\-set| rates\-a\/g| rates\-b| rate| raw\-value| reachable\-time| read\-access| read\-only| receive\-all| receive\-enabled| receive\-errors| receive| record\-route| red\-avg\-packet| red\-burst| red\-limit| red\-max\-threshold| red\-min\-threshold| redirect\-to| redistribute\-bgp| redistribute\-connected| redistribute\-ospf| redistribute\-other\-bgp| redistribute\-other\-ospf| redistribute\-rip| redistribute\-static| refresh\-time| regexp| reject\-with| relay| release| remember| remote\-address| remote\-as| remote\-certificate| remote\-mac| remote\-peer| remote\-port| remote\-tx\-speed| remote\-udp\-tx\-size| remote| remove\-private\-as| renew| reoptimize\-interval| reoptimize\-paths| replace\-battery| replay| req\-fingerprint| require\-client\-certificate| resends| reset\-alert| reset\-counters\-all| reset\-counters| reset\-mac\-address| resource\-class| retransmit\-interval| role| root\-bridge\-id| root\-bridge| root\-path\-cost| root\-port| route\-comment| route\-distinguisher| route\-reflect| route\-tag| route\-target| router\-id| routes| routing\-mark| routing\-table| rp\-filter| rp_filter| runtime\-calibration\-running| runtime\-left| rx\-band| rx\-channel\-width| rx\-frequency| rx\-radio| sa\-dst\-address| sa\-src\-address| sa\-type| same\-not\-by\-dst| satellites| scan\-list| scope| secondary\-ntp| secondary\-paths| secondary\-server| secret| secure\-redirects| security\-profile| security| send\-dns| send\-email\-from| send\-email\-to| send\-initial\-contact| send\-redirects| send\-smtp\-server| send\-targeted| sending\-rstp| send| seq\-number| serial\-number| serialize\-connections| servers| server| service\-name| session\-timeout| set\-bgp\-communities| set\-bgp\-local\-pref| set\-bgp\-med| set\-bgp\-prepend\-path| set\-bgp\-prepend| set\-bgp\-weight| set\-check\-gateway| set\-disabled| set\-distance| set\-in\-nexthop\-direct| set\-in\-nexthop\-ipv6| set\-in\-nexthop\-linklocal| set\-in\-nexthop| set\-metric| set\-out\-nexthop\-ipv6| set\-out\-nexthop\-linklocal| set\-out\-nexthop| set\-pref\-src| set\-route\-comment| set\-route\-tag| set\-route\-targets| set\-routing\-mark| set\-scope| set\-site\-of\-origin| set\-system\-time| set\-target\-scope| set\-type| set\-use\-te\-nexthop| setup\-priority| setup| sfp\-rate\-select| sfq\-allot| sfq\-perturb| shared\-users| share| show\-at\-login| show\-dummy\-rule| signal\-range| silent\-boot| sim\-pin| simple\-queue| sip\-direct\-media| site\-id| site\-of\-origin| size| skin| slaves| smart\-boost\-mode| smart\-ssdd\-mode| smtp\-server| software\-id| source| speed| spi| split\-include| split\-user\-domain| src\-address\-list| src\-address\-type| src\-address| src\-mac\-address| src\-mac| src\-path| src\-port| ssid\-all| ssid| ssl\-certificate| start\-time| start| state| static\-algo\-0| static\-algo\-1| static\-algo\-2| static\-algo\-3| static\-key\-0| static\-key\-1| static\-key\-2| static\-key\-3| static\-sta\-private\-algo| static\-sta\-private\-key| static\-transmit\-key| station\-bridge\-clone\-mac| stats\-samples\-to\-keep| status\-autorefresh| status| stop\-bits| stop| store\-every| store\-leases\-disk| store\-name| store\-on\-disk| stp\-flags| stp\-forward\-delay| stp\-hello\-time| stp\-max\-age| stp\-msg\-age| stp\-port| stp\-root\-address| stp\-root\-cost| stp\-root\-priority| stp\-sender\-address| stp\-sender\-priority| stp\-type| streaming\-enabled| streaming\-max\-rate| streaming\-server| subject| summary\-only| supplicant\-identity| supported\-bands| supported\-rates\-a\/g| supported\-rates\-b| suppress\-filter| synchronize| syslog\-facility| syslog\-severity| syslog\-time\-format| target\-scope| target| tcp\-close\-timeout| tcp\-close\-wait\-timeout| tcp\-connection\-count| tcp\-established\-timeout| tcp\-fin\-wait\-timeout| tcp\-flags| tcp\-last\-ack\-timeout| tcp\-md5\-key| tcp\-mss| tcp\-syn\-received\-timeout| tcp\-syn\-sent\-timeout| tcp\-syncookies| tcp\-time\-wait\-timeout| tcp_syncookies| tdma\-debug| tdma\-hw\-test\-mode| tdma\-override\-rate| tdma\-override\-size| tdma\-period\-size| tdma\-test\-mode| te\-metric| template| test\-audio| test\-id| threshold| time\-zone\-name| time\-zone| timeout\-timer| timeout| time| tls\-certificate| tls\-mode| tls| to\-addresses| to\-address| to\-arp\-reply\-mac\-address| to\-dst\-mac\-address| to\-ports| to\-src\-mac\-address| top\-bits| topics| total| to| traffic| transfer\-cause| transit\-area| translator\-role| transmit\-delay| transmit\-hash\-policy| transmit\-hold\-count| transparent\-proxy| transport\-address| transport| trap\-generators| trap\-target| trap\-version| trial\-uptime| trial\-user\-profile| trigger| trusted| ttl| tunnel\-id| tunnel| tx\-band| tx\-channel\-width| tx\-frequency| tx\-power\-mode| tx\-power| tx\-radio| tx\-template| type| udp\-stream\-timeout| udp\-timeout| unicast\-ciphers| unit| unpack| up\-delay| up\-flood\-thresholds| up\-script| update\-source| update\-stats\-interval| update\-timer| upload| uptime| url| usb\-version| use\-bfd| use\-compression| use\-control\-word| use\-cspf| use\-dn| use\-encryption| use\-explicit\-null| use\-ip\-firewall\-for\-pppoe| use\-ip\-firewall\-for\-vlan| use\-ip\-firewall| use\-mpls| use\-peer\-dns| use\-peer\-ntp| use\-radius| use\-service\-tag| use\-src\-mac| use\-udp| use\-vj\-compression| username| user| v3\-protocol| v9\-template\-refresh| v9\-template\-timeout| valid\-lifetime| valid\-server| valid| value| vendor\-id| vendor| verify\-client\-certificate| verify\-server\-address\-from\-certificate| verify\-server\-certificate| version| vlan\-encap| vlan\-header| vlan\-id| vlan\-mode| vlan\-priority| vpls\-id| vrid| watch\-address| watchdog\-timer| wds\-address| wds\-cost\-range| wds\-default\-bridge| wds\-default\-cost| wds\-ignore\-ssid| wds\-mode| wins\-server| wireless\-protocol| wmm\-support| wpa\-pre\-shared\-key| wpa2\-pre\-shared\-key| write\-access| xauth\-login| xauth\-password| zone )'

This lead me to think that it would be related to the regex engine (oniguruma) - which is actually a C dependency and may very well segfault. Indeed, I was able to reproduce the error with this simple program:

use onig::*;

fn main() {
    Regex::new(r"(?x) (\b(?<![\/\-=])(?<words> 2ghz\-10mhz\-power\-channels| 2ghz\-11n\-channels| 2ghz\-5mhz\-power\-channels| 2ghz\-b\-channels| 2ghz\-g\-channels| 2ghz\-g\-turbo\-channels| 5ghz\-10mhz\-power\-channels| 5ghz\-11n\-channels| 5ghz\-5mhz\-power\-channels| 5ghz\-channels| 5ghz\-turbo\-channels| 6to4\-interface| 802\.3\-sap| 802\.3\-type| AH| DNS| ESP| NET\-BIOS| SNMP| ac\-name| accept\-dynamic\-neighbors| accept\-redirects| accept\-router\-advertisements| accept\-source\-route| accept| accessible\-via\-web| account\-local\-traffic| accounting| action| active\-flow\-timeout| active\-mode| active\-port\-type| active| adaptive\-noise\-immunity| add\-arp| add\-default\-route| add\-lifetime| add\-mac\-cookie| add\-relay\-info| address\-families| address\-family| address\-list\-timeout| address\-list| address\-pool| address\-prefix\-length| address6| addresses| address| addtime| adjacent\-neighbors| admin\-mac| advertise\-dns| advertise\-filter| advertise\-interval| advertise\-mac\-address| advertise\-timeout| advertise\-url| advertised\-l2mtu| advertise| affinity\-exclude| affinity\-include\-all| affinity\-include\-any| ageing\-time| age| ah\-algorithm| ah\-key| ah\-spi| alarm\-setting| alert\-timeout| allocate\-udp\-ports\-from| allow\-address| allow\-as\-in| allow\-disable\-external\-interface| allow\-fast\-path| allow\-guests| allow\-remote\-requests| allow\-sharedkey| allow\-target| allowed\-number| allow| always\-broadcast| always\-from\-cache| antenna\-gain| antenna\-mode| ap\-tx\-limit| apn| append\-bgp\-communities| append\-route\-targets| area\-id| area\-prefix| area| arp\-dst\-address| arp\-dst\-mac\-address| arp\-gratuitous| arp\-hardware\-type| arp\-interval| arp\-ip\-targets| arp\-opcode| arp\-packet\-type| arp\-ping| arp\-src\-address| arp\-src\-mac\-address| arp\-timeout| arp| as\-override| ascii| as| attribute\-filter| audio\-max| audio\-min| audio\-monitor| auth\-algorithms| auth\-algorithm| auth\-key| auth\-method| authenticate| authentication\-key\-id| authentication\-key| authentication\-password| authentication\-protocol| authentication\-types| authentication| authoritative| auth| auto\-bandwidth\-avg\-interval| auto\-bandwidth\-range| auto\-bandwidth\-reserve| auto\-bandwidth\-update\-interval| auto\-mac| auto\-negotiation| auto\-send\-supout| automatic\-supout| autonomous| backup\-designated\-router| bandwidth\-limit| bandwidth| band| basic\-rates\-a\/g| basic\-rates\-b| battery\-charge| battery\-voltage| baud\-rate| bearing| bgp\-as\-path\-length| bgp\-as\-path| bgp\-atomic\-aggregate| bgp\-communities| bgp\-local\-pref| bgp\-med| bgp\-origin| bgp\-prepend| bgp\-weight| bidirectional\-timeout| blink| block\-access| blockade\-k\-factor| board| body| boot\-device| boot\-file\-name| boot\-protocol| bootp\-support| bridge\-cost| bridge\-horizon| bridge\-mode| bridge\-path\-cost| bridge\-port\-priority| bridge| broadcast| bsd\-syslog| burst\-time| bytes| ca\-fingerprint| ca\-identity| cable\-setting| cable\-test| cache\-administrator| cache\-entries| cache\-hit\-dscp| cache\-max\-ttl| cache\-on\-disk| cache\-size| capabilities| cc| certificate| chain| challenge\-password| change\-tcp\-mss| channel\-time| channel\-width| channel| check\-certificate| check\-gateway| check\-interval| check\-status| chip\-info| cipher| cisco\-style\-id| cisco\-style| cisco\-vpls\-nlri\-len\-fmt| client\-id| client\-to\-client\-reflection| client\-tx\-limit| cluster\-id| code| comment| common\-name| compression| confederation\-peers| confederation| connect\-to| connection\-bytes| connection\-limit| connection\-mark| connection\-rate| connection\-state| connection\-type| connect| contact| contents| content| contrast| cost| country| count| cpu\-frequency| cpu| current\-bytes| current\-mac\-address| data\-bits| data\-channel| data| date\-and\-time| days\-valid| dead\-interval| default\-ap\-tx\-limit| default\-authentication| default\-cable\-settings| default\-client\-tx\-limit| default\-cost| default\-forwarding| default\-group| default\-name| default\-originate| default\-periodic\-calibration| default\-profile| default\-route\-distance| default\-vlan\-id| default| delay\-threshold| designated\-port\-count| designated\-router| device\-id| device| dfs\-mode| dh\-group| dhcp\-options| dhcp\-option| dhcp\-server| dial\-command| dial\-on\-demand| direction| directory| disable\-csma| disable\-running\-check| disabled| disconnect\-timeout| discover| disk\-file\-count| disk\-file\-name| disk\-lines\-per\-file| disk\-stop\-on\-full| distance| distribute\-default| distribute\-for\-default\-route| dns\-name| dns\-server| do\-not\-fragment| domain\-id| domain\-tag| domain| down\-delay| down\-flood\-thresholds| down\-script| dpd\-interval| dpd\-maximum\-failures| dscp| dst\-address\-list| dst\-address\-type| dst\-address| dst\-delta| dst\-end| dst\-host| dst\-limit| dst\-mac\-address| dst\-path| dst\-port| dst\-start| duid| duration| dynamic\-label\-range| eap\-methods| edge\-port\-discovery| edge\-port| edge| email\-to| email| enable\-nstreme| enable\-polling| enabled| enc\-algorithms| enc\-algorithm| encryption\-password| encryption\-protocol| engine\-id| esp\-auth\-algorithm| esp\-auth\-key| esp\-enc\-algorithm| esp\-enc\-key| esp\-spi| eui\-64| exchange\-mode| exclude\-groups| export\-pub\-key| export\-route\-target| external\-fdb| file\-limit| file\-name| file| filter\-direction| filter\-interface| filter\-ip\-address| filter\-ip\-protocol| filter\-mac\-address| filter\-mac\-protocol| filter\-mac| filter\-operator\-between\-entries| filter\-port| filter\-stream| fingerprint\-algorithm| firmware| flow\-control\-auto| flow\-control\-rx| flow\-control\-tx| flow\-control| force\-aes| force\-backup\-booter| forward\-delay| forwarding| forward| fragment\-offset| fragment| frame\-lifetime| frame\-size| framer\-limit| framer\-policy| frames\-per\-second| frequency\-mode| frequency\-offset| frequency| from\-address| from\-date| from\-pool| from\-time| from| full\-duplex| garbage\-timer| gateway\-class| gateway\-keepalive| gateway\-selection| gateway| generate\-key| generate\-policy| generic\-timeout| graph| group\-ciphers| group\-key\-update| group| hash\-algorithm| hello\-interval| hide\-ssid| hold\-time| holding\-priority| hop\-limit| hoplimit| hops| horizon| host\-name| host| hotspot\-address| hotspot| ht\-ampdu\-priorities| ht\-amsdu\-limit| ht\-amsdu\-threshold| ht\-basic\-mcs| ht\-chains| ht\-channel\-width| ht\-guard\-interval| ht\-rates| ht\-rxchains| ht\-streams| ht\-supported\-mcs| ht\-txchains| html\-directory| http\-cookie\-lifetime| http\-proxy| hw\-fragmentation\-threshold| hw\-protection\-mode| hw\-protection\-threshold| hw\-retries| hwmp\-default\-hoplimit| hwmp\-prep\-lifetime| hwmp\-preq\-destination\-only| hwmp\-preq\-reply\-and\-forward| hwmp\-preq\-retries| hwmp\-preq\-waiting\-time| hwmp\-rann\-interval| hwmp\-rann\-lifetime| hwmp\-rann\-propagation\-delay| iaid| icmp\-options| icmp\-rate\-limit| icmp\-rate\-mask| icmp\-timeout| identification| identity| idle\-timeout| ignore\-as\-path\-len| ignore\-directip\-modem| igp\-flood\-period| import\-route\-target| import| in\-bridge\-port| in\-bridge| in\-buffer\-errors| in\-errors| in\-filter| in\-header\-errors| in\-interface| in\-no\-policies| in\-no\-states| in\-policy\-blocked| in\-policy\-errors| in\-prefix\-list| in\-state\-expired| in\-state\-invalid| in\-state\-mismatches| in\-state\-mode\-errors| in\-state\-protocol\-errors| in\-state\-sequence\-errors| in\-template\-mismatches| inactive\-flow\-timeout| include\-igp| incoming\-filter| incoming\-packet\-mark| info\-channel| ingress\-priority| inherit\-attributes| inject\-summary\-lsas| insert\-queue\-before| instance| interface\-name| interface\-type| interfaces| interface| interim\-update| interval| invert\-math| ip\-address| ip\-forwarding| ip\-forward| ip\-header\-size| ip\-packet\-size| ip\-protocol| ipsec\-protocols| ipv4\-options| ipv6| jump\-target| k\-factor| keep\-max\-sms| keep\-result| keepalive\-timeout| keepalive\-time| keepalive| key\-bits| key\-chain| key\-id| key\-name| key\-size| key\-usage| key| kind| l2mtu| l2router\-id| lacp\-rate| last\-packet\-before| latency\-distribution\-max| latency\-distribution\-scale| latency| latitude| layer7\-protocol| learning| lease\-script| lease\-time| leds| level| life\-time| lifebytes| lifetime| limit\-bytes\-in| limit\-bytes\-out| limit\-bytes\-total| limit\-uptime| limit| line\-voltage| link\-monitoring| list| load| local\-address| local\-port| local\-tx\-speed| local\-udp\-tx\-size| locality| locally\-originated\-bgp| local| location| log\-prefix| login\-by| longitude| loop\-detect| low\-battery| lsr\-id| mac\-address| mac\-auth\-password| mac\-cookie\-timeout| mac\-protocol| make\-static| managed\-address\-configuration| management\-protection\-key| management\-protection| manual\-sa| manual\-tx\-powers| master\-interface| master\-port| match\-chain| max\-cache\-object\-size| max\-cache\-size| max\-client\-connections| max\-connections| max\-fresh\-time| max\-message\-age| max\-mru| max\-mtu| max\-prefix\-limit| max\-prefix\-restart\-time| max\-server\-connections| max\-sessions| max\-station\-count| max\-udp\-packet\-size| mbps| mdix\-enable| memory\-limit| memory\-lines| memory\-scroll| memory\-stop\-on\-full| mesh\-portal| mesh| messages\-rx| messages\-tx| method| metric\-bgp| metric\-connected| metric\-default| metric\-ospf| metric\-other\-ospf| metric\-rip| metric\-static| metric| mii\-interval| min\-runtime| min\-rx| mirror\-source| mirror\-target| mode\-cfg| modem\-init| modem\-signal\-treshold| mode| monitor| mpls\-mtu| mpls\-te\-area| mpls\-te\-router\-id| mq\-pfifo\-limit| mrru| mschapv2\-password| mschapv2\-username| mss| mtu| multicast\-buffering| multicast\-helper| multihop| multiple\-channels| multiplier| my\-id\-user\-fqdn| name| nas\-port\-type| nat\-traversal| neighbor\-id| neighbors| neighbor| netmask| network\-type| network| new\-connection\-mark| new\-dscp| new\-mss| new\-packet\-mark| new\-priority| new\-routing\-mark| new\-ttl| next\-server| nexthop\-choice| no\-ping\-delay| noise\-floor\-threshold| note| nth| ntp\-server| null\-modem| num| nv2\-cell\-radius| nv2\-noise\-floor\-offset| nv2\-preshared\-key| nv2\-qos| nv2\-queue\-count| nv2\-security| offline\-time| on\-alert| on\-backup| on\-battery| on\-event| on\-fail\-retry\-time| on\-interface| on\-line| on\-link| on\-login| on\-logout| on\-master| one\-session\-per\-host| only\-headers| only\-one| open\-status\-page| organization| organziation| orig\-mac\-address| origination\-interval| originator| ospf\-type| other\-configuration| out\-bridge\-port| out\-bridge| out\-bundle\-check\-errors| out\-bundle\-errors| out\-errors| out\-filter| out\-interface| out\-no\-states| out\-policy\-blocked| out\-policy\-dead| out\-policy\-errors| out\-prefix\-list| out\-state\-expired| out\-state\-mode\-errors| out\-state\-protocol\-errors| out\-state\-sequence\-errors| outgoing\-filter| outgoing\-packet\-mark| output\-voltage| overloaded\-output| p2p| packet\-mark| packet\-size| packet\-type| packets| page\-refresh| parent\-proxy\-port| parent\-proxy| parent\-queue| parity| passive| password| path\-cost| path\-vector\-limit| path| pci\-info| pcq\-burst\-rate| pcq\-burst\-threshold| pcq\-burst\-time| pcq\-classifier| pcq\-dst\-address\-mask| pcq\-dst\-address6\-mask| pcq\-limit| pcq\-rate| pcq\-src\-address\-mask| pcq\-src\-address6\-mask| pcq\-total\-limit| peek\-rate| per\-connection\-classifier| periodic\-calibration\-interval| periodic\-calibration| pfifo\-limit| pfs\-group| pfs| phone| phy\-regs| pin| platform| poe\-out| poe\-priority| point\-to\-point\-port| point\-to\-point| policy\-group| policy| poll\-interval| pool\-name| pool\-prefix\-length| port\-count| port\-number| port\-type| ports| port| pps| preamble\-mode| preemption\-mode| pref\-src| preferred\-gateway| preferred\-lifetime| prefix\-length| prefix| primary\-ntp| primary\-path| primary\-retry\-interval| primary\-server| primary| priority| prism\-cardtype| private\-algo| private\-key| private\-pre\-shared\-key| profile| propagate\-ttl| proposal\-check| proposal| proprietary\-extensions| proprietary\-extension| protocol\-mode| protocol| psd| pw\-mtu| pw\-type| query\-server\-timeout| query\-total\-timeout| queue\-type| queue| quick| ra\-delay| ra\-interval| ra\-lifetime| radio\-name| radius\-accounting| radius\-default\-domain| radius\-eap\-accounting| radius\-interim\-update| radius\-location\-name| radius\-mac\-authentication| radius\-mac\-caching| radius\-mac\-format| radius\-mac\-mode| random\-data| random| ranges| range| rate\-limit| rate\-selection| rate\-set| rates\-a\/g| rates\-b| rate| raw\-value| reachable\-time| read\-access| read\-only| receive\-all| receive\-enabled| receive\-errors| receive| record\-route| red\-avg\-packet| red\-burst| red\-limit| red\-max\-threshold| red\-min\-threshold| redirect\-to| redistribute\-bgp| redistribute\-connected| redistribute\-ospf| redistribute\-other\-bgp| redistribute\-other\-ospf| redistribute\-rip| redistribute\-static| refresh\-time| regexp| reject\-with| relay| release| remember| remote\-address| remote\-as| remote\-certificate| remote\-mac| remote\-peer| remote\-port| remote\-tx\-speed| remote\-udp\-tx\-size| remote| remove\-private\-as| renew| reoptimize\-interval| reoptimize\-paths| replace\-battery| replay| req\-fingerprint| require\-client\-certificate| resends| reset\-alert| reset\-counters\-all| reset\-counters| reset\-mac\-address| resource\-class| retransmit\-interval| role| root\-bridge\-id| root\-bridge| root\-path\-cost| root\-port| route\-comment| route\-distinguisher| route\-reflect| route\-tag| route\-target| router\-id| routes| routing\-mark| routing\-table| rp\-filter| rp_filter| runtime\-calibration\-running| runtime\-left| rx\-band| rx\-channel\-width| rx\-frequency| rx\-radio| sa\-dst\-address| sa\-src\-address| sa\-type| same\-not\-by\-dst| satellites| scan\-list| scope| secondary\-ntp| secondary\-paths| secondary\-server| secret| secure\-redirects| security\-profile| security| send\-dns| send\-email\-from| send\-email\-to| send\-initial\-contact| send\-redirects| send\-smtp\-server| send\-targeted| sending\-rstp| send| seq\-number| serial\-number| serialize\-connections| servers| server| service\-name| session\-timeout| set\-bgp\-communities| set\-bgp\-local\-pref| set\-bgp\-med| set\-bgp\-prepend\-path| set\-bgp\-prepend| set\-bgp\-weight| set\-check\-gateway| set\-disabled| set\-distance| set\-in\-nexthop\-direct| set\-in\-nexthop\-ipv6| set\-in\-nexthop\-linklocal| set\-in\-nexthop| set\-metric| set\-out\-nexthop\-ipv6| set\-out\-nexthop\-linklocal| set\-out\-nexthop| set\-pref\-src| set\-route\-comment| set\-route\-tag| set\-route\-targets| set\-routing\-mark| set\-scope| set\-site\-of\-origin| set\-system\-time| set\-target\-scope| set\-type| set\-use\-te\-nexthop| setup\-priority| setup| sfp\-rate\-select| sfq\-allot| sfq\-perturb| shared\-users| share| show\-at\-login| show\-dummy\-rule| signal\-range| silent\-boot| sim\-pin| simple\-queue| sip\-direct\-media| site\-id| site\-of\-origin| size| skin| slaves| smart\-boost\-mode| smart\-ssdd\-mode| smtp\-server| software\-id| source| speed| spi| split\-include| split\-user\-domain| src\-address\-list| src\-address\-type| src\-address| src\-mac\-address| src\-mac| src\-path| src\-port| ssid\-all| ssid| ssl\-certificate| start\-time| start| state| static\-algo\-0| static\-algo\-1| static\-algo\-2| static\-algo\-3| static\-key\-0| static\-key\-1| static\-key\-2| static\-key\-3| static\-sta\-private\-algo| static\-sta\-private\-key| static\-transmit\-key| station\-bridge\-clone\-mac| stats\-samples\-to\-keep| status\-autorefresh| status| stop\-bits| stop| store\-every| store\-leases\-disk| store\-name| store\-on\-disk| stp\-flags| stp\-forward\-delay| stp\-hello\-time| stp\-max\-age| stp\-msg\-age| stp\-port| stp\-root\-address| stp\-root\-cost| stp\-root\-priority| stp\-sender\-address| stp\-sender\-priority| stp\-type| streaming\-enabled| streaming\-max\-rate| streaming\-server| subject| summary\-only| supplicant\-identity| supported\-bands| supported\-rates\-a\/g| supported\-rates\-b| suppress\-filter| synchronize| syslog\-facility| syslog\-severity| syslog\-time\-format| target\-scope| target| tcp\-close\-timeout| tcp\-close\-wait\-timeout| tcp\-connection\-count| tcp\-established\-timeout| tcp\-fin\-wait\-timeout| tcp\-flags| tcp\-last\-ack\-timeout| tcp\-md5\-key| tcp\-mss| tcp\-syn\-received\-timeout| tcp\-syn\-sent\-timeout| tcp\-syncookies| tcp\-time\-wait\-timeout| tcp_syncookies| tdma\-debug| tdma\-hw\-test\-mode| tdma\-override\-rate| tdma\-override\-size| tdma\-period\-size| tdma\-test\-mode| te\-metric| template| test\-audio| test\-id| threshold| time\-zone\-name| time\-zone| timeout\-timer| timeout| time| tls\-certificate| tls\-mode| tls| to\-addresses| to\-address| to\-arp\-reply\-mac\-address| to\-dst\-mac\-address| to\-ports| to\-src\-mac\-address| top\-bits| topics| total| to| traffic| transfer\-cause| transit\-area| translator\-role| transmit\-delay| transmit\-hash\-policy| transmit\-hold\-count| transparent\-proxy| transport\-address| transport| trap\-generators| trap\-target| trap\-version| trial\-uptime| trial\-user\-profile| trigger| trusted| ttl| tunnel\-id| tunnel| tx\-band| tx\-channel\-width| tx\-frequency| tx\-power\-mode| tx\-power| tx\-radio| tx\-template| type| udp\-stream\-timeout| udp\-timeout| unicast\-ciphers| unit| unpack| up\-delay| up\-flood\-thresholds| up\-script| update\-source| update\-stats\-interval| update\-timer| upload| uptime| url| usb\-version| use\-bfd| use\-compression| use\-control\-word| use\-cspf| use\-dn| use\-encryption| use\-explicit\-null| use\-ip\-firewall\-for\-pppoe| use\-ip\-firewall\-for\-vlan| use\-ip\-firewall| use\-mpls| use\-peer\-dns| use\-peer\-ntp| use\-radius| use\-service\-tag| use\-src\-mac| use\-udp| use\-vj\-compression| username| user| v3\-protocol| v9\-template\-refresh| v9\-template\-timeout| valid\-lifetime| valid\-server| valid| value| vendor\-id| vendor| verify\-client\-certificate| verify\-server\-address\-from\-certificate| verify\-server\-certificate| version| vlan\-encap| vlan\-header| vlan\-id| vlan\-mode| vlan\-priority| vpls\-id| vrid| watch\-address| watchdog\-timer| wds\-address| wds\-cost\-range| wds\-default\-bridge| wds\-default\-cost| wds\-ignore\-ssid| wds\-mode| wins\-server| wireless\-protocol| wmm\-support| wpa\-pre\-shared\-key| wpa2\-pre\-shared\-key| write\-access| xauth\-login| xauth\-password| zone )\b(?!-)(([\s\t]*?)(=))?)").unwrap();
}

with the following Cargo.toml file:

[package]
name = "regex-segfault"
version = "0.1.0"
edition = "2018"

[dependencies]
onig = { version = "6.0", default-features = false }

which I cross-compiled via

cross build --target armv7-unknown-linux-musleabihf

@sharkdp
Copy link
Owner

sharkdp commented Sep 22, 2020

I would suspect that it's also possible to reproduce the error with a simple C program, but I don't have a full-fledged dev. environment on my RPi and I don't really want to go down the route of cross-compiling a C program.

Maybe this is a bug that only appears on 32bit systems? (ARMv7 is 32bit). I think it should be reported upstream, but it would be great to get some confirmation first. The following C program should maybe lead to the crash on ARMv7:

#include <stdio.h>
#include <string.h>
#include "oniguruma.h"

extern int main(int argc, char* argv[])
{
  int r;
  regex_t* reg;
  OnigErrorInfo einfo;
  OnigEncoding use_encs[1];

  static UChar* pattern = (UChar* )"(?x) (\\b(?<![\\/\\-=])(?<words> 2ghz\\-10mhz\\-power\\-channels| 2ghz\\-11n\\-channels| 2ghz\\-5mhz\\-power\\-channels| 2ghz\\-b\\-channels| 2ghz\\-g\\-channels| 2ghz\\-g\\-turbo\\-channels| 5ghz\\-10mhz\\-power\\-channels| 5ghz\\-11n\\-channels| 5ghz\\-5mhz\\-power\\-channels| 5ghz\\-channels| 5ghz\\-turbo\\-channels| 6to4\\-interface| 802\\.3\\-sap| 802\\.3\\-type| AH| DNS| ESP| NET\\-BIOS| SNMP| ac\\-name| accept\\-dynamic\\-neighbors| accept\\-redirects| accept\\-router\\-advertisements| accept\\-source\\-route| accept| accessible\\-via\\-web| account\\-local\\-traffic| accounting| action| active\\-flow\\-timeout| active\\-mode| active\\-port\\-type| active| adaptive\\-noise\\-immunity| add\\-arp| add\\-default\\-route| add\\-lifetime| add\\-mac\\-cookie| add\\-relay\\-info| address\\-families| address\\-family| address\\-list\\-timeout| address\\-list| address\\-pool| address\\-prefix\\-length| address6| addresses| address| addtime| adjacent\\-neighbors| admin\\-mac| advertise\\-dns| advertise\\-filter| advertise\\-interval| advertise\\-mac\\-address| advertise\\-timeout| advertise\\-url| advertised\\-l2mtu| advertise| affinity\\-exclude| affinity\\-include\\-all| affinity\\-include\\-any| ageing\\-time| age| ah\\-algorithm| ah\\-key| ah\\-spi| alarm\\-setting| alert\\-timeout| allocate\\-udp\\-ports\\-from| allow\\-address| allow\\-as\\-in| allow\\-disable\\-external\\-interface| allow\\-fast\\-path| allow\\-guests| allow\\-remote\\-requests| allow\\-sharedkey| allow\\-target| allowed\\-number| allow| always\\-broadcast| always\\-from\\-cache| antenna\\-gain| antenna\\-mode| ap\\-tx\\-limit| apn| append\\-bgp\\-communities| append\\-route\\-targets| area\\-id| area\\-prefix| area| arp\\-dst\\-address| arp\\-dst\\-mac\\-address| arp\\-gratuitous| arp\\-hardware\\-type| arp\\-interval| arp\\-ip\\-targets| arp\\-opcode| arp\\-packet\\-type| arp\\-ping| arp\\-src\\-address| arp\\-src\\-mac\\-address| arp\\-timeout| arp| as\\-override| ascii| as| attribute\\-filter| audio\\-max| audio\\-min| audio\\-monitor| auth\\-algorithms| auth\\-algorithm| auth\\-key| auth\\-method| authenticate| authentication\\-key\\-id| authentication\\-key| authentication\\-password| authentication\\-protocol| authentication\\-types| authentication| authoritative| auth| auto\\-bandwidth\\-avg\\-interval| auto\\-bandwidth\\-range| auto\\-bandwidth\\-reserve| auto\\-bandwidth\\-update\\-interval| auto\\-mac| auto\\-negotiation| auto\\-send\\-supout| automatic\\-supout| autonomous| backup\\-designated\\-router| bandwidth\\-limit| bandwidth| band| basic\\-rates\\-a\\/g| basic\\-rates\\-b| battery\\-charge| battery\\-voltage| baud\\-rate| bearing| bgp\\-as\\-path\\-length| bgp\\-as\\-path| bgp\\-atomic\\-aggregate| bgp\\-communities| bgp\\-local\\-pref| bgp\\-med| bgp\\-origin| bgp\\-prepend| bgp\\-weight| bidirectional\\-timeout| blink| block\\-access| blockade\\-k\\-factor| board| body| boot\\-device| boot\\-file\\-name| boot\\-protocol| bootp\\-support| bridge\\-cost| bridge\\-horizon| bridge\\-mode| bridge\\-path\\-cost| bridge\\-port\\-priority| bridge| broadcast| bsd\\-syslog| burst\\-time| bytes| ca\\-fingerprint| ca\\-identity| cable\\-setting| cable\\-test| cache\\-administrator| cache\\-entries| cache\\-hit\\-dscp| cache\\-max\\-ttl| cache\\-on\\-disk| cache\\-size| capabilities| cc| certificate| chain| challenge\\-password| change\\-tcp\\-mss| channel\\-time| channel\\-width| channel| check\\-certificate| check\\-gateway| check\\-interval| check\\-status| chip\\-info| cipher| cisco\\-style\\-id| cisco\\-style| cisco\\-vpls\\-nlri\\-len\\-fmt| client\\-id| client\\-to\\-client\\-reflection| client\\-tx\\-limit| cluster\\-id| code| comment| common\\-name| compression| confederation\\-peers| confederation| connect\\-to| connection\\-bytes| connection\\-limit| connection\\-mark| connection\\-rate| connection\\-state| connection\\-type| connect| contact| contents| content| contrast| cost| country| count| cpu\\-frequency| cpu| current\\-bytes| current\\-mac\\-address| data\\-bits| data\\-channel| data| date\\-and\\-time| days\\-valid| dead\\-interval| default\\-ap\\-tx\\-limit| default\\-authentication| default\\-cable\\-settings| default\\-client\\-tx\\-limit| default\\-cost| default\\-forwarding| default\\-group| default\\-name| default\\-originate| default\\-periodic\\-calibration| default\\-profile| default\\-route\\-distance| default\\-vlan\\-id| default| delay\\-threshold| designated\\-port\\-count| designated\\-router| device\\-id| device| dfs\\-mode| dh\\-group| dhcp\\-options| dhcp\\-option| dhcp\\-server| dial\\-command| dial\\-on\\-demand| direction| directory| disable\\-csma| disable\\-running\\-check| disabled| disconnect\\-timeout| discover| disk\\-file\\-count| disk\\-file\\-name| disk\\-lines\\-per\\-file| disk\\-stop\\-on\\-full| distance| distribute\\-default| distribute\\-for\\-default\\-route| dns\\-name| dns\\-server| do\\-not\\-fragment| domain\\-id| domain\\-tag| domain| down\\-delay| down\\-flood\\-thresholds| down\\-script| dpd\\-interval| dpd\\-maximum\\-failures| dscp| dst\\-address\\-list| dst\\-address\\-type| dst\\-address| dst\\-delta| dst\\-end| dst\\-host| dst\\-limit| dst\\-mac\\-address| dst\\-path| dst\\-port| dst\\-start| duid| duration| dynamic\\-label\\-range| eap\\-methods| edge\\-port\\-discovery| edge\\-port| edge| email\\-to| email| enable\\-nstreme| enable\\-polling| enabled| enc\\-algorithms| enc\\-algorithm| encryption\\-password| encryption\\-protocol| engine\\-id| esp\\-auth\\-algorithm| esp\\-auth\\-key| esp\\-enc\\-algorithm| esp\\-enc\\-key| esp\\-spi| eui\\-64| exchange\\-mode| exclude\\-groups| export\\-pub\\-key| export\\-route\\-target| external\\-fdb| file\\-limit| file\\-name| file| filter\\-direction| filter\\-interface| filter\\-ip\\-address| filter\\-ip\\-protocol| filter\\-mac\\-address| filter\\-mac\\-protocol| filter\\-mac| filter\\-operator\\-between\\-entries| filter\\-port| filter\\-stream| fingerprint\\-algorithm| firmware| flow\\-control\\-auto| flow\\-control\\-rx| flow\\-control\\-tx| flow\\-control| force\\-aes| force\\-backup\\-booter| forward\\-delay| forwarding| forward| fragment\\-offset| fragment| frame\\-lifetime| frame\\-size| framer\\-limit| framer\\-policy| frames\\-per\\-second| frequency\\-mode| frequency\\-offset| frequency| from\\-address| from\\-date| from\\-pool| from\\-time| from| full\\-duplex| garbage\\-timer| gateway\\-class| gateway\\-keepalive| gateway\\-selection| gateway| generate\\-key| generate\\-policy| generic\\-timeout| graph| group\\-ciphers| group\\-key\\-update| group| hash\\-algorithm| hello\\-interval| hide\\-ssid| hold\\-time| holding\\-priority| hop\\-limit| hoplimit| hops| horizon| host\\-name| host| hotspot\\-address| hotspot| ht\\-ampdu\\-priorities| ht\\-amsdu\\-limit| ht\\-amsdu\\-threshold| ht\\-basic\\-mcs| ht\\-chains| ht\\-channel\\-width| ht\\-guard\\-interval| ht\\-rates| ht\\-rxchains| ht\\-streams| ht\\-supported\\-mcs| ht\\-txchains| html\\-directory| http\\-cookie\\-lifetime| http\\-proxy| hw\\-fragmentation\\-threshold| hw\\-protection\\-mode| hw\\-protection\\-threshold| hw\\-retries| hwmp\\-default\\-hoplimit| hwmp\\-prep\\-lifetime| hwmp\\-preq\\-destination\\-only| hwmp\\-preq\\-reply\\-and\\-forward| hwmp\\-preq\\-retries| hwmp\\-preq\\-waiting\\-time| hwmp\\-rann\\-interval| hwmp\\-rann\\-lifetime| hwmp\\-rann\\-propagation\\-delay| iaid| icmp\\-options| icmp\\-rate\\-limit| icmp\\-rate\\-mask| icmp\\-timeout| identification| identity| idle\\-timeout| ignore\\-as\\-path\\-len| ignore\\-directip\\-modem| igp\\-flood\\-period| import\\-route\\-target| import| in\\-bridge\\-port| in\\-bridge| in\\-buffer\\-errors| in\\-errors| in\\-filter| in\\-header\\-errors| in\\-interface| in\\-no\\-policies| in\\-no\\-states| in\\-policy\\-blocked| in\\-policy\\-errors| in\\-prefix\\-list| in\\-state\\-expired| in\\-state\\-invalid| in\\-state\\-mismatches| in\\-state\\-mode\\-errors| in\\-state\\-protocol\\-errors| in\\-state\\-sequence\\-errors| in\\-template\\-mismatches| inactive\\-flow\\-timeout| include\\-igp| incoming\\-filter| incoming\\-packet\\-mark| info\\-channel| ingress\\-priority| inherit\\-attributes| inject\\-summary\\-lsas| insert\\-queue\\-before| instance| interface\\-name| interface\\-type| interfaces| interface| interim\\-update| interval| invert\\-math| ip\\-address| ip\\-forwarding| ip\\-forward| ip\\-header\\-size| ip\\-packet\\-size| ip\\-protocol| ipsec\\-protocols| ipv4\\-options| ipv6| jump\\-target| k\\-factor| keep\\-max\\-sms| keep\\-result| keepalive\\-timeout| keepalive\\-time| keepalive| key\\-bits| key\\-chain| key\\-id| key\\-name| key\\-size| key\\-usage| key| kind| l2mtu| l2router\\-id| lacp\\-rate| last\\-packet\\-before| latency\\-distribution\\-max| latency\\-distribution\\-scale| latency| latitude| layer7\\-protocol| learning| lease\\-script| lease\\-time| leds| level| life\\-time| lifebytes| lifetime| limit\\-bytes\\-in| limit\\-bytes\\-out| limit\\-bytes\\-total| limit\\-uptime| limit| line\\-voltage| link\\-monitoring| list| load| local\\-address| local\\-port| local\\-tx\\-speed| local\\-udp\\-tx\\-size| locality| locally\\-originated\\-bgp| local| location| log\\-prefix| login\\-by| longitude| loop\\-detect| low\\-battery| lsr\\-id| mac\\-address| mac\\-auth\\-password| mac\\-cookie\\-timeout| mac\\-protocol| make\\-static| managed\\-address\\-configuration| management\\-protection\\-key| management\\-protection| manual\\-sa| manual\\-tx\\-powers| master\\-interface| master\\-port| match\\-chain| max\\-cache\\-object\\-size| max\\-cache\\-size| max\\-client\\-connections| max\\-connections| max\\-fresh\\-time| max\\-message\\-age| max\\-mru| max\\-mtu| max\\-prefix\\-limit| max\\-prefix\\-restart\\-time| max\\-server\\-connections| max\\-sessions| max\\-station\\-count| max\\-udp\\-packet\\-size| mbps| mdix\\-enable| memory\\-limit| memory\\-lines| memory\\-scroll| memory\\-stop\\-on\\-full| mesh\\-portal| mesh| messages\\-rx| messages\\-tx| method| metric\\-bgp| metric\\-connected| metric\\-default| metric\\-ospf| metric\\-other\\-ospf| metric\\-rip| metric\\-static| metric| mii\\-interval| min\\-runtime| min\\-rx| mirror\\-source| mirror\\-target| mode\\-cfg| modem\\-init| modem\\-signal\\-treshold| mode| monitor| mpls\\-mtu| mpls\\-te\\-area| mpls\\-te\\-router\\-id| mq\\-pfifo\\-limit| mrru| mschapv2\\-password| mschapv2\\-username| mss| mtu| multicast\\-buffering| multicast\\-helper| multihop| multiple\\-channels| multiplier| my\\-id\\-user\\-fqdn| name| nas\\-port\\-type| nat\\-traversal| neighbor\\-id| neighbors| neighbor| netmask| network\\-type| network| new\\-connection\\-mark| new\\-dscp| new\\-mss| new\\-packet\\-mark| new\\-priority| new\\-routing\\-mark| new\\-ttl| next\\-server| nexthop\\-choice| no\\-ping\\-delay| noise\\-floor\\-threshold| note| nth| ntp\\-server| null\\-modem| num| nv2\\-cell\\-radius| nv2\\-noise\\-floor\\-offset| nv2\\-preshared\\-key| nv2\\-qos| nv2\\-queue\\-count| nv2\\-security| offline\\-time| on\\-alert| on\\-backup| on\\-battery| on\\-event| on\\-fail\\-retry\\-time| on\\-interface| on\\-line| on\\-link| on\\-login| on\\-logout| on\\-master| one\\-session\\-per\\-host| only\\-headers| only\\-one| open\\-status\\-page| organization| organziation| orig\\-mac\\-address| origination\\-interval| originator| ospf\\-type| other\\-configuration| out\\-bridge\\-port| out\\-bridge| out\\-bundle\\-check\\-errors| out\\-bundle\\-errors| out\\-errors| out\\-filter| out\\-interface| out\\-no\\-states| out\\-policy\\-blocked| out\\-policy\\-dead| out\\-policy\\-errors| out\\-prefix\\-list| out\\-state\\-expired| out\\-state\\-mode\\-errors| out\\-state\\-protocol\\-errors| out\\-state\\-sequence\\-errors| outgoing\\-filter| outgoing\\-packet\\-mark| output\\-voltage| overloaded\\-output| p2p| packet\\-mark| packet\\-size| packet\\-type| packets| page\\-refresh| parent\\-proxy\\-port| parent\\-proxy| parent\\-queue| parity| passive| password| path\\-cost| path\\-vector\\-limit| path| pci\\-info| pcq\\-burst\\-rate| pcq\\-burst\\-threshold| pcq\\-burst\\-time| pcq\\-classifier| pcq\\-dst\\-address\\-mask| pcq\\-dst\\-address6\\-mask| pcq\\-limit| pcq\\-rate| pcq\\-src\\-address\\-mask| pcq\\-src\\-address6\\-mask| pcq\\-total\\-limit| peek\\-rate| per\\-connection\\-classifier| periodic\\-calibration\\-interval| periodic\\-calibration| pfifo\\-limit| pfs\\-group| pfs| phone| phy\\-regs| pin| platform| poe\\-out| poe\\-priority| point\\-to\\-point\\-port| point\\-to\\-point| policy\\-group| policy| poll\\-interval| pool\\-name| pool\\-prefix\\-length| port\\-count| port\\-number| port\\-type| ports| port| pps| preamble\\-mode| preemption\\-mode| pref\\-src| preferred\\-gateway| preferred\\-lifetime| prefix\\-length| prefix| primary\\-ntp| primary\\-path| primary\\-retry\\-interval| primary\\-server| primary| priority| prism\\-cardtype| private\\-algo| private\\-key| private\\-pre\\-shared\\-key| profile| propagate\\-ttl| proposal\\-check| proposal| proprietary\\-extensions| proprietary\\-extension| protocol\\-mode| protocol| psd| pw\\-mtu| pw\\-type| query\\-server\\-timeout| query\\-total\\-timeout| queue\\-type| queue| quick| ra\\-delay| ra\\-interval| ra\\-lifetime| radio\\-name| radius\\-accounting| radius\\-default\\-domain| radius\\-eap\\-accounting| radius\\-interim\\-update| radius\\-location\\-name| radius\\-mac\\-authentication| radius\\-mac\\-caching| radius\\-mac\\-format| radius\\-mac\\-mode| random\\-data| random| ranges| range| rate\\-limit| rate\\-selection| rate\\-set| rates\\-a\\/g| rates\\-b| rate| raw\\-value| reachable\\-time| read\\-access| read\\-only| receive\\-all| receive\\-enabled| receive\\-errors| receive| record\\-route| red\\-avg\\-packet| red\\-burst| red\\-limit| red\\-max\\-threshold| red\\-min\\-threshold| redirect\\-to| redistribute\\-bgp| redistribute\\-connected| redistribute\\-ospf| redistribute\\-other\\-bgp| redistribute\\-other\\-ospf| redistribute\\-rip| redistribute\\-static| refresh\\-time| regexp| reject\\-with| relay| release| remember| remote\\-address| remote\\-as| remote\\-certificate| remote\\-mac| remote\\-peer| remote\\-port| remote\\-tx\\-speed| remote\\-udp\\-tx\\-size| remote| remove\\-private\\-as| renew| reoptimize\\-interval| reoptimize\\-paths| replace\\-battery| replay| req\\-fingerprint| require\\-client\\-certificate| resends| reset\\-alert| reset\\-counters\\-all| reset\\-counters| reset\\-mac\\-address| resource\\-class| retransmit\\-interval| role| root\\-bridge\\-id| root\\-bridge| root\\-path\\-cost| root\\-port| route\\-comment| route\\-distinguisher| route\\-reflect| route\\-tag| route\\-target| router\\-id| routes| routing\\-mark| routing\\-table| rp\\-filter| rp_filter| runtime\\-calibration\\-running| runtime\\-left| rx\\-band| rx\\-channel\\-width| rx\\-frequency| rx\\-radio| sa\\-dst\\-address| sa\\-src\\-address| sa\\-type| same\\-not\\-by\\-dst| satellites| scan\\-list| scope| secondary\\-ntp| secondary\\-paths| secondary\\-server| secret| secure\\-redirects| security\\-profile| security| send\\-dns| send\\-email\\-from| send\\-email\\-to| send\\-initial\\-contact| send\\-redirects| send\\-smtp\\-server| send\\-targeted| sending\\-rstp| send| seq\\-number| serial\\-number| serialize\\-connections| servers| server| service\\-name| session\\-timeout| set\\-bgp\\-communities| set\\-bgp\\-local\\-pref| set\\-bgp\\-med| set\\-bgp\\-prepend\\-path| set\\-bgp\\-prepend| set\\-bgp\\-weight| set\\-check\\-gateway| set\\-disabled| set\\-distance| set\\-in\\-nexthop\\-direct| set\\-in\\-nexthop\\-ipv6| set\\-in\\-nexthop\\-linklocal| set\\-in\\-nexthop| set\\-metric| set\\-out\\-nexthop\\-ipv6| set\\-out\\-nexthop\\-linklocal| set\\-out\\-nexthop| set\\-pref\\-src| set\\-route\\-comment| set\\-route\\-tag| set\\-route\\-targets| set\\-routing\\-mark| set\\-scope| set\\-site\\-of\\-origin| set\\-system\\-time| set\\-target\\-scope| set\\-type| set\\-use\\-te\\-nexthop| setup\\-priority| setup| sfp\\-rate\\-select| sfq\\-allot| sfq\\-perturb| shared\\-users| share| show\\-at\\-login| show\\-dummy\\-rule| signal\\-range| silent\\-boot| sim\\-pin| simple\\-queue| sip\\-direct\\-media| site\\-id| site\\-of\\-origin| size| skin| slaves| smart\\-boost\\-mode| smart\\-ssdd\\-mode| smtp\\-server| software\\-id| source| speed| spi| split\\-include| split\\-user\\-domain| src\\-address\\-list| src\\-address\\-type| src\\-address| src\\-mac\\-address| src\\-mac| src\\-path| src\\-port| ssid\\-all| ssid| ssl\\-certificate| start\\-time| start| state| static\\-algo\\-0| static\\-algo\\-1| static\\-algo\\-2| static\\-algo\\-3| static\\-key\\-0| static\\-key\\-1| static\\-key\\-2| static\\-key\\-3| static\\-sta\\-private\\-algo| static\\-sta\\-private\\-key| static\\-transmit\\-key| station\\-bridge\\-clone\\-mac| stats\\-samples\\-to\\-keep| status\\-autorefresh| status| stop\\-bits| stop| store\\-every| store\\-leases\\-disk| store\\-name| store\\-on\\-disk| stp\\-flags| stp\\-forward\\-delay| stp\\-hello\\-time| stp\\-max\\-age| stp\\-msg\\-age| stp\\-port| stp\\-root\\-address| stp\\-root\\-cost| stp\\-root\\-priority| stp\\-sender\\-address| stp\\-sender\\-priority| stp\\-type| streaming\\-enabled| streaming\\-max\\-rate| streaming\\-server| subject| summary\\-only| supplicant\\-identity| supported\\-bands| supported\\-rates\\-a\\/g| supported\\-rates\\-b| suppress\\-filter| synchronize| syslog\\-facility| syslog\\-severity| syslog\\-time\\-format| target\\-scope| target| tcp\\-close\\-timeout| tcp\\-close\\-wait\\-timeout| tcp\\-connection\\-count| tcp\\-established\\-timeout| tcp\\-fin\\-wait\\-timeout| tcp\\-flags| tcp\\-last\\-ack\\-timeout| tcp\\-md5\\-key| tcp\\-mss| tcp\\-syn\\-received\\-timeout| tcp\\-syn\\-sent\\-timeout| tcp\\-syncookies| tcp\\-time\\-wait\\-timeout| tcp_syncookies| tdma\\-debug| tdma\\-hw\\-test\\-mode| tdma\\-override\\-rate| tdma\\-override\\-size| tdma\\-period\\-size| tdma\\-test\\-mode| te\\-metric| template| test\\-audio| test\\-id| threshold| time\\-zone\\-name| time\\-zone| timeout\\-timer| timeout| time| tls\\-certificate| tls\\-mode| tls| to\\-addresses| to\\-address| to\\-arp\\-reply\\-mac\\-address| to\\-dst\\-mac\\-address| to\\-ports| to\\-src\\-mac\\-address| top\\-bits| topics| total| to| traffic| transfer\\-cause| transit\\-area| translator\\-role| transmit\\-delay| transmit\\-hash\\-policy| transmit\\-hold\\-count| transparent\\-proxy| transport\\-address| transport| trap\\-generators| trap\\-target| trap\\-version| trial\\-uptime| trial\\-user\\-profile| trigger| trusted| ttl| tunnel\\-id| tunnel| tx\\-band| tx\\-channel\\-width| tx\\-frequency| tx\\-power\\-mode| tx\\-power| tx\\-radio| tx\\-template| type| udp\\-stream\\-timeout| udp\\-timeout| unicast\\-ciphers| unit| unpack| up\\-delay| up\\-flood\\-thresholds| up\\-script| update\\-source| update\\-stats\\-interval| update\\-timer| upload| uptime| url| usb\\-version| use\\-bfd| use\\-compression| use\\-control\\-word| use\\-cspf| use\\-dn| use\\-encryption| use\\-explicit\\-null| use\\-ip\\-firewall\\-for\\-pppoe| use\\-ip\\-firewall\\-for\\-vlan| use\\-ip\\-firewall| use\\-mpls| use\\-peer\\-dns| use\\-peer\\-ntp| use\\-radius| use\\-service\\-tag| use\\-src\\-mac| use\\-udp| use\\-vj\\-compression| username| user| v3\\-protocol| v9\\-template\\-refresh| v9\\-template\\-timeout| valid\\-lifetime| valid\\-server| valid| value| vendor\\-id| vendor| verify\\-client\\-certificate| verify\\-server\\-address\\-from\\-certificate| verify\\-server\\-certificate| version| vlan\\-encap| vlan\\-header| vlan\\-id| vlan\\-mode| vlan\\-priority| vpls\\-id| vrid| watch\\-address| watchdog\\-timer| wds\\-address| wds\\-cost\\-range| wds\\-default\\-bridge| wds\\-default\\-cost| wds\\-ignore\\-ssid| wds\\-mode| wins\\-server| wireless\\-protocol| wmm\\-support| wpa\\-pre\\-shared\\-key| wpa2\\-pre\\-shared\\-key| write\\-access| xauth\\-login| xauth\\-password| zone )\\b(?!-)(([\\s\\t]*?)(=))?)";

  use_encs[0] = ONIG_ENCODING_ASCII;
  onig_initialize(use_encs, sizeof(use_encs)/sizeof(use_encs[0]));

  r = onig_new(&reg, pattern, pattern + strlen((char* )pattern),
        ONIG_OPTION_DEFAULT, ONIG_ENCODING_ASCII, ONIG_SYNTAX_DEFAULT, &einfo);
  if (r != ONIG_NORMAL) {
    char s[ONIG_MAX_ERROR_MESSAGE_LEN];
    onig_error_code_to_str((UChar* )s, r, &einfo);
    fprintf(stderr, "ERROR: %s\n", s);
    return -1;
  }

  onig_free(reg);
  onig_end();
  return 0;
}

(if someone wants to try this, I cloned the oniguruma repo and modified the samples/simple.c program. The examples can be built with cmake)

@sharkdp
Copy link
Owner

sharkdp commented Sep 22, 2020

@eggbean: as a workaround for now, you could try to tweak (or remove) this long regex from the converted sublime syntax such that the segfault does not appear. Another option would be to build a fancy-regex-version of bat. Note, however, that some other syntaxes might not work as expected.

@eggbean
Copy link
Author

eggbean commented Sep 22, 2020

I think I will have to wait in hope that this apparent bug gets fixed and use my laptop instead in the mean time. Tell me if there is anything else I can do, but I would need instructions. Thanks for your help.

@sharkdp sharkdp added help wanted Extra attention is needed upstream-error A bug in an upstream component labels Oct 1, 2020
@sharkdp sharkdp changed the title Why doesn't this .tmLanguage syntax work? 'bat cache --build' crashes on armv7 Oct 1, 2020
@sharkdp sharkdp removed the question Further information is requested label Oct 1, 2020
sharkdp added a commit that referenced this issue Jan 9, 2021
@sharkdp
Copy link
Owner

sharkdp commented Jan 9, 2021

If I pin the version of onig_sys to 69.5.1, I can actually reproduce the crash with cross run (which is just fantastic: it cross-compiles the code for ARM and then executes it with QEMU):

▶ cross run --target armv7-unknown-linux-musleabihf 
    Finished dev [unoptimized + debuginfo] target(s) in 0.03s
     Running `qemu-arm /target/armv7-unknown-linux-musleabihf/debug/onig-segfault`
Segmentation fault (core dumped)

If I use the latest version of onig, I can not reproduce the crash. Seems like this problem has been fixed upstream. This should fix it in bat as well: #1495

sharkdp added a commit that referenced this issue Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed upstream-error A bug in an upstream component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants