Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've written a program in C#/Mono that probes a device to determine if it is a modem.

The program works fine from the command line. However, when it is called from PROGRAM= in a udev rule, the program runs properly until the end, and then fails to terminate. As an additional piece of information, the program does terminate when called from RUN+=.

The program also terminates successfully, even when called from PROGRAM=, on a different system based on Ubuntu. The system in question here is running Gentoo.

Additionally, a one line "Hello world" application written in C# has the same symptoms as my application.

What could cause the program not to terminate?

share|improve this question
There is not enough information to answer this question. The program fails to terminate because there's a bug. If you want specific help, reduce your program to a short snippet that exhibits the problem and ask on Stack Overflow. As a general debugging tip, try running the program under strace and compare a working run with a non-working run; this will show where the behaviors diverge if the program is reacting differently to different external events. If the problem is an issue inside the program such as an internal race condition, you'll have to add debugging traces or use a debugger. – Gilles Nov 20 '11 at 22:27
Gilles: A "hello world" C# program has the exact same behavior as my application; it isn't a bug in my code. – David Pfeffer Nov 20 '11 at 22:41
Ah, then it's a different matter. What if the program doesn't print anything? Can you reproduce this with a non-C# program? What precise versions of the C# compiler and runtime environment are you using? What does strace show? – Gilles Nov 20 '11 at 23:06
Gilles: No dice with a non-printing program too. And no, its definitely a Mono issue, but I'd need to narrow down the environmental cause before I could report it. gdb makes it seem like its waiting on a semaphore; strace shows the exact same output except that when udev calls it, it has less in the trace (ends earlier). Both the Ubuntu and the Gentoo system are running on 2.10.2-r1 of Mono. – David Pfeffer Nov 20 '11 at 23:16
(This was tested on 2.10.5 in Gentoo, but it worked on 2.10.2-r1 on Ubuntu so I downgraded Mono on Gentoo in order to sync up.) – David Pfeffer Nov 20 '11 at 23:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.