Replying to Avatar daum3ns

ok i need some help🤗

i have a multithreaded c application.. i run into an error where i can not allocate more shared memory so i call the fatal error handler.. so far so good, error detected.. now in the error handler i want to

- log some message

- write a coredum

- end all processes i.e terminate the application

i do this by sending a sigterm to all processes in the group with:

kill(0, SIGTERM)

and then next call is

abort()

(this should dumpe the core)

however it looks like the process never reaches abort, i dont see a coredump ...

looks like it receives the SIGTERM before SIGABORT

how can achieve my goal?

#asknostr #programming #c #linux

Avatar
daum3ns 1y ago

solved it!

with an additional fork... in the original process i ca abort, in the forked process i send sigterm to all others ... nice 💜

#linux #programming #c

nostr:nevent1qqsza9xuc30zrlucxl48qmc4whyxqv7yth2prlapvkf03hlzv55mx3cpzemhxue69uhhyetvv9ujuurjd9kkzmpwdejhgq3qy6sz5zexc5arc7p80styjxj2df6awa2zas5m7u78yya2yp2dp9ysxpqqqqqqzpn3k4e

Reply to this note

Please Login to reply.

Discussion

No replies yet.