• 7200阅读
  • 7回复

S3C2410上一个QTE多线程程序的执行问题 [复制链接]

上一主题 下一主题
离线vera
 
只看楼主 正序阅读 楼主  发表于: 2006-10-08
编写了一个需要多线程支持,包含系统调用(自己写的驱动)的程序,在X86-qtopia和arm-qtopia下编译都通过了,决定下到板子上试试。

但是运行后报错:
。。。。 __6QMutex 什么的认不到   (具体的没考过来)

运行HELLO例程:
可以正常运行。

考虑是这2410的板子买来时带的QTE的库是不支持多线程的,而我交叉编译时用的arm-qtopia下的库是加了线程支持的,于是用ftp get了 libqte.so.2.3.7, 放到了板子的 /opt/qt/lib/下,但是该目录下的fonts文件夹没有做改变。

重新设置好环境变量,insmod了驱动模块后运行我的程序:
报错:
Bus Error

运行HELLO例程:

报错:
Bus Error

看来一定是库文件出问题了,但是问题是什么呢?该怎么解决呢?
离线mychris
只看该作者 7楼 发表于: 2009-05-11
问下楼主,我用的是QT2,在交叉编译ARM平台下的QT时,我QT/ E2.3.7用
cp $QPEDIR/src/ qt/qconfig-qpe.h src/tools/
./configure -platform linux-arm-g++ -qconfig qpe -thread -depths 16,24,32
make -C src
都安装成功.但是在QT目录下的lib库中,没有libqt-mt这样的库~,多线程没法使用。不知道问题在哪?
离线fengshenx

只看该作者 6楼 发表于: 2006-10-16
libqte.so.2.3.7

多线程的一般都是libqte-mt吧?
离线vera
只看该作者 5楼 发表于: 2006-10-10
看了shiroki 关于BUS ERROR 的说明, 觉得有一件事不清楚,就是为什么HELLO例程在不使用驱动和硬件的情况下也会包BUS ERROR的错误呢?

这个问题肯定和库相关把,因为错误是因为我换了个加了线程支持的库引起的。
离线vera
只看该作者 4楼 发表于: 2006-10-10
有人说这个QTE2.3.7对多线程支持不完善,是不是指的是没有QMutex这个类?

我写程序的时候刚开始参考的是3.X的那个中文的文档,添加了头文件qmutex.h, 但是后来报错,查了2.3.7的文档才发现是没有这个头文件的,但是在QThread类中说使用的时候只包含qthread.h就可以了,所谓的不完善指的是这个吗?

我现在是需要使用pthread重新把程序改一遍还是换一个3.x的QTE重新编译程序呢?
正在改写,C和C++如此混合,恼火……
离线vera
只看该作者 3楼 发表于: 2006-10-10
驱动没有问题,
在使用QT程序之前针对该驱动写了测试程序,已经完成测试,现在实际上是把这个测试程序和QT的图形界面整合到一起。
离线fengshenx

只看该作者 2楼 发表于: 2006-10-10
你应该先确定你的驱动没有问题。
离线shiroki

只看该作者 1楼 发表于: 2006-10-09
关于bus error的解释, 希望有所帮助
In computing, a bus error is generally an attempt to access memory that the CPU cannot physically address. Bus errors can also be caused by any general device fault that the computer detects.

A bus error rarely means that computer hardware is physically broken. It is normally caused by buggy software trying to access something it can't.

There are two main causes of bus error:

non-existent address
  The CPU is instructed by software to read or write a specific physical memory address. Accordingly, the CPU sets this physical address on its address bus and requests all other hardware connected to the CPU to respond with the results, if they answer for this specific address. If no other hardware responds, the CPU raises an exception, stating that the requested physical address is unrecognised by the whole computer system. Note that this only covers physical memory addresses. When software tries to access an undefined virtual memory address, that is generally considered to be a segmentation fault rather than a bus error.

unaligned access
  Most CPUs are byte-addressable, where each unique memory address refers to an 8-bit byte. Most CPUs can access individual bytes from each memory address, but they generally cannot access larger units (16 bits, 32 bits, 64 bits and so on) without these units being "aligned" to a specific boundary, such as 16 bits (addresses 0, 2, 4 can be accessed, addresses from 1, 3, 5, are unaligned) or 32 bits (0, 4, 8, 12 are aligned, all addresses in-between are unaligned). Attempting to access a value larger than a byte at an unaligned address can cause a bus error.

CPUs generally access data at the full width of their data bus at all times. To address bytes, they access memory at the full width of their data bus, then mask and shift to address the individual byte. This is inefficient, but tolerated as it is an essential feature for most software, especially string-processing. Unlike bytes, larger units can span two aligned addresses and would thus require more than one fetch on the data bus. It is possible for CPUs to support this, but this functionality is rarely required directly at the machine code level, thus CPU designers normally avoid implementing it and instead issue bus errors for unaligned memory access.
--
shiro is White
ki is tree
http://www.cuteqt.com
论坛 http://www.cuteqt.com/bbs
博客 http://www.cuteqt.com/blog
博客镜像: http://sites.cuteqt.com/cuteqt
Linux/Qt/嵌入式讨论群 http://qun.qq.com/air/5699823
快速回复
限100 字节
 
上一个 下一个