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

Segfault in some constellation with <template> tag #124

Closed
foobar27 opened this issue Jan 2, 2018 · 4 comments
Closed

Segfault in some constellation with <template> tag #124

foobar27 opened this issue Jan 2, 2018 · 4 comments

Comments

@foobar27
Copy link

foobar27 commented Jan 2, 2018

The following document

<!DOCTYPE html>
<html>

<body>
<template>
  <div></div>
  </form>
</template>

</body>

</html>

is throwing a segfault:

$ bin/myhtml/html2sexpr /tmp/broken-body.html
Segmentation fault (core dumped).

gdb stacktrace with debug symbols:

Thread 2 "html2sexpr" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff77ef700 (LWP 15691)]
0x0000000000415cd8 in myhtml_tree_node_insert_text (tree=0x7d96d0, token=0x7e8708) at source/myhtml/./tree.c:645
645             if(adjusted_location->last_child && adjusted_location->last_child->tag_id == MyHTML_TAG__TEXT &&
(gdb) bt
#0  0x0000000000415cd8 in myhtml_tree_node_insert_text (tree=0x7d96d0, token=0x7e8708) at source/myhtml/./tree.c:645
#1  0x000000000040f5f1 in myhtml_insertion_mode_in_body (tree=0x7d96d0, token=0x7e8708) at source/myhtml/./rules.c:1176
#2  0x000000000041406d in myhtml_rules_tree_dispatcher (tree=0x7d96d0, token=0x7e8708) at source/myhtml/./rules.c:3898
#3  0x0000000000424ab9 in myhtml_parser_stream (thread_id=0, ctx=0x7ffff7f8e148) at source/myhtml/./parser.c:28
#4  0x000000000041d410 in mythread_function_queue_stream (arg=0x7d91e8) at source/mycore/./thread_queue.c:605
#5  0x00007ffff7bc16ba in start_thread (arg=0x7ffff77ef700) at pthread_create.c:333
#6  0x00007ffff78f73dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

I encountered the bug in a very old version, but it's reproducible in 70731d4.

lexborisov added a commit that referenced this issue Jan 3, 2018
@lexborisov
Copy link
Owner

Hi,
Thanks, fixed!

lexborisov added a commit to lexborisov/Modest that referenced this issue Jan 3, 2018
@lexborisov
Copy link
Owner

Close the task if the solution suits you.
Thanks!

@foobar27
Copy link
Author

foobar27 commented Jan 4, 2018

Thanks, it works.

@foobar27 foobar27 closed this as completed Jan 4, 2018
@lexborisov
Copy link
Owner

you're welcome

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

No branches or pull requests

2 participants