Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard dictionary visibility check in hacker's edition #9

Merged
merged 1 commit into from
Nov 2, 2018

Conversation

avsej
Copy link
Contributor

@avsej avsej commented Oct 31, 2018

Using unintialized pointer leads to segmentation fault in developer's
firmware when turning pages of the book

QBookApp: 13:37:38.232 Debug: MouseFilter::TouchEventType MouseFilter::getTouchType() ELAPSED 228 ms, MOVED  QPoint(-923,101)
QBookApp: 13:37:38.235 Debug: virtual bool MouseFilter::eventFilter(QObject*, QEvent*) RELEASE-TAP/SWIPE
Segmentation fault

Using unintialized pointer leads to segmentation fault in developer's
firmware when turning pages of the book

    QBookApp: 13:37:38.232 Debug: MouseFilter::TouchEventType MouseFilter::getTouchType() ELAPSED 228 ms, MOVED  QPoint(-923,101)
    QBookApp: 13:37:38.235 Debug: virtual bool MouseFilter::eventFilter(QObject*, QEvent*) RELEASE-TAP/SWIPE
    Segmentation fault
@pazos
Copy link

pazos commented Nov 1, 2018

@avsej thank you very much for this fix.

@pazos
Copy link

pazos commented Nov 1, 2018

@avsej: When I installed developer's firmware I found this bug too, I didn't care too much because I want to port KOReader to these devices but now that I know this can be fixed I think it will be better to have both readers available and switch between them on demand.

Could you please share the binary you compiled? Did you found any other bug / difficulty building the application? Thanks again

@avsej
Copy link
Contributor Author

avsej commented Nov 2, 2018

Here is my binary: http://files.avsej.net/QBookApp-1

And here are my steps to produce the binary. In my home directory I've got code/bq where I checkout this repo along with the SDK.

docker run --rm -v$HOME/code/bq:/bq -ti ubuntu:16.04 /bin/bash

And the in the docker

mv /usr/lib/gcc-cross/arm-linux-gnueabi/5/libstdc++.so{,.bak}
mv /usr/arm-linux-gnueabi/lib/libstdc++.so.6{,.bak}

ln -sf /bq/bqeReaderSDK-5.0.2/mx508-rootfs-devel/usr/lib/arm-linux-gnueabi/libstdc++.so.6 /usr/lib/gcc-cross/arm-linux-gnueabi/5/libstdc++.so
ln -sf /bq/bqeReaderSDK-5.0.2/mx508-rootfs-devel/usr/lib/arm-linux-gnueabi/libstdc++.so.6 /usr/arm-linux-gnueabi/lib/libstdc++.so.6

mkdir /bq/bqeReaderSDK-5.0.2/mx508-rootfs-devel/usr/include/sys/
cp  /bq/bqeReaderSDK-5.0.2/mx508-rootfs-devel/usr/include/arm-linux-gnueabi/sys/socket.h /bq/bqeReaderSDK-5.0.2/mx508-rootfs-devel/usr/include/sys/

apt-get update && apt-get upgrade -y && apt-get install -y git vim make qt4-dev-tools g++-arm-linux-gnueabi
cd /bq/cervantes; git clean -dfx; ./build.sh -clean -hackers -disable_adobe -prefix /bq/bqeReaderSDK-5.0.2

I know those steps with shuffling shared objects are hack, but I don't have enough time to do it properly. Maybe maintainers will give more precise build instructions.

@pazos, the only issue I've got with my binary, is that it cannot apply fonts for some reason. But now I just installed recent koreader, and everything goes perfect. I'm afraind that the official reading app is pretty much abandoned now, as email server bouncing messages sent to the addresses of commiters.

@mmind mmind merged commit e4ecb6a into bq:master Nov 2, 2018
@mmind
Copy link
Contributor

mmind commented Nov 2, 2018

Hi Sergey,

thanks for catching that issue, which I now have merged here, and also into our internal repository.
It is really cool to actually see people using the developer mode on our ebook readers :-) .

While the repository looks somewhat less active, it is definitly not abandoned and your other email seems to have reached our support people, who pointed me to your merge request. But yeah the people whose emails you can see in the commits here on github have set sail to new adventures in the meantime since their last commits.

As for build environment, that is currently sort of an achilles heel as our internal buildhost is still running an older ubuntu and also an older gcc and I'm actually working on modernizing that, but that might most like take a bit more time.

@pazos
Copy link

pazos commented Nov 2, 2018

@mmind we have a recent crosstool-ng toolchain tailored for these devices at https://github.com/koreader/koxtoolchain. It should work as is to cross-compile qt and other stuff. It works as is to cross compile qt and qt applications for these devices, as long as you statically link libstdc++ since the version present in Wheezy is too old to work with toolchains based on recent gcc

BTW, thank you for providing the sources of your program. It made porting other software a lot easier.

I'm not sure about this but it seems that the wireless chip is powered on boot and you didn't try to turn it off when it is not used. That is weird because your kernel has a module which does that (sdio_wifi_pwr). It can be handled from userspace writting to /dev/ntx_io but I didn't found any related call.

@mmind
Copy link
Contributor

mmind commented Nov 3, 2018

@pazos generally the wifi chip enters some low-power-state on its own when not in use and it's always a tradeoff between startup time of the chip and power consumption.

Generally the bsp-wifi-modules do not take kindly to power getting pulled from under them, so you'd always do: wifi-down; rmmod wifi-module; powerdown-wifi ... powerup-wifi; insmod; wait for everything to probe; connect wifi
With some functions getting triggered from the book view by the user, this is delay we don't want to incur, so opted to keeping the core supply enabled.

@BalooRJ1
Copy link

Thanks for this fix...is there a way I can apply or install and use the formed binary on a BQ Touch Light running the 7.0.2 firmware from here to fix this issue? https://blog.bq.com/es/bq-ereaders-developers-program/ Or is there an upgraded build of the reader for the Touch Light that can be installed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants