代理设置:设置HTTP_PROXY和HTTPS_PROXY环境变量答源颤
container:loginlog in to Heroku Container Registry
container:logout log out from Heroku Container Registry
container:pull pulls an image from an app's process type
container:push builds, then pushes Docker images to deploy your Heroku app
container:release Releases previously pushed Docker images to your Heroku app
container:rm remove the process type from your app
container:run builds, then runs the docker image locally
heroku local [进程类型] -e 环境变量 -f 指定procfile -p 指裂喊定端口
用于本地启动清败
heroku local:run 启动一个本地的one-off
heroku run 启动heroku的one-off进程
heroku run:detached 启动heroku的one-off进程并在后台运行
heroku ps:exec 在dyno中执行 但是如果app是用docker部署的,则需要
此外,在该ssh中,不会显示config中设置的环境变量
heroku ps:forward PORT
heroku ps:socks --app murmuring
putty窗口下测试运行,它工作正常。唤握但是,当放入启动脚本中时(例如,rc.local),不管有没有"sudo",它都崩溃了。注意:应用程序只有在开机自动运行后才会崩溃;如果粗慎在putty (命令行)中运行脚本,则没有问题。
在每次snd_xxx函数调用之前添加日志岩链敬记录后,发现应用程序在调用snd_pcm_hw_params_any之后停止,这意味着它在snd_pcm_open和snd_pcm_hw_params_alloca之后崩溃。代码如下:
g_pLog->LogInfo(LOG_SYS, "[audio]snd_pcm_open")/////logged
if ((pcm = snd_pcm_open(&pcm_handle, acDev, /////PCM_DEVICE, acDev="default:0"
SND_PCM_STREAM_PLAYBACK, 0)) <0)
{
sprintf(acLog, "[audio]Can't open \"%s\" PCM device. %s\n", acDev, snd_strerror(pcm))
g_pLog->LogInfo(LOG_SYS, acLog)
return -1
}
g_pLog->LogInfo(LOG_SYS, "[audio]snd_pcm_hw_params_alloca") /////logged
/* Allocate parameters object and fill it with default values*/
snd_pcm_hw_params_alloca(&params)
g_pLog->LogInfo(LOG_SYS, "[audio]snd_pcm_hw_params_any") /////logged and is the last line
snd_pcm_hw_params_any(pcm_handle, params)
g_pLog->LogInfo(LOG_SYS, "[audio]snd_pcm_hw_params_set_access")
/* Set parameters */
if (pcm = snd_pcm_hw_params_set_access(pcm_handle, params,
SND_PCM_ACCESS_RW_INTERLEAVED) <0)
...
复制
收集核心转储文件并使用gdb "bt full“进行检查后,结果为:
root@linaro-ubuntu-desktop:/test# gdb ./AudioPlayer /opt/core.AudioPlayer.6277.1604311455.6
GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabi".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /test/AudioPlayer...(no debugging symbols found)...done.
[New LWP 6277]
[Thread debugging using libthread_db enabled]
Core was generated by `/test/AudioPlayer'.
Program terminated with signal 6, Aborted.
#0 0x2ad8bed6 in ?? () from /lib/arm-linux-gnueabi/libc.so.6
(gdb) bt full
#0 0x2ad8bed6 in ?? () from /lib/arm-linux-gnueabi/libc.so.6
No symbol table info available.
#1 0x2ad9a0da in raise () from /lib/arm-linux-gnueabi/libc.so.6
No symbol table info available.
#2 0x2ad9c506 in abort () from /lib/arm-linux-gnueabi/libc.so.6
No symbol table info available.
#3 0x2ad951ec in __assert_fail () from /lib/arm-linux-gnueabi/libc.so.6
No symbol table info available.
#4 0x2ac6cb72 in snd_pcm_hw_refine () from /usr/lib/arm-linux-gnueabi/libasound.so.2
No symbol table info available.
#5 0x0000aca8 in main ()
No symbol table info available.
复制
注意"snd_pcm_hw_refine“不是直接从应用程序调用的。
我想知道在putty中运行和从开机启动脚本运行之间有什么区别,以及如何解决这个问题。如果你能给我建议,我将不胜感激。
浏览 91关注 0得票数 1
原文
1 个回答
高票数
*** 作
CL.
修改于2020-11-04
得票数 0
调用snd_pcm_open() open失败。由于pcm未签名,因此错误代码检查将失败。由于pcm_handle为NULL,snd_pcm_hw_params_any()随后崩溃。
在这段代码中还有很多其他错误。忘了它吧。使用类似如下的内容:
#include <stdio.h>
#include <stdlib.h>
#include <alsa/asoundlib.h>
static void alsa_check(int result, const char *call)
{
if (result <0) {
fprintf(stderr, "%s failed: %s\n", call, snd_strerror(result))
exit(1)
}
}
#define CHECK(f) alsa_check(f, #f)
static void play(snd_pcm_t *pcm, int frame_size)
{
#define FRAMES 50000
void *buf, *data
int frames, rest
buf = malloc(FRAMES * frame_size)
for () {
frames = fread(buf, frame_size, FRAMES, stdin)
if (frames <= 0)
break
rest = frames
data = buf
while (rest >0) {
frames = snd_pcm_writei(pcm, data, rest)
if (frames <0)
CHECK(snd_pcm_recover(pcm, frames, 0))
else {
rest -= frames
data += frames * frame_size
}
}
}
free(buf)
}
int main(int argc, char *argv[])
{
const char *device = "default"
snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE
snd_pcm_access_t access = SND_PCM_ACCESS_RW_INTERLEAVED
unsigned int channels, rate
unsigned int latency = 500000/* 0.5 s */
snd_pcm_t *pcm
if (argc != 3) {
fprintf(stderr, "Usage: %s rate channels <inputfile\n", argv[0])
return 1
}
rate = atoi(argv[1])
channels = atoi(argv[2])
CHECK(snd_pcm_open(&pcm, device, SND_PCM_STREAM_PLAYBACK, 0))
CHECK(snd_pcm_set_params(pcm, format, access, channels, rate, 1, latency))
play(pcm, channels * snd_pcm_format_physical_width(format))
CHECK(snd_pcm_drain(pcm))
snd_pcm_close(pcm)
return 0
}
复制
原文
6
0
页面原文内容由runningdog、CL.提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:https://stackoverflow.com/questions/64639206
复制
相似问题
Flask脚本windows子进程和sys得票数 2
Google Container引擎崩溃后自动重启得票数 0
在rails服务器使用foreman完全启动后,我如何启动Procfile进程?得票数 0
使用Heroku - start脚本部署Node.js应用程序得票数 0
通知用户应用程序之前已崩溃得票数 0
如何修复我的npm启动脚本?得票数 0
使用pm2管理python应用程序得票数 2
我尝试在heroku中部署我的web应用程序,在本地主机上一切正常,但在heroku中我得到以下错误得票数 0
KDB脚本不断崩溃得票数 0
如何在node.js应用程序的Heroku上调试应用程序崩溃[H10得票数 0
活动推荐
年末·限时回馈
热卖云产品年终特惠,2核2G轻量应用服务器7.33元/月起,更多上云必备产品助力您轻松上云
广告关闭
分享链接
关注问题
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)