Problem calling mono app from php script

Posted on 2010-01-13
Medium Priority
Last Modified: 2016-02-19

I am trying to run a mono application from within a php script. It works fine when I run the script using php on the command line. But when I run the script from my browser it does not work.

This is the error:

** (CBSearch.exe:19645): CRITICAL **: _wapi_shm_file_open: shared file [/var/www/.wapi/shared_data-linux-Linux-x86_64-328-11-0] open error: No such file or directory

** (CBSearch.exe:19645): CRITICAL **: _wapi_shm_attach: shared file [/var/www/.wapi/shared_data-linux-Linux-x86_64-328-11-0] open error

** ERROR **: file shared.c: line 346 (shm_semaphores_init): assertion failed: (tmp_shared != NULL)

** (process:19645): WARNING (recursed) **: Thread (nil) may have been prematurely finalized

** (process:19645): WARNING (recursed) **: Thread (nil) may have been prematurely finalized

** (process:19645): WARNING (recursed) **: Thread (nil) may have been prematurely finalized

Native stacktrace:

        mono [0x529817]
        /lib64/libpthread.so.0 [0x3d1860e7c0]
        /lib64/libc.so.6(gsignal+0x35) [0x3d17e30265]
        /lib64/libc.so.6(abort+0x110) [0x3d17e31d10]
        /lib64/libglib-2.0.so.0(g_log+0) [0x3bfe434eb0]
        /lib64/libglib-2.0.so.0(g_log+0x83) [0x3bfe434f33]
        /lib64/libglib-2.0.so.0(g_assert_warning+0x76) [0x3bfe434fb6]
        mono [0x4c5fdc]
        mono [0x4cab9c]
        mono(mono_once+0x44) [0x4c6634]
        mono [0x4cad34]
        mono [0x4cf3d8]
        mono [0x4bd5a7]
        mono(mono_runtime_init+0x25) [0x46ace5]
        mono [0x4f1745]
        mono(mono_main+0x341) [0x414811]
        /lib64/libc.so.6(__libc_start_main+0xf4) [0x3d17e1d994]
        mono(realloc+0x371) [0x413f29]

Debug info from gdb:

(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0x2ade6b710d10 (LWP 19645)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
0x0000003d17ecce83 in __select_nocancel () from /lib64/libc.so.6
* 1 Thread 0x2ade6b710d10 (LWP 19645)  0x0000003d17ecce83 in __select_nocancel
    () from /lib64/libc.so.6

Thread 1 (Thread 0x2ade6b710d10 (LWP 19645)):
#0  0x0000003d17ecce83 in __select_nocancel () from /lib64/libc.so.6
#1  0x0000003bfe455efc in g_spawn_sync () from /lib64/libglib-2.0.so.0
#2  0x0000003bfe4562b8 in g_spawn_command_line_sync ()
   from /lib64/libglib-2.0.so.0
#3  0x00000000005298b8 in ?? ()
#4  <signal handler called>
#5  0x0000003d17e30265 in raise () from /lib64/libc.so.6
#6  0x0000003d17e31d10 in abort () from /lib64/libc.so.6
#7  0x0000003bfe434eb0 in g_logv () from /lib64/libglib-2.0.so.0
#8  0x0000003bfe434f33 in g_log () from /lib64/libglib-2.0.so.0
#9  0x0000003bfe434fb6 in g_assert_warning () from /lib64/libglib-2.0.so.0
#10 0x00000000004c5fdc in ?? ()
#11 0x00000000004cab9c in ?? ()
#12 0x00000000004c6634 in mono_once ()
#13 0x00000000004cad34 in ?? ()
#14 0x00000000004cf3d8 in ?? ()
#15 0x00000000004bd5a7 in ?? ()
#16 0x000000000046ace5 in mono_runtime_init ()
#17 0x00000000004f1745 in ?? ()
#18 0x0000000000414811 in mono_main ()
#19 0x0000003d17e1d994 in __libc_start_main () from /lib64/libc.so.6
#20 0x0000000000413f29 in g_str_equal ()
#21 0x00007fff303bb558 in ?? ()
#22 0x0000000000000000 in ?? ()

Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
Question by:zattz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

zattz earned 0 total points
ID: 26302212
Found solution:

A really lame fix is to create /var/www/.wapi, chown it to
www-data:www-data, and chmod it 770 to hide it from the world.

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question