Core Dumps

PR_SET_DUMPABLE ?
Hello fellow FreeBSD community members, can you please help?

Where can we set up application based core file dumps? I can get crash data for system crashes however applications when they do segmentation faults are not generating a crash file anywhere. This I have learned is OS specific. Some applications we can set the folder where they should be dumped however it will not allow them to generate a core dump file anywhere I have set /var/crashes however nothing gets dumped....

I am attempting to get Squid segmentation core dump files however it won't generate one like it is disabled in the os. I have it set to a specific location however I get nothing.


Here is my Squid config
Line 252 shows my location set for core dumps however I get nothing.

I have also set kern.sugid_coredump 1 however I am not getting application core dumps only system crashes.

Ref:

I have also posted on Netgate forum and used Squid user email system. Netgate not many users are this into Squid so no responses, and Squid user email the developers said to enable application core dumps it's OS specific.

"Beyond using a reasonable coredump_dir value in squid.conf, the system administration problems you need to solve to enable Squid core dumps are most likely not specific to Squid."

How can I enable this in FreeBSD?


Code:
# This file is automatically generated by pfSense
# Do not edit manually !

http_port 192.168.1.1:3128 ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=20MB cert=/usr/local/etc/squid/serverkey.pem tls-cafile=/usr/local/share/certs/ca-root-nss.crt capath=/usr/local/share/certs/ cipher=EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:HIGH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS tls-dh=prime256v1:/etc/dh-parameters.2048 options=NO_SSLv3

http_port 127.0.0.1:3128 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=20MB cert=/usr/local/etc/squid/serverkey.pem tls-cafile=/usr/local/share/certs/ca-root-nss.crt capath=/usr/local/share/certs/ cipher=EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:HIGH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS tls-dh=prime256v1:/etc/dh-parameters.2048 options=NO_SSLv3

https_port 127.0.0.1:3129 intercept ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=20MB cert=/usr/local/etc/squid/serverkey.pem tls-cafile=/usr/local/share/certs/ca-root-nss.crt capath=/usr/local/share/certs/ cipher=EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:HIGH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS tls-dh=prime256v1:/etc/dh-parameters.2048 options=NO_SSLv3

icp_port 0
digest_generation off
dns_v4_first on
pid_filename /var/run/squid/squid.pid
cache_effective_user squid
cache_effective_group proxy
error_default_language en
icon_directory /usr/local/etc/squid/icons
visible_hostname Lee_Family.home.arpa
cache_mgr jonathanlee571@gmail.com
access_log /var/squid/logs/access.log
cache_log /var/squid/logs/cache.log
cache_store_log none
netdb_filename /var/squid/logs/netdb.state
pinger_enable on
pinger_program /usr/local/libexec/squid/pinger
sslcrtd_program /usr/local/libexec/squid/security_file_certgen -s /var/squid/lib/ssl_db -M 4MB -b 2048
tls_outgoing_options cafile=/usr/local/share/certs/ca-root-nss.crt
tls_outgoing_options capath=/usr/local/share/certs/
tls_outgoing_options options=NO_SSLv3
tls_outgoing_options cipher=EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+RC4:EECDH:EDH+aRSA:HIGH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS
sslcrtd_children 10

logfile_rotate 0
debug_options rotate=0
shutdown_lifetime 3 seconds
# Allow local network(s) on interface(s)
acl localnet src  192.168.1.0/27
forwarded_for transparent
httpd_suppress_version_string on
uri_whitespace strip

acl block_hours time 00:30-05:00
ssl_bump terminate all block_hours
http_access deny all block_hours
acl getmethod method GET
acl to_ipv6 dst ipv6
acl from_ipv6 src ipv6

#tls_outgoing_options options=0x40000
request_header_access Accept-Ranges deny all
reply_header_access Accept-Ranges deny all
request_header_replace Accept-Ranges none
reply_header_replace Accept-Ranges none


tls_outgoing_options cipher=HIGH:MEDIUM:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS
tls_outgoing_options options=NO_SSLv3,SINGLE_DH_USE,SINGLE_ECDH_USE

acl HttpAccess dstdomain '/usr/local/pkg/http.access'
acl windowsupdate dstdomain '/usr/local/pkg/windowsupdate'
acl rewritedoms dstdomain '/usr/local/pkg/desdom'

store_id_program /usr/local/libexec/squid/storeid_file_rewrite /var/squid/storeid/storeid_rewrite.txt
store_id_children 10 startup=5 idle=1 concurrency=0
always_direct allow all
#store_id_access deny connect
store_id_access deny !getmethod
store_id_access allow rewritedoms
store_id_access deny all

refresh_all_ims on
reload_into_ims on
max_stale 20 years
minimum_expiry_time 0

refresh_pattern -i ^http.*squid.internal.* 43200 100% 79900 override-expire override-lastmod ignore-reload ignore-no-store ignore-must-revalidate ignore-private ignore-auth

#FACEBOOK
refresh_pattern ^https.*.facebook.com/* 10080 80% 43200

#FACEBOOK IMAGES 
refresh_pattern -i pixel.facebook.com..(jpg|png|gif|ico|css|js|jpg?) 10080 80% 43200
refresh_pattern -i .akamaihd.net..(jpg|png|gif|ico|css|js|jpg?) 10080 80% 43200
refresh_pattern -i facebook.com.(jpg|png|gif|jpg?) 10080 80% 43200 store-stale
refresh_pattern static.(xx|ak).fbcdn.net.(jpg|gif|png|jpg?) 10080 80% 43200
refresh_pattern ^https.*profile.ak.fbcdn.net.*(jpg|gif|png|jpg?) 10080 80% 43200
refresh_pattern ^https.*fbcdn.net.*(jpg|gif|png|jpg?) 10080 80% 43200

#FACEBOOK VIDEO
refresh_pattern -i .video.ak.fbcdn.net.*.(mp4|flv|mp3|amf) 10080 80% 43200
refresh_pattern (audio|video)/(webm|mp4) 10080 80% 43200

#APPLE STUFF
refresh_pattern -i apple.com/..(cab|exe|msi|msu|msf|asf|wmv|wma|dat|zip|dist)$ 0 80% 43200  refresh-ims

#apple update
refresh_pattern -i (download|adcdownload).apple.com/.*.(pkg|dmg) 4320 100% 43200
refresh_pattern -i appldnld.apple.com 129600 100% 129600
refresh_pattern -i phobos.apple.com 129600 100% 129600
refresh_pattern -i iosapps.itunes.apple.com 129600 100% 129600

# Updates: Windows
refresh_pattern -i microsoft.com/..(cab|exe|msi|msu|msf|asf|wma|dat|zip)$ 4320 80% 43200  refresh-ims
refresh_pattern -i windowsupdate.com/..(cab|exe|msi|msu|msf|asf|wma|wmv)|dat|zip)$ 4320 80% 43200  refresh-ims
refresh_pattern -i windows.com/..(cab|exe|msi|msu|msf|asf|wmv|wma|dat|zip)$ 4320 80% 43200  refresh-ims
refresh_pattern -i microsoft.com/.*.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip) 4320 80% 43200
refresh_pattern -i windowsupdate.com/.*.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip) 4320 80% 43200
refresh_pattern -i windows.com/.*.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip) 4320 80% 43200
refresh_pattern -i .*windowsupdate.com/.*.(cab|exe) 259200 100% 259200   
refresh_pattern -i .*update.microsoft.com/.*.(cab|exe|dll|msi|psf) 259200 100% 259200   
refresh_pattern windowsupdate.com/.*.(cab|exe|dll|msi|psf) 10080 100% 43200
refresh_pattern download.microsoft.com/.*.(cab|exe|dll|msi|psf) 10080 100% 43200
refresh_pattern www.microsoft.com/.*.(cab|exe|dll|msi|psf) 10080 100% 43200
refresh_pattern au.download.windowsupdate.com/.*.(cab|exe|dll|msi|psf) 4320 100% 43200
refresh_pattern bg.v4.pr.dl.ws.microsoft.com/.*.(cab|exe|dll|msi|psf) 4320 100% 43200
#windows update NEW UPDATE 0.04
refresh_pattern update.microsoft.com/.*.(cab|exe) 43200 100% 129600   
refresh_pattern ([^.]+.)?(download|(windows)?update).(microsoft.)?com/.*.(cab|exe|msi|msp|psf) 4320 100% 43200 
refresh_pattern update.microsoft.com/.*.(cab|exe|dll|msi|psf) 10080 100% 43200
refresh_pattern -i .update.microsoft.com/.*.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip) 525600 100% 525600       
refresh_pattern -i .windowsupdate.com/.*.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip) 525600 100% 525600       
refresh_pattern -i .download.microsoft.com/.*.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip) 525600 100% 525600       
refresh_pattern -i .ws.microsoft.com/.*.(cab|exe|ms[i|u|f]|[ap]sf|wm[v|a]|dat|zip) 525600 100% 525600       
    
refresh_pattern ([^.]+.)?(cs|content[1-9]|hsar|content-origin|client-download).[steampowered|steamcontent].com/.*.* 43200 100% 43200     
refresh_pattern ([^.]+.)?.akamai.steamstatic.com/.*.* 43200 100% 43200

refresh_pattern -i ([^.]+.)?.adobe.com/.*.(zip|exe) 43200 100% 43200
refresh_pattern -i ([^.]+.)?.java.com/.*.(zip|exe) 43200 100% 43200
refresh_pattern -i ([^.]+.)?.sun.com/.*.(zip|exe) 43200 100% 43200
refresh_pattern -i ([^.]+.)?.oracle.com/.*.(zip|exe|tar.gz) 43200 100% 43200

refresh_pattern -i appldnld.apple.com 43200 100% 43200
refresh_pattern -i ([^.]+.)?apple.com/.*.(ipa) 43200 100% 43200
 
refresh_pattern -i ([^.]+.)?.google.com/.*.(exe|crx) 10080 80% 43200
refresh_pattern -i ([^.]+.)?g.static.com/.*.(exe|crx) 10080 80% 43200

acl https_login url_regex -i ^https.*(login|Login).*
cache deny https_login

range_offset_limit 512 MB windowsupdate
range_offset_limit 4 MB
range_offset_limit 0
quick_abort_min -1 KB

cache_mem 64 MB
maximum_object_size_in_memory 256 KB
memory_replacement_policy heap GDSF
cache_replacement_policy heap LFUDA
minimum_object_size 0 KB
maximum_object_size 512 MB
cache_dir diskd /var/squid/cache 64000 256 256
offline_mode off
cache_swap_low 90
cache_swap_high 95
acl donotcache dstdomain '/var/squid/acl/donotcache.acl'
cache deny donotcache
cache allow all
# Add any of your own refresh_pattern entries above these.
refresh_pattern ^ftp:    1440  20%  10080
refresh_pattern ^gopher:  1440  0%  1440
refresh_pattern -i (/cgi-bin/|?) 0  0%  0
refresh_pattern .    0  20%  4320


#Remote proxies


# Setup some default acls
# ACLs all, manager, localhost, and to_localhost are predefined.
acl allsrc src all
acl safeports port 21 70 80 210 280 443 488 563 591 631 777 901 8080 3128 3129 1025-65535
acl sslports port 443 563 8080 5223 2197

acl purge method PURGE
acl connect method CONNECT

# Define protocols used for redirects
acl HTTP proto HTTP
acl HTTPS proto HTTPS

# SslBump Peek and Splice
# http://wiki.squid-cache.org/Features/SslPeekAndSplice
# http://wiki.squid-cache.org/ConfigExamples/Intercept/SslBumpExplicit
# Match against the current step during ssl_bump evaluation [fast]
# Never matches and should not be used outside the ssl_bump context.
#
# At each SslBump step, Squid evaluates ssl_bump directives to find
# the next bumping action (e.g., peek or splice). Valid SslBump step
# values and the corresponding ssl_bump evaluation moments are:
#   SslBump1: After getting TCP-level and HTTP CONNECT info.
#   SslBump2: After getting TLS Client Hello info.
#   SslBump3: After getting TLS Server Hello info.
# These ACLs exist even when 'SSL/MITM Mode' is set to 'Custom' so that
# they can be used there for custom configuration.
acl step1 at_step SslBump1
acl step2 at_step SslBump2
acl step3 at_step SslBump3
acl banned_hosts src '/var/squid/acl/banned_hosts.acl'
acl whitelist dstdom_regex -i '/var/squid/acl/whitelist.acl'
acl blacklist dstdom_regex -i '/var/squid/acl/blacklist.acl'
http_access allow manager localhost

http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !safeports
http_access deny CONNECT !sslports

# Always allow localhost connections
http_access allow localhost

quick_abort_min 0 KB
quick_abort_max 0 KB
quick_abort_pct 95
request_body_max_size 0 KB
delay_pools 1
delay_class 1 2
delay_parameters 1 -1/-1 -1/-1
delay_initial_bucket_level 100
delay_access 1 allow allsrc

# Reverse Proxy settings

deny_info TCP_RESET allsrc

# Package Integration
url_rewrite_program /usr/local/bin/squidGuard -c /usr/local/etc/squidGuard/squidGuard.conf
url_rewrite_bypass off
url_rewrite_children 32 startup=8 idle=4 concurrency=0

# Custom options before auth
#host_verify_strict on

# These hosts are banned
http_access deny banned_hosts
# Always allow access to whitelist domains
http_access allow whitelist
# Block access to blacklist domains
http_access deny blacklist
# List of domains allowed to logging in to Google services
request_header_access X-GoogApps-Allowed-Domains deny all
request_header_add X-GoogApps-Allowed-Domains consumer_accounts
# Set YouTube safesearch restriction
acl youtubedst dstdomain -n www.youtube.com m.youtube.com youtubei.googleapis.com youtube.googleapis.com www.youtube-nocookie.com
request_header_access YouTube-Restrict deny all
request_header_add YouTube-Restrict none youtubedst
acl sglog url_regex -i sgr=ACCESSDENIED
http_access deny sglog
# Custom SSL/MITM options before auth
coredump_dir /var/crash
cachemgr_passwd disable offline_toggle reconfigure shutdown
cachemgr_passwd REDACTED all
eui_lookup on
acl no_miss url_regex -i gateway.facebook.com/ws/realtime?
acl no_miss url_regex -i web-chat-e2ee.facebook.com/ws/chat
acl CONNECT method CONNECT
acl wuCONNECT dstdomain www.update.microsoft.com
acl wuCONNECT dstdomain sls.microsoft.com
http_access allow CONNECT wuCONNECT localnet
http_access allow CONNECT wuCONNECT localhost
http_access allow windowsupdate localnet
http_access allow windowsupdate localhost
http_access allow HttpAccess localnet
http_access allow HttpAccess localhost
http_access deny manager
http_access deny to_ipv6
http_access deny from_ipv6

acl BrokenButTrustedServers dstdomain '/usr/local/pkg/dstdom.broken'
acl DomainMismatch ssl_error SQUID_X509_V_ERR_DOMAIN_MISMATCH
sslproxy_cert_error allow BrokenButTrustedServers DomainMismatch
sslproxy_cert_error deny all

acl splice_only src 192.168.1.8 #Tasha iPhone
acl splice_only src 192.168.1.10 #Jon iPhone
acl splice_only src 192.168.1.11 #Amazon Fire
acl splice_only src 192.168.1.15 #Tasha HP
acl splice_only src 192.168.1.16 #iPad

acl splice_only_mac arp REACTED MAC ADDRESS
acl splice_only_mac arp REACTED MAC ADDRESS
acl splice_only_mac arp REACTED MAC ADDRESS
acl splice_only_mac arp REACTED MAC ADDRESS
acl splice_only_mac arp REACTED MAC ADDRESS

acl NoSSLIntercept ssl::server_name_regex -i '/usr/local/pkg/reg.url.nobump'
acl NoBumpDNS dstdomain '/usr/local/pkg/dns.nobump'

acl markBumped annotate_client bumped=true
acl active_use annotate_client active=true
acl bump_only src 192.168.1.3 #webtv
acl bump_only src 192.168.1.4 #toshiba
acl bump_only src 192.168.1.5 #imac
acl bump_only src 192.168.1.9 #macbook
acl bump_only src 192.168.1.13 #dell

acl bump_only_mac arp REACTED MAC ADDRESS
acl bump_only_mac arp REACTED MAC ADDRESS
acl bump_only_mac arp REACTED MAC ADDRESS
acl bump_only_mac arp REACTED MAC ADDRESS
acl bump_only_mac arp REACTED MAC ADDRESS

ssl_bump peek step1
miss_access deny no_miss active_use
ssl_bump splice https_login active_use
ssl_bump splice splice_only_mac splice_only active_use
ssl_bump splice NoBumpDNS active_use
ssl_bump splice NoSSLIntercept active_use
ssl_bump bump bump_only_mac bump_only active_use
acl activated note active_use true
ssl_bump terminate !activated

acl markedBumped note bumped true
url_rewrite_access deny markedBumped

#workers 3
read_ahead_gap 32 KB
#negative_ttl 1 second
#connect_timeout 30 seconds
#request_timeout 60 seconds
#half_closed_clients off
#shutdown_lifetime 10 seconds
#negative_dns_ttl 1 seconds
#ignore_unknown_nameservers on
#client_persistent_connections off
#server_persistent_connections off
#pipeline_prefetch 100

#acl SSLIntercept ssl::server_name_regex -i '/usr/local/pkg/url.bump'
#ssl_bump bump SSLIntercept

# Setup allowed ACLs
# Allow local network(s) on interface(s)
http_access allow localnet
# Default block all to be sure
http_access deny allsrc

icap_enable on
icap_send_client_ip on
icap_send_client_username on
icap_client_username_encode off
icap_client_username_header X-Authenticated-User
icap_preview_enable on
icap_preview_size 1024

icap_service service_avi_req reqmod_precache icap://127.0.0.1:1344/squid_clamav bypass=off
adaptation_access service_avi_req allow all
icap_service service_avi_resp respmod_precache icap://127.0.0.1:1344/squid_clamav bypass=on
adaptation_access service_avi_resp allow all

My Squid works perfectly every once and a while I get a segmentation fault however I need a core dump for developers.
n 11 10:29:15kernelpid 4993 (squid), jid 0, uid 100: exited on signal 6
Jun 11 10:29:15(squid-1)4993FATAL: Received Segment Violation...dying. listening port: 127.0.0.1:3128
Jun 11 10:23:13kernelpid 43536 (squid), jid 0, uid 100: exited on signal 6
Jun 11 10:23:05(squid-1)43536FATAL: Received Segment Violation...dying. connection: conn749025 local=192.168.1.1:3128 remote=192.168.1.5:59502 flags=1
Jun 11 10:19:00sshguard98282Now monitoring attacks.

Please help where can I get the coredump file enabled for applications?
 
Screenshot 2024-06-12 at 08.50.38.png


Everything works however once in a while if I am looking at Facebook reels it crashes and this is with or without StoreID being utilized and using the cache or non cache use. Something causes a segmentation fault I can not get the application core dump for some reason.
 
Code:
 $ls -ld /var/log/squid
drwxr-x---  2 squid  squid  24 Jun 12 18:52 /var/log/squid
i have it set to the same place at squid logs and it works
 
Do you use the

coredump_dir

Directive?

Have you managed to manually trigger a core dump with

Per Squid developers

Code:
For example, if you want to abort a Squid worker process that has OS process ID (PID) 12345, you may do something like this:

   sudo kill -SIGABRT 12345

You can use "ps" or "top" commands to learn PIDs of processes you want to signal.
 
Is this a squid command or freebsd?
Shell command. Run 'ulimit -a' to see your current limits. The -c switch allows you to specify the max size of core files, saying 'unlimited' allows core files to grow to any size. The same command in csh is 'limit', I believe. Depends which shell you are running. Cores are usually off by default.

Specifically, you want to make sure that you run 'ulimit -c unlimited' in the shell that you launch squid from. Core files will be written to the squid process's current woking directory by default, but it looks like squid allows you to configure that from reading this thread.
 
Code:
cpu time               (seconds, -t)  unlimited
file size           (512-blocks, -f)  unlimited
data seg size           (kbytes, -d)  1048576
stack size              (kbytes, -s)  1048576
core file size      (512-blocks, -c)  unlimited
max memory size         (kbytes, -m)  unlimited
locked memory           (kbytes, -l)  131072
max user processes              (-u)  7894
open files                      (-n)  97578
virtual mem size        (kbytes, -v)  unlimited
swap limit              (kbytes, -w)  unlimited
socket buffer size       (bytes, -b)  unlimited
pseudo-terminals                (-p)  unlimited
kqueues                         (-k)  unlimited
umtx shared locks               (-o)  unlimited
 
contents of my fstab

I am using a external HDD for swap to help with clamAV live loads

Code:
# Device        Mountpoint    FStype    Options        Dump    Pass#
/dev/msdosfs/EFISYS    /boot/efi    msdosfs    rw,noatime,noauto    0    0
/dev/msdosfs/DTBFAT0    /boot/msdos    msdosfs    rw,noatime,noauto    0    0
/dev/da0        none    swap    sw        0    0
 
Code:
cpu time               (seconds, -t)  unlimited
file size           (512-blocks, -f)  unlimited
data seg size           (kbytes, -d)  1048576
stack size              (kbytes, -s)  1048576
core file size      (512-blocks, -c)  unlimited
max memory size         (kbytes, -m)  unlimited
locked memory           (kbytes, -l)  131072
max user processes              (-u)  7894
open files                      (-n)  97578
virtual mem size        (kbytes, -v)  unlimited
swap limit              (kbytes, -w)  unlimited
socket buffer size       (bytes, -b)  unlimited
pseudo-terminals                (-p)  unlimited
kqueues                         (-k)  unlimited
umtx shared locks               (-o)  unlimited
Ok, so it's already unlimited. Should be dumping cores then. Or, it's not the ulimit setting that's stopping it.
 
need to use

/dev/ada0s3b for dump

and
/dev/da0 for swapping

can I separate them?
 
Swap is fundamentally separate from other disk partitions and is controlled by the kernel's virtual memory system. I don't think process dump files can ever be written to swap space.

You need to configure squid to use ada0s3b as your dump space, but I don't know enough about squid config, suggest you do what covcat suggests.
 
Ok, so it's already unlimited. Should be dumping cores then.
Code:
Shell Output - dumpon -l
da0

I am using a external drive for swap however I do think that it transfers it back to /var/crashes on reboot for some reason it does when I set it to /dev/ada0s3b however that is a SSD and it should not swap for ClamAV on that it will kill it. I only get system crash reports when fstab has it set to

/dev/ada0s3b none swap sw 0 0

crashes show when I run
sysctl debug.kdb.panic=1

if I set fstab to
/dev/da0 none swap sw 0 0

swapping works but I never see system crashes when I run
sysctl debug.kdb.panic=1

So I can only see them when it is not using the external drive weird right?
 
Swap is fundamentally separate from other disk partitions and is controlled by the kernel's memory swap subsystem. I don't think process dump files can ever be written to swap space.

You need to configure squid to use ada0s3b as your dump space, but I don't know enough about squid config, suggest you do what covcat suggests.
Per Squid we use the coredump_dir directive however will it work maybe this...

Code:
coredump_dir "/dev/ada0s3b"
 
Per Squid we use the coredump_dir directive however will it work maybe this...

Code:
coredump_dir "/dev/ada0s3b"
Do you need the mountpoint rather than the device file? Just guessing ;-)
Well... it IS called "coredump_dir"... not "coredump_dev"...
 
Code:
Shell Output - swapinfo
Device          512-blocks     Used    Avail Capacity
/dev/da0         195371568        0 195371568     0%

I just get no coredumps with it

Output attempting to force a coredump

kill -6 or kill -11 against the PID and Squid name



Code:
Jun 12 13:40:58    kernel        pid 88818 (squid), jid 0, uid 100: exited on signal 6
Jun 12 13:40:58    (squid-1)    88818    FATAL: Received Segment Violation...dying. listening port: 192.168.1.1:3128
Jun 12 13:39:43    kernel        pid 51752 (squid), jid 0, uid 100: exited on signal 6
Jun 12 13:39:43    (squid-1)    51752    FATAL: Received Segment Violation...dying.
Jun 12 13:39:11    kernel        pid 17654 (squid), jid 0, uid 100: exited on signal 6
Jun 12 13:38:05    check_reload_status    480    Reloading filter
 
you need a filesystem for userland coredumps
only kernel dumps to swap
Great do you know how would one can create a filesystem for coredumps?

When I run this

Code:
Shell Output - dumpon -l
da0

It matches my swap

They are tied together in pfSense somehow because it does not use rc.conf

If it starts to dump it dumps to the swap and it reads it at boot up and adds to /var/crashes however I can only get that to work with the
/dev/ada0s3b

and not
/dev/da0

However I need the external drive for ClamAV to not kill the SSD I would love to still dump to the SSD and swap to the external HDD.

There is got to be a FreeBSD environment settings somewhere for this.

Code:
rc.conf shows...
# THIS FILE DOES NOTHING, DO NOT MAKE CONFIG CHANGES HERE

Code:
/etc/ddb.conf shows
# $FreeBSD$
#
#  This file is read when going to multi-user and its contents piped thru
#  ``ddb'' to define debugging scripts.
#
# see ``man 4 ddb'' and ``man 8 ddb'' for details.
#

script lockinfo=show locks; show alllocks; show lockedvnods

# kdb.enter.panic    panic(9) was called.
script kdb.enter.panic=textdump set; capture on; run lockinfo; show pcpu; bt; ps; alltrace; capture off; textdump dump; reset

# kdb.enter.witness    witness(4) detected a locking error.
script kdb.enter.witness=run lockinfo
 
OK, let's have a little sanity check.

Write this script.

$ cat try.sh
#!/bin/sh
echo "PID $$ sleeping..."
sleep 1000

Make it executable then run it.

Then "kill -11 <pid>" where <pid> is the number the script printed.

Example

$ ./try.sh
PID 148152 sleeping...

$ kill -11 148152
Segmentation fault (core dumped)

$ ls -l core*
-rw------- 1 me me 450560 Jun 12 21:50 core

Hence, check if you can get any user process to dump a core file.

If it doesn't dump core, check your ulimit -c again.
Let's prove that your system can actually write a corefile for a process that segfaults.
It should of course write the core file to the current directory.
 
Do you need the mountpoint rather than the device file? Just guessing ;-)
Well... it IS called "coredump_dir"... not "coredump_dev"...

Code:
Shell Output - mount /dev/ada0s3b /root/usb
mount: /dev/ada0s3b: Invalid fstype: Invalid argument

-t zfs does not work for some reason also
 
you don't need to create a new filesystem for dumps (if you have enough space on your root fs)
just set the dir to /var/log/squid and thats it
 
Back
Top