• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Enable core file dumps when an application crashes or segmentation faults

Scheduled Pinned Locked Moved General pfSense Questions
37 Posts 2 Posters 1.7k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J
    JonathanLee
    last edited by Jun 12, 2024, 3:20 PM

    PR_SET_DUMPABLE ?
    

    Hello fellow Netgate 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....

    Make sure to upvote

    1 Reply Last reply Reply Quote 0
    • S
      stephenw10 Netgate Administrator
      last edited by Jun 12, 2024, 4:10 PM

      Processes that segfault like that would usually dump to /root. What are you seeing segfaulting?

      J 1 Reply Last reply Jun 12, 2024, 4:31 PM Reply Quote 0
      • J
        JonathanLee @stephenw10
        last edited by Jun 12, 2024, 4:31 PM

        @stephenw10

        Thanks for the reply,

        The application is 5.8 Squid when I am looking at facebook reels and pfSense GUI at the same time for over 15 mins. Squid development team wants the core file however I can't find it. I have set the file now to dump to /root with.

        It doesn't matter if I have caching enabled disabled StoreID on or off. I am hoping that maybe someone in the Squid development team will look at the package and help. The Squid user email gets a lot of responses, they asked for the file to help. :) Weird right it shouldn't be Facebook specific like that.

        coredump_dir /root
        

        Make sure to upvote

        1 Reply Last reply Reply Quote 0
        • S
          stephenw10 Netgate Administrator
          last edited by Jun 12, 2024, 4:39 PM

          Do you see the process coredumping in the system log?

          1 Reply Last reply Reply Quote 0
          • J
            JonathanLee
            last edited by Jun 12, 2024, 5:00 PM

            No it starts swap and that file goes to cache folder weird right?

            Make sure to upvote

            1 Reply Last reply Reply Quote 0
            • S
              stephenw10 Netgate Administrator
              last edited by Jun 12, 2024, 5:05 PM

              Not sure what you mean. pfSense starts to SWAP? What file goes to the cache folder?

              J 1 Reply Last reply Jun 12, 2024, 5:07 PM Reply Quote 0
              • J
                JonathanLee @stephenw10
                last edited by JonathanLee Jun 12, 2024, 5:11 PM Jun 12, 2024, 5:07 PM

                @stephenw10 squid does a swap log squid does not pfSense, it generates a swap.log file or something in the cache folder. After I bound it to the loopback and not just the LAN I have not seen the segmentation fault. It occurred when I was viewing the squid status area the one showing active connections. So I think it needs to be also bound to loopback and not just lan. Again I still don’t feel comfortable that it didn’t creat a log, do I need to chmod, and or user group permissions for the folder?

                Make sure to upvote

                1 Reply Last reply Reply Quote 0
                • S
                  stephenw10 Netgate Administrator
                  last edited by Jun 12, 2024, 5:11 PM

                  Ah, hmm, no idea what that is then!

                  If you don't see the process segfaulting in the system log I wouldn't expect to see any core files.

                  J 2 Replies Last reply Jun 12, 2024, 5:14 PM Reply Quote 1
                  • J
                    JonathanLee @stephenw10
                    last edited by Jun 12, 2024, 5:14 PM

                    @stephenw10

                    n 11 10:29:15 kernel pid 4993 (squid), jid 0, uid 100: exited on signal 6
                    Jun 11 10:29:15 (squid-1) 4993 FATAL: Received Segment Violation...dying. listening port: 127.0.0.1:3128
                    Jun 11 10:23:13 kernel pid 43536 (squid), jid 0, uid 100: exited on signal 6
                    Jun 11 10:23:05 (squid-1) 43536 FATAL: Received Segment Violation...dying. connection: conn749025 local=192.168.1.1:3128 remote=192.168.1.5:59502 flags=1
                    Jun 11 10:19:00 sshguard 98282

                    This is the error it is a segment fault right?

                    Make sure to upvote

                    1 Reply Last reply Reply Quote 0
                    • S
                      stephenw10 Netgate Administrator
                      last edited by Jun 12, 2024, 5:15 PM

                      Oh, yes you need Squid to listen on localhost to see the stats from it. That's how it is queried.

                      J 1 Reply Last reply Jun 12, 2024, 5:18 PM Reply Quote 1
                      • J
                        JonathanLee @stephenw10
                        last edited by Jun 12, 2024, 5:18 PM

                        @stephenw10 so that solved my error, normally would that generate a corefile? Squid developers said I can manually generate a core dump also to get the stack

                        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.
                        
                        

                        When I did this it also showed no core file.

                        Make sure to upvote

                        1 Reply Last reply Reply Quote 0
                        • J
                          JonathanLee @stephenw10
                          last edited by Jun 12, 2024, 5:21 PM

                          @stephenw10 that swap file it creates is not readable it’s compiled information also. Just a side note

                          Make sure to upvote

                          1 Reply Last reply Reply Quote 0
                          • S
                            stephenw10 Netgate Administrator
                            last edited by Jun 12, 2024, 5:28 PM

                            If a process aborts and creates a core file you should see something like:

                            Mar 19 23:14:22 	kernel 		pid 76582 (php-fpm), jid 0, uid 0: exited on signal 11 (core dumped) 
                            
                            May  7 15:15:47 fw1 kernel: pid 65129 (pftop), jid 0, uid 0: exited on signal 6 (core dumped)
                            
                            J 1 Reply Last reply Jun 12, 2024, 5:30 PM Reply Quote 1
                            • J
                              JonathanLee @stephenw10
                              last edited by JonathanLee Jun 12, 2024, 5:40 PM Jun 12, 2024, 5:30 PM

                              @stephenw10 do you know how or what commands are used to manually trigger it for squid?

                              Make sure to upvote

                              1 Reply Last reply Reply Quote 0
                              • S
                                stephenw10 Netgate Administrator
                                last edited by Jun 12, 2024, 5:49 PM

                                Nope not something I've ever tried. Did you try the command they gave you?

                                J 1 Reply Last reply Jun 12, 2024, 5:55 PM Reply Quote 0
                                • S
                                  stephenw10 Netgate Administrator
                                  last edited by Jun 12, 2024, 5:54 PM

                                  @JonathanLee said in Enable core file dumps when an application crashes or segmentation faults:

                                  coredump_dir /root

                                  Where did you set that?

                                  J 1 Reply Last reply Jun 12, 2024, 5:55 PM Reply Quote 0
                                  • J
                                    JonathanLee @stephenw10
                                    last edited by JonathanLee Jun 12, 2024, 6:01 PM Jun 12, 2024, 5:55 PM

                                    @stephenw10 yes it showed blank from command input in GUI it killed the process but no core file it didn’t generate one when I used that command

                                    I am going to try this one recommend by a freeBSD forum user

                                    
                                    killall -11 squid worked for me (as root)
                                    
                                    

                                    Make sure to upvote

                                    1 Reply Last reply Reply Quote 0
                                    • J
                                      JonathanLee @stephenw10
                                      last edited by JonathanLee Jun 12, 2024, 5:58 PM Jun 12, 2024, 5:55 PM

                                      @stephenw10 advanced options on squid configure gui area, it takes when I run squid -k parse also

                                      Make sure to upvote

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        stephenw10 Netgate Administrator
                                        last edited by Jun 12, 2024, 6:14 PM

                                        It tries to dump the core for both the main and child squid processes here but fails with:

                                        Jun 12 19:02:08 	kernel 		pid 80887 (squid), jid 0, uid 0: exited on signal 6 (no core dump - bad address)
                                        Jun 12 19:01:48 	kernel 		pid 33418 (squid), jid 0, uid 100: exited on signal 6 (no core dump - bad address) 
                                        
                                        J 2 Replies Last reply Jun 12, 2024, 6:16 PM Reply Quote 1
                                        • J
                                          JonathanLee @stephenw10
                                          last edited by JonathanLee Jun 12, 2024, 6:16 PM Jun 12, 2024, 6:16 PM

                                          @stephenw10 that looks like a permissions issue with Squid I wonder if we set it to squid logs location if that would work? Bad address? Does it mean path?

                                          Make sure to upvote

                                          1 Reply Last reply Reply Quote 0
                                          20 out of 37
                                          • First post
                                            20/37
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received