0

Here's the hard-core problem.

I have a piece of code written in C++. The code is part of a website, run on Apache and built using PHP. Every time a user submits some data, the code will process those data. However, the code always throws coredump error (signal 11) when called through the web interface. It runs no problem at all in the shell under my own username. I also tried to run it as user www-data and it works well.

So my question is really down to Why it doesn't run when called through the web interface and how to fix it?

The OS is Ubuntu Server 12.04 x64.

Many many thanks.

4

1 回答 1

0

在 valgrind 的帮助下,我终于解开了这个谜团。问题在于头文件的一行,它尝试使用 getenv("USER") 读取“$USER”。虽然 env 参数是在我的本地 shell 中设置的,但在通过 Web 界面调用代码时它是未设置的。不知道为什么它没有设置。导出 env 参数后,现在一切正常。

希望有一天这可以帮助某人。

于 2013-08-15T11:39:24.180 回答