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

Core dump accessing some $[monitor] variables #101

Closed
afhp-2020 opened this issue May 26, 2020 · 7 comments · Fixed by #102
Closed

Core dump accessing some $[monitor] variables #101

afhp-2020 opened this issue May 26, 2020 · 7 comments · Fixed by #102

Comments

@afhp-2020
Copy link

Just exploring and checking out the manpage, accessing some of the monitor-related variables will crash fvwm3 and dump core, e.g. Echo $[monitor.whatever] at the FvwmConsole.

The following work: $[monitor.primary], $[monitor.current], $[monitor.count]

On the other hand, $[monitor.output] and all monitor-specific geometry-related variables crash.

Compiled from today's master (76b8e2e) on FreeBSD 12.1-RELEASE-p5 amd64.

Latest core dump, accessing $[monitor.$[monitor.current].x] available if that helps (also crashes if monitor name is specified explicitly).

@ThomasAdam
Copy link
Member

Hi @afhp-2020,

Yeah, not surprised.

Please can you get me a bt full backtrace from gdb?

@afhp-2020
Copy link
Author

I have no idea how to do that. Last time I used a debugger on compiled code must have been in the Turbo Pascal timeframe :)

I'll be glad to follow any instructions you could provide.

@ThomasAdam
Copy link
Member

@afhp-2020,

Sure. If you can recompile FVWM3 with:

make clean
make CFLAGS="-O0 -ggdb"
sudo make install

... then reproduce your problem, you'll find the coredump in the same place you did before.

Then install gdb, and run:

gdb /path/to/fvwm3 /path/to/corefile

... then you'll find a prompt like this:

(gdb)

... in there, type:

bt full

... and send me the output here.

Thanks!

@afhp-2020
Copy link
Author

Thank you. This and a quick lookup of SO (about redirecting output) helped.

Here it is, running Echo $[monitor.output] at the FvwmConsole.

For some reason, the debug version would not start my MainPanel but it doesn't really matter.

fvwm3-gdb.log.txt

ThomasAdam added a commit that referenced this issue May 26, 2020
Rather than using sscanf() to try and split a string up to a known
delimiter (period) which is not valid whitespace, instead use strsep()
to tokenise the string and match on the constituent parts.

This should avoid segfaults across platforms.

Fixes #101
@ThomasAdam
Copy link
Member

Hi @afhp-2020,

Thanks. Please can you have a look at #102 (ta/gh-101 branch). Hopefully that'll fix the segfault.

Kindly,
Thomas

@ThomasAdam ThomasAdam linked a pull request May 26, 2020 that will close this issue
@afhp-2020
Copy link
Author

Fixed.

All geometry-related monitor variables respond normally, including incomplete references, e.g.
Echo $[monitor.$[monitor.current]][fvwm][Echo]: $[monitor.DVI-I-1]
Echo $[monitor.$[monitor.current].height][fvwm][Echo]: 1200

What exactly is the meaning of output in this context ?
Echo $[monitor.output][fvwm][Echo]: $[monitor.output]
Echo $[monitor.$[monitor.current].output][fvwm][Echo]: 733
About this one, the manpage should be fixed, 1) to explain output and 2) to specify the call format $[monitor.<n>.output].

Thanks again for such a prompt fix.

@ThomasAdam
Copy link
Member

@afhp-2020,

output refers to the number RandR assigns the monitor, which is an identifier FVWM3 uses internally. It'll be used more for when FvwmEvent learns about RandR events (#26).

I'll take a look at the man page, although patches welcome! ;)

ThomasAdam added a commit that referenced this issue May 27, 2020
Rather than using sscanf() to try and split a string up to a known
delimiter (period) which is not valid whitespace, instead use strsep()
to tokenise the string and match on the constituent parts.

This should avoid segfaults across platforms.

Fixes #101
mikeandmore pushed a commit to mikeandmore/fvwm3 that referenced this issue Nov 28, 2020
Rather than using sscanf() to try and split a string up to a known
delimiter (period) which is not valid whitespace, instead use strsep()
to tokenise the string and match on the constituent parts.

This should avoid segfaults across platforms.

Fixes fvwmorg#101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants